Bargraph timer, an unusual LM3914 application

 Author:   Posted on:    No comments

LM3914 and LM3915 are dot/bar display drivers used to create basic displays of analog voltage levels. They are widely used in VU-meters and various voltage indicators (for batteries). The LM3914 senses an analog voltage and drives a number of LEDs depending on the level of this voltage. Knowing this, we can provide this voltage from a discharging capacitor. Depending on the resistive load which discharges the capacitor, the time required to turn off all LEDs can be set to specific intervals. This is how a timer is made using LM3914 (or LM3915).

This IC contains a constant current source for LEDs and an adjustable voltage reference. The following circuit uses LM3914 internal current source to charge the capacitor. To be able to modify countdown time, a potentiometer is used to discharge the capacitor. When the last LED is off two opamps drive a relay. The two opamps are part of the LM358 integrated circuit and one of them is used, in a similar manner, with a capacitor that is charged/discharged to provide an optional turn-off time for the relay. By setting a jumper you can choose between relay always on after time is up or relay on for an adjustable amount of time.

LM3914 countdown timer built on PCB

LM3914 countdown timer built on PCB

Volumetric sensor (broken window or opened door alarm)

 Author:   Posted on:    No comments

The following device can detect sudden small air pressure changes in a room caused by opening a door or breaking a window. It is therefore useful to automate lights or as alarm. Although it uses as detector a common electret microphone, the circuit does not react to sound. Used as an alarm, it will not trigger while you are in the room, unlike infrared and ultrasound movement detectors which need to be deactivated when you are home.

I found this circuit in an old electronics magazine and I decided to build it without expecting too much from a microphone based air pressure sensor. The circuit is purely analog, without microcontrollers. Yet, as I found out it does its job very good. Microphone signal is filtered and amplified using common opamps and a couple of 555 timers keep the relay activated for an adjustable amount of time.

Built volumetric sensor

Built volumetric sensor

Making your printed circuit boards with PCBWay

 Author:   Posted on:    No comments

I'm quite satisfied with the PCBs I can make at home using the toner transfer method. So far, I have made PCBs for through hole devices as well as PCBs for surface mounted devices. My results are acceptable for tracks as thin as 0.3 millimeters. But there is another issue I'm having with the toner transfer method. When I apply the iron to heat the toner, the paper warps and dilates. Not too bad though. I can still solder bigger IC capsules. But what about a double sided PCB? I found it totally impossible to align top with bottom pads across the board. Until now I tried my best to keep all designs single sided by adding wire jumpers where needed.

Yet when it comes to double sided PCBs or even more than two layer PCBs you need to get them professionally manufactured. Even with single sided PCBs when you want them to look professionally built or you need more pieces the right choice is a manufacturing service. I decided to try the PCB manufacturing services of PCBWay, a Chinese company which can manufacture PCBs and ship them worldwide at good prices.

PCBs ordered from PCBWay

PCBs ordered from PCBWay

XTW100 Mini Programmer Software and Tests

 Author:   Posted on:    No comments

I traced the schematic of a new SPI/I2C memory programmer based on STM32 microcontroller: the XTW100 Mini Programmer. I should now use it to program some EEPROM and flash memory chips. Unfortunately, I can't go that far. All tests with the only programming application available went wrong. Everything failed except I2C EEPROM erase. The programming utility is a simple Delphi application, with "Chinese user-friendly operation interface". Not at all user-friendly for someone whose computer does not have any support for Chinese language installed. Anyway, after I couldn't use the programmer at all, I tried debugging it. I put a logic analyzer on all the pins for I2C EEPROM and got some strange PWM-like signals on SCL and A0 lines. Then I thought I could extract the binary firmware from STM32 flash with ST-Link. Bad idea. The device seems to have entered "self-destruct" mode after I cleared the read protection bit and all I can read now is an empty flash.

My programmer is now completely useless (no LEDs, no USB activity). All it needs is a new firmware. Having the schematic and plenty of development options, including Arduino support, writing an alternate firmware for this device is not an impossible task. But it requires time, since a new PC programming utility is also needed. I decided to write this post anyway, maybe this programmer really works for somebody. You can get a partially translated programming tool at the end of this post.

CH341A and XTW100 Mini Programmer

CH341A and XTW100 Mini Programmer

XTW100 Mini Programmer Schematic and Driver

 Author:   Posted on:    No comments

I recently found a new serial programmer, the XTW100 Mini Programmer which is supposed to be an "upgraded" variant of the well-known CH341A Mini Programmer. Having a similar price to CH341A, I didn't wait any longer and ordered myself one. With a PCB slightly bigger (in length) than the PCB of CH341A, this new device is built around an STM32 ARM microcontroller. Having native USB port and hardware I2C and SPI, these microcontrollers with proper firmware could do a good job for this purpose.

Yet, there are some advertised features of this programmer that seem to good to be true (for a 4 USD programmer). Just as I did with the CH341A, I will try to draw the schematic and look for drivers and software for this XTW100 memory programmer. Because the STM32 is a 3.3 V device I can say for sure that this programmer will not have the 5 V bus levels issue. I got my XTW100 from AliExpress / WAVGAT store.

Product photo of XTW100 programmer

Product photo of XTW100 programmer

PID control for DC motor with optical encoder

 Author:   Posted on:    No comments

In the previous post I gathered information about a cartridge slide unit taken from an old inkjet printer. As I found out, the printer used a common DC motor to move the cartridges on X axis, however with the addition of an optical encoder with strip, the cartridges could perform precise movements. So, I want to interface this to Arduino. Original printer electronics such as motor drivers were of no use (proprietary ICs without public datasheets).

I had to drive the motor with a L298N H-bridge module and for the encoder I built a PCB which replaced the original one used in printer. The software is not as simple as you may think. I just can't turn on motor until the reading of encoder equals the desired position. Suddenly stopping the motor will not result in a sudden stop of the sliding block. Due to inertia, it continues to move a bit, even with the motor electrically shorted. The proper approach requires a PID (proportional-integral-derivative) control algorithm which adjusts motor speed using PWM.

The motor with optical encoder wired to Arduino

The motor with optical encoder wired to Arduino