For our final project, we decided to enhance the controls of a Hummer RC truck. Our main objective was to demonstrate that an Atmel microcontroller together with basic hardware building blocks can replace all of the car’s original circuitry. Improving the RC truck’s handling involved adding analog control over steering and speed. The original construction of the car hindered this idea and forced us to resort to some mechanical engineering (mounting a servo) to resolve the problem! Overall, the project was a great deal of fun and involved a lot of tinkering with hardware (including dangerous flirtations with nearly exploding power transistors!)
High Level Design:
In order to emulate the functionality of the original RC car, we had to use 2 microcontrollers; one at the transmitter end to process user input and transmit data and one at the receiver end to pick up that data and control the car’s motors. We found a cheap but reliable way of establishing wireless communication between the two microcontrollers in the form of a receiver transmitter pair by Ming Microsystems.
We wanted to run the dc motor at the rear at variable speeds. Two options were available to us: One is to switch it on and off so fast that it appears to be running at an intermediate speed. By modulating the width of the pulse to the switch we could achieve various duty cycles. The other approach is to limit the current to the motor so as to slow it down. This requires an analog input to the motor and therefore a digital-to-analog converter. We ended up trying both ways and our results are documented below.
The car’s front wheels were originally driven by a magnet. By flipping its polarity, the wheels are repelled all the way to the left or right. This didn’t suit our needs. The other disadvantage of the electromagnet is that it constantly draws current from the battery (~400 mA). By using a servo, power consumption is significant only during transitions of the servo arm. The mini ball bearing FMA servo we used allowed us to have three different steering angles. More steering angles were not conceivable because of the design of the axial for the front wheels of the car.
The receiving MCU lies at the heart of the truck’s circuitry. Two capacitors are used on the voltage regulator (LM78) to stabilize the input/output voltages. Communication between the MCU’s is at 1200 baud and because of noise there is a possibility that the chips can lose synchronization. The receiver could be receiving the correct code but shifted or distorted by noise. To help correct this issue the transmitter must send an initialization byte signaling that the next byte is the appropriate opcode and that the transmitter is the source of the message. The receiver waits to receive this initialization code first, de-bounces to make sure it’s not random noise and then takes action on the next received opcode. The receiver uses a timeout mechanism to turn off the motors if an initialization code is not received for 500 milliseconds.
Read more: EE476 – Final Project Hummer RC Truck