Taking apart a 15 year old RC car and re-building Part 2
2015-09-18 | By Alex Iannuzzi
License: None
I will use ATtiny84, because it has more pins than the previous microcontroller. Most of the 433MHz receive/transmit code I’m going to take from my Alarm system – Remote control upgrade.
Schematic improvements
I decided to simplify the PWM to the motors and move it to the hardware level, rather than using timers with interrupts like before. So now to turn on the motor in the front direction we set OCR0A and OCR0B for the back direction. Tests showed that when the motor was running and we switched to the other direction it wouldn’t run both at the same time for a few moments.
Check out the schematic.
Power supply
Instead of connecting three Lipos together and using an additional battery for the ATtiny, like I did before, this time I’m having an on-board connector for each battery. We’ve got optional monitoring of cell voltage via the resistor dividers, PDTC144E NPN transistors with built-in resistors for the lights, and FQD11P06 P mosfets. LM7805 regulates voltage for the AVR and 433 MHz receiver. I found out that when I connect more than 7.5 V to the LM7805 input I receive a strange constant waveform on the 433 MHz receiver (huge problem in the FFT view). After several unsuccessful attempts I decided to use 220 Ohm resistor. It puts enough load on transistor and fixes the issue.
433 MHz transmission
At first I started with sending a preamble of “10101101” and a checksum at the end while transmitting the 3 bytes – motor control, servo control, and lights repeatedly. But there was an issue where some of the data wasn’t being received correctly. I went with using the last 6 bits of the third byte for a CRC of the all the bytes, which should give a better result than the 1-bit checksum we used before (but we still continue to use it).
I did a PCB for the RX side and put fuses on each of the Lipos. Gamecube controller is the remote – the front/back lights are on the L and R buttons, hold them down for a few seconds and they stay on.
Check out this short video as well.
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum