Introduction: Upcycled RC Car
RC cars have always been a source of excitement for me. They're fast, they're fun, and you don't have to worry if you crash them. Yet, as an older, more mature, RC enthusiast, I can't be seen playing around with a small, kids RC cars. I have to have big, grown man-sized ones. This is where a problem arises: adult RC cars are expensive. While browsing online, the cheapest I could find cost $320, the average being around $800. My computer is cheaper than these toys!
Knowing that I can't afford these toys, the maker in me said I could make car for a 10th of the price. Thus, I began my journey to turn trash into gold
The parts needed for the RC car are as follows:
- Used RC Car
- L293D Motor Driver (DIP Form)
- Arduino Nano
- NRF24L01+ Radio Module
- RC Drone Battery (or any other high current battery)
- LM2596 Buck Converters (2)
- Small, miscellaneous components (header pins, screw terminals, capacitors, etc)
The parts needed for the RC controller are as follows:
- Used controller (must have 2 analog joysticks)
- Arduino Nano
- NRF24L01+ Radio Module
- Electrical wires
Step 1: Recycled Treasure
This project originally started about a year ago when my friends and I planned to make a computer-driven car for a hackathon project (coding competition). My plan was to go to a thrift shop, buy the largest RC car I could find, gut the insides, and replace it with an ESP32.
On a time crunch, I rushed over to Savers, bought an RC car, and prepared myself for the hackathon. Sadly, many of the parts I needed did not come in on time so I had to scrap the project entirely.
Ever since then, the RC car has been collecting dust under my bed, until now...
In this project, I will repurpose a used toy car and an IR controller to create the Upcycled RC Car. I will gut the insides, implant Arduino Nano's, and use the NRF24L01+ radio module to communicate between the two.
Step 2: Theory
"Understanding how something works is more important than knowing how to make it work."
- Kevin Yang 5/17/2020 (I just made this up)
With that said, let's start talking about the theory and electronics behind the Upcycled RC Car.
On the car side, we will be using an NRF24L01+, an Arduino Nano, an L293D motor driver, the motors in the RC car, and two buck converters. One buck converter will be supplying the driving voltage for the motor whilst the other one will be supplying 5V for the Arduino Nano.
On the controller side, we will be using an NRF24L01+, an Arduino Nano, and the analog joysticks in the repurposed controller.
Step 3: The NRF24L01+
Before we begin, I should probably explain the elephant in the room: the NRF24L01+. If you aren't familiar with the name already, the NRF24 is a chip produced by Nordic Semiconductors. It is quite popular in the maker community for radio communication due to its low price, small size, and well-written documentation.
So how does the NRF module actually work? Well for starters, the NRF24L01+ operates on the 2.4 GHz frequency. This is the same frequency that Bluetooth and Wifi operate on (with slight variations!). The chip communicates between an Arduino using SPI, a four-pin communication protocol. For power, the NRF24 uses 3.3V but the pins are also 5V tolerant. This allows us to use an Arduino Nano, which uses 5V logic, with the NRF24, which uses 3.3V logic. A few other features are as follows.
- Runs on the 2.4 GHz Bandwidth
- Supply Voltage Range: 1.6 - 3.6V
- 5V Tolerant
- Uses SPI Communication (MISO, MOSI, SCK)
- Takes up 5 pins (MISO, MOSI, SCK, CE, CS)
- Can Trigger Interrupts - IRQ (Very important in this project!)
- Sleep Mode
- Consumes 900nA - 12mA
- Transmission Range: ~100 meters (will vary according to geographic location)
- Cost: $1.20 per module (Amazon)
If you want to learn more about the NRF24L01+, check out the Extra Readings section at the end.
Step 4: The L293D - Double H-Bridge Motor Driver
Although the Arduino Nano can supply enough current to power an LED, there is no way the Nano can power a motor by itself. Therefore, we must use a special driver to control the motor. Besides being able to supply the current, the driver chip will also protect the Arduino from any voltage spikes that arise from turning the motor on and off.
Insert the L293D, a quadruple half H-bridge motor driver, or in layman terms, a chip that can drive two motors forwards and backward.
The L293D relies on H-Bridges to control both the speed of a motor as well as the direction. Another feature is power supply isolation, which allows the Arduino to run off of a power source separate from the motors.
Step 5: Gutting the Car
Enough theory and lets actually start building!
Since the RC car doesn't come with a controller (remember its from a thrift shop), the inside electronics are basically useless. Thus, I opened up the RC car and threw the controller board into my scrap bin.
Now it's important to take a few notes before we start. One thing to notice is the supply voltage for the RC car. The car that I bought is very old, way before Lithium-based batteries were mainstream. This means that this RC car was powered off of a Ni-Mh battery with a nominal voltage of 9.6 volts. This is important as this will be the voltage that we will drive the motors at.
Step 6: How Does the Car Work?
I can say with 99% certainty that my car is not the same as yours, meaning this section is essentially useless. However, it is important to point out a few features that my car has because I will be basing my design off of that.
Unlike modern RC cars, the car that I am modding does not use a servo to turn. Instead, my car uses a basic brushed motor and springs. This has many drawbacks especially because I have no ability to make fine turns. However, one immediate benefit is that I do not need any complicated control interface to turn. All I need to do is energize the motor with a certain polarity (depending on which way I want to turn).
Amazingly, my RC car also contains a differential axle and two different gear modes. This is quite amusing as differentials are usually found in real-life cars, not in small RC ones. I would think that before this car was on the shelves of a thrift store, it was a high-end RC model.
Step 7: The Issue of Power
With the features out of the way, we now have to talk about the most important part of this build: How are we going to power the RC car? And to be more specific: How much current is needed to drive the motors?
To answer this, I connected a drone battery to a buck converter, where I dropped the 11V of the battery to the 9.6V of the motors. From there, I set the multimeter to 10A current mode and completed the circuit. My meter read that the motors needed 300 mA of current to turn in free air.
While this may not sound like a lot, the measurement that we truly care about is the stall current of the motors. To measure this, I put my hands over the wheels to prevent them from turning. When I looked at my meter, it displayed a solid 1A.
Knowing that the drive motors will be drawing roughly an amp, I then proceeded to test the steering motors which drew 500mA when stalled. With this knowledge, I came to the conclusion that I can power the whole system off of an RC drone battery and two LM2596 buck converters*.
*Why two-buck controllers? Well, each LM2596 has a maximum current of 3A. If I power everything off of one buck converter, I was going to draw a lot of current, and therefore, I would have pretty large voltage spikes. By design, the Arduino Nano force rests every time there is a large voltage spike. Therefore, I used two convertors to lighten the load and keep the Nano isolated from the motors.
One last important component we need is a Li-Po cell voltage tester. The purpose of doing this is to protect the battery from over-discharge to prevent ruining the life of the battery (always keep the cell voltage of a lithium-based battery above 3.5V!)
Step 8: RC Car Circuit
With the power issue out the way, we can now construct the circuit. Above is the schematic I made for the RC car.
Keep in mind that I did not include the battery voltmeter connection. To use the voltmeter, all you need to do is connect the balance connector to the voltmeter's respective pins. If you have never done this before, click on the video linked in the Extra Readings section to learn more.
Notes on the Circuit
The enable pins (1, 9) on the L293D require a PWM signal to have variable speed. That means that only a few pins on the Arduino Nano can be connected to them. For the other pins on the L293D, anything goes.
Since the NRF24L01+ communicates over SPI, we must connect its SPI pins to the SPI pins on the Arduino Nano (so connect MOSI -> MOSI, MISO -> MISO, and SCK -> SCK). It is also important to notice that I connected the IRQ pin of the NRF24 to pin 2 on the Arduino Nano. This is because the IRQ pin goes LOW every time the NR24 receives a message. Knowing this, I can trigger an interrupt to tell the Nano to read the radio. This allows the Nano to do other things while it waits for new data.
Step 9: PCB
As I want to make this a modular design, I created a PCB using perf board and lots of header pins.
Step 10: Final Connections
With the PCB done and the RC car gutted, I used alligator wires to test if everything works.
After testing that all the connections are correct, I substituted the alligator wires with real cables and fastened all the components to the chassis.
At this point, you may have realized that this article is not a step by step guide. This is because it is simply impossible to write every single step out so instead, the next few Instructables steps will be me sharing a few tips I learned while making the car.
Step 11: Tip 1: Radio Module Placement
To increase the range of the RC car, I placed the NRF radio module as far to the side as possible. This is because radio waves reflect off of metals such as PCB's and wires, therefore, reducing the range. To solve this, I put the module on the very side of the PCB and cut a slit in the car's housing to allow it to stick out.
Step 12: Tip 2: Keep It Modular!
Another thing I did that saved me a few times is connecting everything through header pins and terminal blocks. This allows for easy swapping of parts if one of the components gets fried (for whatever reason...).
Step 13: Tip 3: Use Heat Sinks!
The motors in my RC car are pushing the L293D to its very limits. While the motor driver can handle up to 600 mA continuously, it also means that it gets very hot and fast! This is why it is a good idea to add some thermal paste and heatsinks to prevent the L293D from cooking itself. However, even with the heat sinks the chip can still get too hot to touch. This is why it is a good idea to let the car cool down after 2-3 minutes of play.
Step 14: RC Controller Time!
With the RC car done, we can start making the controller.
Like the RC car, I also bought the controller a while back thinking I could do something with it. Ironically, the controller is actually an IR one so it uses IR LEDs to communicate between devices.
The basic idea with this build is to keep the original board inside the controller and build the Arduino and NRF24L01+ around it.
Step 15: Analog Joystick Basics
Connecting to an analog joystick may be daunting especially because there is no breakout board for the pins. No worry! All analog joysticks operate on the same guiding principle and usually have the same pinout.
Essentially, analog joysticks are just two potentiometers that change resistance when moved in different directions. For example, when you move the joystick to the right, the x-axis potentiometer changes value. Now when you move the joystick forward, the y-axis potentiometer changes value.
With this in mind, if we look at the underside of the analog joystick, we see 6 pins, 3 for the x-axis potentiometer, and 3 for the y-axis potentiometer. All you need to do is to connect 5V and ground to the outside pins and connect the middle pin to an analog input on the Arduino.
Keep in mind that the values for the potentiometer will be mapped to 1024 and not 512! This means we have to use the builtin map() function in Arduino to control any digital outputs (like the PWM signal we are using to control the L293D). This is already done in the code but if you plan on writing your own program you must keep that in mind.
Step 16: Controller Connections
The connections between the NRF24 and the Nano are still the same for the controller but minus the IRQ connection.
The circuit for the controller is shown above.
Modding a controller is definitely a form of art. I have already made this point countless times, but it's simply not possible to write a step by step how-to on doing this. Thus, like what I did earlier, I will give a few tips on what I learned while making my controller.
Step 17: Tip 1: Use the Parts at Your Disposal!
Space is really tight in the controller, therefore, if you want to include any other inputs for the car, use the switches and knobs that are already there. For my controller, I also connected a potentiometer and a 3-way switch to the Nano.
Another thing to keep in mind that this is your controller. If the pinouts do not suit your fancy you can always rearrange them!
Step 18: Tip 2: Remove Unnecessary Traces
Since we are using the original board, you should scrape off all of the traces that are going to the analog joysticks and to any other sensors you are using. By doing so, you prevent the chance of any unexpected sensor behavior from happening.
To make these cuts, I simply used a box cutter and scored the PCB a few times to really separate the traces.
Step 19: Tip 3: Keep the Wires Short As Can Be
This tip is specifically talking about the SPI lines between the Arduino and the NRF24 module, but this also holds true with the other connections as well. The NRF24L01+ is extremely sensitive to interference so if any noise is picked up by the wires, it will corrupt the data. This is one of the main drawbacks of SPI communication. Likewise, by keeping the wires as short as can be, you also make the entire controller cleaner and more organized.
Step 20: Tip 4: Placement! Placement! Placement!
Besides just keeping the wires as short as possible, this also means keeping the distance between parts as short as possible.
When scouting out for places to mount the NRF24 and the Arduino, remember to keep them as close as possible to each other and the joysticks.
Another thing to keep in mind is where to put the NRF24 module. As said earlier, radio waves are unable to go through metal, therefore, you should mount the module near the side of the controller. To do this, I cut a small slit with a Dremel to let the NRF24 stick out of the side.
Step 21: Code
Probably the most important part of this build is the actual code. I have included comments and everything so I will not explain each program line by line.
With that said, a few important things I want to point out is that you will need to download the NRF24 library to run the programs. If you do not already have the libraries installed, I suggest you check out the tutorials linked in the Extra Readings section to learn how. As well, when sending signals to the L293D, never turn the direction pins both on. This will short the motor driver and cause it to burn up.
Step 22: Final Product
Finally, after one year of collecting dust and 3 weeks of manual labor, I have finally finished making the Upcycled RC Car. While I must admit, it is nowhere as powerful as the cars seen in the introduction it came out much better than I thought. The car can drive for 40-ish minutes before it runs out of power and can go up to 150m away from the controller.
A few things that I would definitely do to improve the car is to swap out the L293D for the L298, a larger, more powerful motor driver. Another thing I would do is swap out the default NRF radio module for the amplified antenna version. These modifications would increase the torque and the range of the car respectively.
Step 23: Extra Readings:
Participated in the
Finish It Already Speed Challenge