The parts you need are:
- Arduino Uno
- Arduino Motor Shield R3
Bluetooth Module (Slave or Master-Slave)
- 9V battery
- Car's battery (needs to be greater than 5V)
- 4 LEDs
- 2 NPN transistors (2N2222)
- 2 1kΩ resistors
- 2 120Ω resistors
- 1 SPST switch
- An RC car with two DC motors. One for steering and one for moving forward/back
- Jumper wires (all lengths and rigidity)
- Solder and Soldering Iron
Disclaimer: Even though the RC car's original circuit can be placed back on the car and function as before, do this modifications at your own risk. Please make sure that the car's motors do not use more than the 2 Amps rated for the motor shield.
First of all, the original control circuit needs to be removed. With this car the motor connectors have headers, which made it easier to extend the wires.
Putting the new control circuit together is relatively easy. The Arduino Motor Shield is made to be stacked on top of the Arduino Uno, as seen in the picture bellow.
This allows you to use most of the pins on the Arduino Uno, except for the ones used to control the two motors. This pins are clearly identified on the Motor Shield. The picture bellow shows these pins, and what they are used for.
the Arduino motor shield is set up so that the power supply connected to the screw terminals (Vin and GND) powers everything (the motors, the L298's logic circuit, and the Arduino). But it is much better to use one power supply for the motors, and another for all the circuitry. This can be achieved by cutting the "Vin Connect" jumper on the shield's backside. The jumper is circled in
the picture below:
I was able to cut it using a big
needle. And to make sure it was correctly cut, I used a multimeter (continuity test). Just follow
the motion represented by the horizontal
red line seen above. Once this jumper is cut/unsolder, the power supply connected to the screw terminals (Vin and GND) will only power the motors. Everything else (the L298's logic circuit, the Arduino, and Bluetooth module) will be powered by the other power supply (9V battery) connected to the Vin and GND headers on the motor shield.
The motor shield uses the L298P dual full bridge driver chip. The pictures bellow show a different package of the chip, but the circuit is the same.
The chip's 2 and 3 pins are connected to one motor, while pins 13 and 14 are connected to another motor. Pins 5, 6, and 7 are used to control the rotating direction, and speed of the motor connected to pins 2 and 3. These three pins (5, 6, and 7) are used for the logic control circuit. Pin 6 is used to ENABLE the motor, DISABLE the motor, or control the motor's speed with a PWM signal. When Pin 6 is HIGH, the motor can be controlled with pins 5 and 7. If pin 6 is LOW, the motor will not move despite pins 5 and 7 state. By using a PWM signal with pin 6, the motor's rotating speed can be set. This is great but as I found out, this causes the motor to make a strange sound. But it happens when using a PWM signal to control an h-bridge. Pins 5 and 7 determine the motor's rotating direction. When pin 5 is HIGH and pin 7 is LOW, the motor will rotate in one direction. When these states are inverted, the motor will rotate in the opposite direction. When these pins are either both LOW or both HIGH, the motor does not move. Pins 10 - 14 have the same function, but control a separate motor. The chip has two different input voltage supplies. The input voltage going into pin 9 powers the logic circuit, and should ideally be 5V. The input voltage going into pin 4 powers the motor/s. It can have a range of 5 - 46V. This chip can have a maximum DC current of 2 Amps, so does the Motor Shield.
The motor shield does use this chip, but its picture (motor shield) shows that it only uses one pin to control each of the two motor's rotating direction. And this can be explained by looking at the motor shield's schematic. It shows a logic circuit composed of XNOR gates. This logic circuit makes the controlling pins (DIRA and DIRA#) have an opposite state when the BRAKEA pin is LOW. And when the BRAKEA pin is HIGH, the control pins have the same state. When the controlling pins have the same state, the motor stops.
Making the BRAKEA pin High disables the motor.
1.Parts needed and the Arduino motor shield
2.The Front and Back LEDs
3.Bluetooth modules and Arduino code
4.Putting it all together and the Android Application
5.A More Complex Circuit