Last year I bought a Deskpets Tankbot on sale at Radio Shack for hacking. It came with an ir transmitter dongle for a smart phone. I tried it with an Android phone and found the control to be poor. A search of the internet for a diy controller didn't turn up much , so I built my own. The first version used a pic 12f683 programmed in assembly language. That worked pretty well so I decided to convert it to a picaxe 08M2.
The first step was recording the ir signals from the dongle and smart phone. I used an Arduino Mega with logic analyser software to capture the demodulated signal from an ir receiver module. The software on the PC was OLS 9.7. The sampling rate was 50 kHz. The OLS measurement tools were used to determine the hi/lo timing. After capturing a couple of the commands , I found that each transmission consist of a start pulse and 12 data bits. The start pulse is 3400 uS of the 38 kHz carrier. Each bit is 1700 uS long. A '1' bit is defined as 1000 uS of silence followed by 700 uS of 38KHz carrier. A '0' bit is defined as 500 uS of silence followed by 1200 uS of 38KHz carrier. The second six bits are the first six bits inverted , so each command can be stored in 6 bits. Using these timings , I used the Arduino logic analyser to decode all the commands for my white Tankbot. The Deskpets smart phone app will control several of their products. You choose your Tankbot in the app by color. I have included a text file of all the commands I decoded. I only tested the codes for my white one.
The ir transmissins were reproduced by the 08M2 , by mixing the 38 kHz pwm signal with the output of pulsout commands. The DSM of the 08M2 was used for the mixing to save external components. The pauseus command was used to produce the silent periods. The values for the pauseus and pulsout were built into an array and played back with inline code. I observed the output with the logic analyser and adjusted the timing values until I was close to the original signal. The pulsout timing was close but the pauseus times required significant adjustment .
The controller uses a thumb joystick from a Sony Playstaion controller. I bought it at a goodwill store for two dollars and it has two thumbsticks in it. The housing is an led flashlight from the dollar store. It contained a holder for 3 'AAA' batteries and an on/off switch. It also had 3 white leds , that I used in another project. Not bad for a dollar.
The controller works much better than the smart phone version. The range is only a few feet but I made no effort to maximize it. The IR receiver on the tankbot is in the front , facing forward , so it really hinders it operation. You could move it for better coverage if you were careful. I only found a couple of websites about hacking the Deskpets. The first has a lot of good info and he does a disassembly:
http://www.robocommunity.com/article/19025/Inside-Tankbot/
The second is a Sourceforge page for an open source Android app:
http://sourceforge.net/p/deskpets/discussion/1823058/
I have included the schematic and sourcecode.
IR control of Deskpets Tankbot
- CPU: PICAXE 08M2
- Power source: 3 AAA batteries
- Programming language: Picaxe basic
- Target environment: desktop
This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/picaxe-08m2-controller-for-deskpets-tankbot