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

Optical encoder motor control for printer slide unit

 Author:   Posted on:    No comments

I disassembled an old inkjet printer without working cartridges. Buying replacement ink cartridges was not worth because the price of both black and white and color ink cartridges equals the price of a new printer. I couldn't throw away the printer without taking any usable electronic and mechanic parts from it. To my surprise, the cartridge holder is placed on a metallic sliding unit that seemed interesting.

Cheap design though. Plastic block sliding on metal axis, but since it did its job in the printer, it may work elsewhere too. However, instead of using a stepper motor to control the sliding unit, the manufacturer has chosen a closed loop system with a regular DC motor and an optical encoder with a strip. That's the approach for most home-use printers. When looking for a way to control such a system with Arduino I didn't quite found something that worked.

Optical encoder motor control for printer slide unit

The printer slide unit with a custom encoder PCB