RC Car Daughter Board¶
Description¶
Have you ever wanted a remote control phone that looks vaguely like a tractor? Or maybe your screen addiction has gotten so bad a single colorful glowing rectangle just isn't enough of a dopamine hit any more? Well, you're in luck because this RC car daughterboard ticks those boxes and so many more.
To drive the car, you'll need a second WiPhone since one acts as a controller (or make your own controller using anything that can send UDP packets). The controller phone runs an app that sends commands to the car phone. On the RC car side the daughterboard uses a DRV8833 dual H bridge and some micro gearmotors with matching wheels to drive around.
Features¶
- Dual H-bridge motor driver with current regulation.
- Low power consumption: Designed for battery-powered applications.
- Powered from WiPhone Battery.
- W420 Steel Ball Castor front Wheel.
- N20 3V 300 RPM ALL Metal Gear Micro DC Motor.
Technical Details¶
DB pin# | Pin Name | Arduino Pin | Description |
---|---|---|---|
12 | VBAT | Supply voltage for Motors. | |
2, 11,13 | GND | This pin is connected to System GND. | |
3 | Fault Status | 38 | Logic low when in fault condition (overtemperature, overcurrent). |
4 | Sleep mode Select | 32 | Logic high to enable device, logic low to enter low-power sleep mode and reset all internal logic. Internal pulldown. |
7 | AIN1 | 12 | Bridge A input 1. Logic input controls state of AOUT1. Internal pulldown. |
8 | AIN2 | 13 | Bridge A input 2. Logic input controls state of AOUT2. Internal pulldown. |
9 | BIN1 | 27 | Bridge B input 1. Logic input controls state of BOUT1. Internal pulldown. |
10 | BIN2 | 14 | Bridge B input 2. Logic input controls state of BOUT2. Internal pulldown. |
Hardware Overview¶
Texas Instruments DRV8833¶
The DRV8833 is a powerful and efficient motor driver IC designed for controlling two small to medium-sized DC brushed motors. It offers precise current control, thermal protection, and operates over a wide voltage range, making it ideal for both hobbyist and professional applications. Perfect for projects requiring bidirectional motor control, such as RC cars, drones, and automated systems, the DRV8833 ensures reliable performance with its durable design.
N20 Micro Gear Motor¶
The N20 is a compact and powerful DC motor with a metal gearbox, perfect for RC cars, robotics, and DIY projects. It delivers high torque, features durable gears, and operates over a wide voltage range."
The N20 Micro Gear Motor, combined with a rubber tire and D-shaft bracket, is an excellent choice for powering small-scale mobile robots or vehicles.
RC Car Daughter Board Operation¶
- Load WiPhone with the “Motor Driver” firmware.
- Install the RC Car daughter board on the back of the WiPhone.
- On WiPhone, navigate to Tools -> Development -> Motor Driver.
- On Motor Driver App, you will see the IP address and port to send the UDP message to drive the RC Car.
- To send the UDP message to the RC car, we can either use the UDP sender app on another WiPhone or use computer software like Packet Sender (downloadable from the resources section).
Note
Both the WiPhone with the RC Car daughter board and the device with the UDP Sender App need to be connected to the same WiFi network to send commands to the RC Car daughter board.
- The code that controls the movement and direction of the RC car is provided below. We will send UDP messages based on this code to control the RC car.
moving = buff[0]=='f' || buff[0]=='r' || buff[1]=='f' || buff[1]=='r';
if (moving) {
started = millis();
if (buff[0]=='f' && buff[1]=='f') {
newDir = FORWARD;
} else if (buff[0]=='r' && buff[1]=='r') {
newDir = REVERSE;
} else if (buff[0]=='f' || buff[1]=='r') {
newDir = RIGHT;
} else if (buff[0]=='r' || buff[1]=='f') {
newDir = LEFT;
}
} else {
newDir = STOP;
}
- So, we can send the following commands from the UDP sender to control the RC car. The RC Car WiPhone will display arrows indicating the direction corresponding to the commands sent from the UDP sender:
- ff moves the car forward.
- rr moves the car in reverse.
- fr turns the car right.
- rf turns the car left.