“Pedrone” Part #2 – connecting to smartphone

After the Part #1, with the Servo Motors control program, now I connected a smartphone to the circuit. The software on the phone (in the next future) will do all the Internet job, receiving commands and sending pictures. Anyway, a connection is needed to control the hardware (motors) for moving “Pedrone” via web commands. A very simple solution is to use the headphone jack and send some tones to activate the motors. As first option, I decided for one DTMF tone decoder, but after some considerations, like the absence of noise on direct connection, I decided to use single tones. The hardware is very simple (stereo version is shown, but you just need one channel) :

Particular of the schematic (click to enlarge)

Particular of the schematic (click to enlarge)

This circuit is a mixer of Left and Right audio channels coming from the headphones jack of the smartphone, followed by protection resistor and diodes to safely connect to the ICP1 pin of the micro ATmega48. The ICP1 is the input capture pin of Timer 1 (TMR1). I used such peripheral to measure the period of incoming frequency. There are three frequencies: the first is considered as “start” signal and the other two as “0” and “1”. The protocol isn’t still implemented (will follow soon). At this moment, the test program just recognizes the frequencies and does a programmed action for anyone of them. The frequencies are 800Hz, 1200Hz end 1600Hz. All the tones have 50 mS duration. The complete schematic (including the servo motors outputs) is in the following picture

The complete schematic (a PDF version is in the downloadable project's zip file) - click to enlarge

The complete schematic (a PDF version is in the downloadable project’s zip file) – click to enlarge

If you are interested in the C source list and in the hex file to burn into the micro, you can download both of them (plus the schematic PDF), from this link: Pedrone2.zip
(password for zipped file: eficara)

There is a small video to show the program running. The application for Android smartphone has not been published on Play Store, because it’s just for testing purposes, but if you want you can download the apk directly from this link: Pedrone-rx.apk.

Pedrone part 2 – connecting to smartphone di robotop

Here is the C source list for the test program (compiled with IAR V5.50.0).