Panel Cookies
RC car PCB with NRF24 and BLUETOOTH

Help me by sharing this post


PREVIOUS TUTORIAL       NEXT PART

In a past tutorial that you could find on this link, we have seen how to make an Arduino based radio controller with multiple channels. Then, we have seen on this other tutorial, how to use that controller and move servos for a 3D printed turret. Is time to use the radio controller for something else, in this case make an RC car, or better said, an RC tank. This will have DC motors control, servos, sounds, radio and Bluetooth control and more...




PART 1 - PCB Schematic

Below you have the schematic for this project. As you can see it is divided in a few blocks. First we have the Arduino block. I've placed two lines of extra female pins in case we want to connect something more to the Arduino. Then, we have the power block. To control servos, ESCs and more, we need good power. The Arduino voltage regulators for 5 and 3.3V are not that powerful. That's why I've used two small buck converters set to 3.3V and 5V. The main input is of a 2S battery of 7.4V. It can't be of 3S because the maximum voltage of the H-bridge is 9V. Also, have in mind that the DFplayer and Bluetooth module are using the UART port. That port is used to upload codes to the Arduino as well. So fot that I've placed jumpers. Remove the jumper, upload the code and place back the jumper.



Arduino RC car PCB schematic

We can also see a voltage divider for the battery voltage measure. This can be used to monitor the battery value and maybe send it back to the radio controller. R3 and R4 have no value but a good one could be R3 equal to 20K and R4 equal to 10K, in this way the analog input would be of 7.4V/3 = 2.5V and the Arduino could read that. We have a DF player that could play Mp3 sounds, we have a spekaer output, an H-ridge that could control 2 DC motors, 3 servo or ESC outputs and a MOSFET output to control anythig we want.





PART 2 - The PCB

This is the design of my PCB. If you want to make it, you can download the GERBER file from below, send it to a manufacturing company and get the PCB. As you can see, it has labels for all the connections. For the 3.3 and 5V bucck converters, for the Bluetooth, radio and all the other modulkes. I've used female pins for all the connections so I would be able to remove the modules any time I want. You have outputs for all the modules: for the motors, speaker, servos, MOSFET, etc. You can use this board with radio using the NRF24 module or with Bluetooth with the HC-06 module and an Android App.



Arduino RC car PCB gerber





PART 3 - Connections

3.1 NRF24 connection

Ok, now we haev our PCB. We can control it with radio connection or with Bluetooth connection. You will ahev the code for each part in this tutorial. First, let's see the Radio connection. Add the modules as below. The NRF24 module, the 3.3V and 5V buck converters (make sure the output is 3.3 and 5V), the DF player with and SD card with the sounds saved in a folder called mp3 and each file wit names such as 0000, 0001, 0002, etc. Also add the H-bridge, connect two DC motors and the speaker at the SPK output. Add the Arduino NANO and we can now uplaod the code for the NRF24 radio connection.

homemade RC car Arduino PCB

3.2 Bluetooth connection

Now, in the same way we have the Bluetooth version. For that remove the NRF24 radio module. Then add the HC-06 Bluetooth module and after you uplaod the code, make sure you add the Tx and Rx jumpers for the UART connection. The rest is the same, same DF player with mp3 files, same H-bridge, motors, etc. Now we can uplaod code to the Arduino. For that, for each configuration, first make sure the jumpers are not connected. So, let's see the code.

Bluetooth Arduino toy car h bridge PCB



PART 4 - Code

4.1 NRF24 radio code

Ok, first we ahve the radio version of this PCB. Go below and downlaod the code. This code is made for the past NRF24 Arduino based radio controller. So, make sure you also have that project as well. Also, make sure you downlaod and install the needed libraries sucha s the NRF24 library. In the code, first make sure you include the libraries for this example. You will need the DF player library to play sounds.



#include <SPI.h>
#include <nRF24L01.h>   //Download it here: https://www.electronoobs.com/eng_arduino_NRF24_lib.php
#include <RF24.h>
#include <Servo.h>      //To create PWM signals we need this lybrary
#include <SoftwareSerial.h>
#include <DFPlayer_Mini_Mp3.h>    //Downlaod it here: https://www.electronoobs.com/eng_arduino_tut22_code5.php





4.2 Bluetooth code

Now, for the other schematic, add the HC-06 Bluetooth module and downlaod the code below. In this case, the code is more tahn simple. We use the serial read to get the data from the Bluetooth module. The data is sent with an Android app from a smartphone. You will find that App ready to dwonlaod below as well. Each button will send a different character. Check the caracter sent lsit as well in order to know what data will each button send. Compile, uplaod the code and install the App. Copy your sound files to the SD card in a folder called mp3 and nema the files 0000, 0001, 0002, exct and then test if they work. In my case I can move the tank in all tirections and each time the sound of the tank tracks will play and if I press fire, the fire sound will play.



if(Serial.available()>0)
{
  Received = Serial.read();
  //char Rec = char(Received);  
  //Serial.println(Received); //This is to visualise the received character      
}



Help me by sharing this post












yt_link
insta_link
fb_link
twitter_link

RC car PCB
page 1/2



ADVERTISERS



PCBWAY PCB service





Curso Arduino Online nivel Intermedio