Light or dark activated switch using Arduino

 Posted by:   Posted on:    4 comments
Light or dark activated relays are useful devices when you need to automatically turn on lights or activate some other electric device when lighting decreases or increases above a threshold. Usually, to build such a device, you would use a LDR (photoresistor), some resistors to make voltage dividers, an opamp as comparator, a transistor and a relay that will be driven by the transistor.

Using a microcontroller we can design a smarter device. One that does not activate the relay at every instant change of light (flash). The same device can turn from a dark activated relay into a light activated relay at a push of a button.

The following project uses an ATmega328 board with some modules which are part of a popular Arduino sensor kit. Don't worry if you don't have that modules. They are simple circuits for which I provided schematic.
Light or dark activated switch using Arduino

Homemade PCB with toner transfer method

 Posted by:   Posted on:    1 comment

The toner transfer method is a cheap and easy way to make your own printed circuit boards (PCBs) at home. A laser printer is used to print the design on paper. Not all paper types are suitable for this kind of usage. The paper is placed with the printed side over the copper side of the circuit board and then the whole thing is heated. Most people use with good results a common iron, but if you have a laminator, use it instead of the iron. When heated, toner melts and sticks to the surfaces. The idea is to make it stick to the copper layer. After heating, the board is submerged in water and the paper should be easily peeled off from the copper side. A good transfer means no toner remains on the paper. Once this is done, the board can be etched using whatever method you want (ferric chloride for example).

This method is widespread among hobbyists because is cheap and easy. However, for some, the results are unsatisfactory and variable. I will share some of my experiences with this method.

Homemade PCB with toner transfer method incl. silkscreen

Homemade PCB with silkscreen

Virtual Audio Cable in Linux Ubuntu

 Posted by:   Posted on:    7 comments
If you ever wanted to pipe an audio stream from an application to another, you probably know that there are some virtual sound card drivers available for Windows. But what about Linux? Well, there are a lot of options, some being more complicated than others.

You probably need to do audio piping to record an audio output or to use SDR tools which only support audio input. You don't have to use a real cable to wire the sound card output into line in. The software approach is better. There is more than one way to do this in Linux. We'll look into Pulseaudio and ALSA, the sound servers used by Ubuntu. Depending on what application you use, you may need to configure the virtual connection on one or the other server.
Virtual Audio Cable in Linux Ubuntu

PonyProg release 3.0 comes with modern UI

 Posted by:   Posted on:    2 comments
PonyProg is a software application that can read, write and program various memory chips and microcontrollers using the simplest possible interface: a serial port adapter. This adapter consist of only some resistors and some voltage limiting zener diodes. However, this approach has a big downside nowadays. It doesn't work with USB to serial converters. And computers with a real serial port are becoming very rare.

If you still have an older computer with a motherboard serial port, you may take into consideration building the serial adapter used by PonyProg, because it is easy to build and probably the cheapest programmer possible. The schematic of the interface can be found at the author's page (SI-Prog by Claudio Lanconelli).

Currently, PonyProg only support SI-Prog or other serial based programmers and some parallel port programmers. With serial port, it communicates by bit-banging various protocols to the signaling lines contained in the RS232 interface (RTS, CTR and DTR). It would be nice if a future version would support the modern USB based programmers (like the CH341A MiniProgrammer) which lack a good software.

PonyProg release 3.0 comes with modern UI
PonyProg 3.0 main window after reading an I2C EEPROM

CH341A I2C Programming (Windows API)

 Posted by:   Posted on:    19 comments
CH341A is an USB interface chip that can emulate UART communication, standard parallel port interface, parallel communication and synchronous serial (I2C, SPI). The chip is manufactured by Chinese company Jiangsu QinHeng Ltd.

CH341A is used by some cheap memory programmers. The IC is somehow limited in this configuration, because the programmer makes use only of the SPI and I2C interface. A popular device is the so-called "CH341A MiniProgrammer" that you can buy for 2 to 5 USD. And this is probably the cheapest device using CH341A.

If you got a "MiniProgrammer", you may want to use for more than memory chips programming. The device can actually be used as USB to I2C converter (not only I2C, but this article will focus only on I2C function). Let's see how to use the included library and header to communicate with I2C devices.
CH341A I2C Programming