Make it faster (no) and improve its range (yes) without breaking the bank
To make the experience fit your profile, pick a username and tell us what interests you.
The range is greatly increased. Now it's at least 80m. That's more than enough for such a small car. At such a distance it's hard to figure out what way the car is pointing.
It doesn't seem to drive faster than before. I'm a bit disappointed in this.
The original controller was of a very low quality. The steering of left and right didn't work well. It's easier to control with the app on the smartphone, although that one lacks tactile feedback.
The ESP32 development board has an AMS1117-3.3 linear regulator. The datasheet announces this regulator as LDO, while the dropout voltage is typically 1.1V! A quiescent current of typically 5mA is neither something to write home about. But that's what is. Don't use this ESP32 board for a low power application.
To get a stable 3V3 on the ESP32, the battery voltage must be boosted to 5V (or 5.5V). The same boost converter type that also powers the motor shields will be used here. It's mounted between the ESP32 and the breadboard.
An extra 470µF/10V is added on the 5V input of the ESP32 board. Just in case.
The ESP32 uses two GPIOs to control each DFRobot motor driver. There's a 3pin JST-EH to power the ESP32 with the Li-Ion cell.
The motor controllers are powered by the boost converters (bottom JST-EH on each motor driver). The other JST-EH connector is connected to the DC-motor.
All connections are made using JST-EH connectors.
There's a 3-pin connector for powering the ESP32.
There are two pairs of 2-pin connectors for powering the motor controllers. The remaining two pairs with red/black wire are connected to the two motors themselves.
In the background, the shell is visible with the antenna mounted in it.
The controller board requires more space than the original electronics. Using a Dremel tool, I made a cutout in the shell. The cutout is too big, but at least the circuitry fits easily.
The 18650 battery clip is also mounted onto the shell, as well as an RP-SMA antenna pigtail cable for the LSR antenna.
The power from the Li-Ion is connected to the leftmost JST-EH. There's a 2pin JST-EH for the power-interruption switch between the battery and the battery protection board. It might be wiser to connect the battery monitor circuit directly to the battery and then put the power-interruption switch. I'll have to find out later.
The three bottom 3-pin JST-EH connectors connect to the two boost converters and to the ESP32.
A test using 2x 1S/3A-Li-Ion protection from AliExpress (€0.30+€1.15 shipping) showed that it was inadequate. The current limit is too strict.
A better option would be to order this battery monitor system (BMS) instead.
The traction motor will run on 12V, the steering motor on 7V. Two boost converter modules will be used. The quality of those modules is not great. One gave hiccups when the traction motor went full power. Replacing the module was the quickest fix. I bought them as MT3608 boost converter modules. The label on the package is "XT1208".
The two boost converter modules are fixed with 3M VHB-tape. It sticks well. It's thick so it can be used on uneven surfaces. It's also easy to remove. It doesn't leave traces of sticky glue (unlike duct tape which is a hell in this regard).
Bluetooth doesn't require a custom remote control. You can use a smartphone.
The aforementioned project uses a HC-05 Serial Bluetooth module. This module won't be used here, because the ESP32 already has Bluetooth on board.
It doesn't take more than loading the code from "ESP32 Bluetooth Classic with Arduino IDE – Getting Started" into the ESP32 and execute it. The Bluetooth RC Car Android app willingly connects to the ESP32. Serial data is coming in. We got this working! This went easier than I thought.
The problem with this solution is that there's no tactile feedback. You have to look at your fingers, so that you know where to put them and at the same time look at the car. Practice makes perfect, I guess.
To keep things simple on the software side, we'll use the ESP32. It already has bluetooth on board. To get a better range (hopefully), a module with external antenna will be used. The breadboard friendly module, featuring the ESP32-WROOM-32U is one from AliExpress (€4/pce).
Using the Bluetooth library seems to eat up more than half of the flash space.
The steering of the front wheels is controlled by a small DC-motor: 5V/300mA is the typical current draw.
The rear wheels are controlled by a 9V DC-motor. Voltage up to 15V has been tested and seems to work well. Free running is 200mA, 400mA under load. So 1A of current draw should be more than enough.
The controller broke down and no longer wanted to generate signals on the FWD-pin. The H-bridge was still fine. Q1 and Q2 are TO-92 packages, while Q12 and the other transistors have a larger package.
The operation of this H-bridge is quite simple. Once Q1 turns on, it turns also Q12 on and the PNP-transistor on the opposite side of the bridge. We have to take care not to make the "REV" and "FWD" high at the same time. That would cause a power supply short circuit.
In this circuit, there's no way to brake the motor by having Q12 and Q2 conduct, while the upper PNP-transistors in the bridge are off.
We could try to reinvent the wheel and design an improved version of this discrete H-bridge. Instead we'll just use a tried and tested commercial one.
We could either use the Adafruit 3190 (single bridge) or the Sparkfun ROB-14450 (dual bridge). The latter being almost the same as the DFRobot DRI0044 (€3.72) or the Pololu TB6612FNG Dual Motor Driver Carrier. Let's use that DFRobot one, as it's the cheapest.
So I ended up buying the cheapest option, which I may regret soon. The DFRobot board has only 12pins, while the Sparkfun board has 16 pins.
The DFRobot board saves pins by using only 1 pin to control the direction of the motor. The TB6612FNG motor driver uses two inputs per motor. This allows to brake the motor by bringing the two inputs too the same state. This is not possible on the DFRobot board. You can only break with the DFRobot module by going to reverse rotation.
We have three parameters to play with:
Set to 12V, that the maximum that the TB6612FNG can safely handle
The frequency has been adjusted from a few kHz to 100kHz. At 10kHz to 25kHz, the current consumption by the motor driver seemed to be minimal. So let's take 20kHz as PWM frequency.
Will be used for speed control, while the PWM frequency will remain fixed.
Don't reinvent the wheel. Let's see if we can get "In-depth ESP32 PWM Tutorial | How to use PWM in ESP32?" to work.
Pin 14 is unsuitable as PWM-pin for the traction motor. At powerup this pin becomes high synchronously with 3V3 and remains high for 500ms. This causes the traction motor to spin.
The car is supposed to work with 6 AA-cells in series. Only rechargeable cells are an option here.
The charger has an XT60 connector, so charging is easy. There's no longer a risk of incorrectly plugging in the battery after charging.
Become a member to follow this project and never miss any updates