This guide presents the hardware setup of a compact donkey car for indoor testing. It is designed for getting to know the donkey car platform and is meant for beginners. It was designed with following intentions:
- no surprises, it just works out of the box with donkey car
- simple wiring and mechanics
- precise controls of actuators
- cheap, but build with parts of decent quality
- small form factor and low speed for indoor testing
- safety: no fire hazard with lipo batteries
The 4WD RC Smart Chassis is a good choice, since it offers a very precise steering and a planetary drive motor setup. By this, the vehicle can be controlled up to a precision of 0,5 cm. The planetary drive with a transmission of 1:20 allows conducting very smooth acceleration evens. However, it limits the speed to ~15km/h, which is totally fine for indoor usage
Available from following dealers:
If you are looking for a faster alternative with similar dimensions and steering precision, checkout the alternative from from Seeedstudion
The steering servo is part of the vehicle chassis kit presented above.
The electronic speed controller is used to control the electric motor from the Servo Hat attached to the Raspberry PI.
The Hobbywing QuicRun 1625 25A Brushed ESC Speed Controller For 1:10 /1:18 1:16 Car is an excellent choice, since it provides:
- very accurate power control
- 5 Volt output (BEC) to power the Servo Hat and the attached servo
- full compatibility with the Raspberry PI Servo hat and its PWM resolution
- automatic neutral position adjustment, which is very handy when the car is calibrated initially in Donkey Car
- support for NiMhd batteries
- a power switch to immobilize the vehicle while working the Raspberry PI
For controlling the actuators (servo and ESC) accurately I recommend a PWM-chip with a resolution of 12 bit. The 12 bit resolution allows a wide set of servo angles and a very precise control of the ESCs. For generating PWM signals a PCA9685 chip is used. There are many vendors of PCA9685 boards that can be attached to the RaspberryPI. Howevery, I recommend using a Servo Hat from adafruit that features a very good design and is very stable on powering servos. The Servo Hat is available at Reichelt.
When soldering the pins the PCB, only solder the connection main sockets on the top, the blue power connector and the first PWM channel block from channel 0 to 3. The other blocks 4 to 15 are not needed. Do not solder them Keep the spare pins, since we need them to build the wire harness lateron.
A classic Raspberry PI 3B+ is used as compute platform. In Germany, you can buy it at Reichelt.
The Raspberry PI is powered from the main battery of the vehicle. To bring the 8 Volt down to the USB 5V voltage a step down converter is needed. For this, a DEBO DC 2XUSB converter is used. It can be bought at Reichelt.
As main battery, a 7.2Volt NiMh battery is used with a capacity of 4300 mAh. This allows to run the car about 30 minutes in autonomous mode. You can can get the battery at Reichelt
You may encounter situations, where you need to unplug the main battery, e.g. for charging, while you want your RaspberryPi continue to run. In this situation, you need to bridge the USB-power for the RaspberryPi, while the main battery is offline. The trick to achieve this is to use a USB-Y-Cable that powers the RaspberryPi from a USB power bank, while the main battery is offline and cannot provide power through the 5V-voltage converter.
To finish the vehicle, you need some cables and plugs:
- some jumper cables to interconnect the ESC with the RaspberryPi
- Tamiya battery coupling to access the main battery
- two 3.4mm bullet connectors to connect the ESC to the motor
- heat shrink tube set for isolation
- High quality silicon covered cables for building the power distribution.
For the wiring, we extend the wires of the ESC to power the servo from the ESC BEC (Battery Eliminator Circuit) directly. Here is the complete wiring diagram: