How to make an Arduino Bluetooth RC Car using Cardboard

 

Arduino Bluetooth RC car

Arduino Bluetooth RC car

Cardboard crafts are one of the most popular and easy to make DIY stuff. Mixing this with the unmatchable enjoyment of RC Cars and the ease of using Arduino, I am going to show you how to make a Cardboard Arduino Bluetooth RC car that you can control via Bluetooth from your smartphone.

How Arduino Bluetooth RC car works

The car is just a basic Cardboard-based Arduino robot which uses the popular yellow 4-wheels with their DC motors and an Arduino Mega with 1Sheeld. You can control the robot in 3 different ways

Also, the Slider Shield works like a speed slider where you can change the car speed from the least to the maximum.

Moreover, I  have added an RGB LED strip to the bottom of the robot to make it funny and luminous .. yeah!

 

Before you start …

 

If you are just getting your 1Sheeld out of the box then go ahead with this 1Sheeld getting started tutorial or simply check the 1Sheeld User’s Manual.

 

So, let’s make it and see what hardware components you will need…

Gather Components

  • Cardboard or Foam
  • 1Sheeld+
  • Arduino Mega
  • 4-Motors driver
  • 4 robot wheels
  • 4 DC motors
  • Regulator 5v
  • 2 3.7v batteries
  • Batteries box
  • Switch
  • LED with 330 Ohm resistor
  • Breadboard
  • RGB LED strip
  • Jumper Wires

 

Build the Arduino Bluetooth RC car

 

Firstly, you will draw the body faces of the Arduino Bluetooth RC car on the Cardboard/foam sheet you have. To make it easy for you, I have designed all the faces with the exact dimensions …

Here’s the car Base, Right, Left, Front, Back faces:

And the car top cover:

 

Caution: these are the dimensions in cm so you need to draw them, not to print and stick it to the sheet! They are not in real size. it’s just a guide!

 

Hardware Connections

You have here 4 circuits for your Arduino Bluetooth RC car; Power, motors, RGB LED and the 1Sheeld. So, I will wake you through the connections of each one with an explanation.

First: 1Sheeld connection

Connect the 1Sheeld to the Arduino Mega as follows:

  • Tx pin of 1Sheeld (pin 0) with       >> Rx3 pin of Arduino Mega
  • Rx pin of 1Sheeld (pin 1) with        >> Tx3 pin of Arduino Mega
  • 5v pin of 1Sheeld with                      >> 5V output pin of the 5v regulator
  • GND pin of 1Sheeld with                 >> GND pin of the circuit

In the video, I have plugged the 1Sheeld over the Arduino directly but later so that 1Sheeld can communicate with the Arduino Mega by using the “Serial 0” with its pins RX0 & TX0. This was fine until I added the code of the GLCD which I had to restart the Arduino Mega before playing with the car and here comes the problem; Arduino Mega didn’t restart!

I have searched this and found out the Mega doesn’t restart when there is something connected to its RX0 & TX0 pins which somehow to make the Mega busy listening to the “Serial 0″ line all the time and doesn’t respond to restart. Thanks to 1Sheeld flexibility of serial communication, I managed to connect the 1Sheeld to another serial line which is “Serial 3″ with its pins RX3 & TX3.

 

Note: I have used the GLCD Shield to create a checkbox that when you check it, the car goes from normal Gamepad control mode to the Accelerometer mode. This is a MUST as without it the car will go like crazy, moving every way whenever you move the phone or tilt it! So, I had to draw that checkbox on the GLCD to be able to turn off the Accelerometer feature while I am using it with the Gamepad or Voice Commands modes.

 

Second: Motors connection

I have used a simple but funny motor driver board which uses fewer wires than the traditional H-bridge board we know, just uses 2 pins for the PWM & DIRECTION instead of the H-bridge 3 pins: PWM, IN1 pin, IN2 pin.

Here it is:

This driver can deliver up to 4A for each motor of its 4 channel and uses (1 PWM pin + 1 DIR pin). So, connect it to the 4 motors like that:

 

  • Right Front motor 2 wires with        >>         CH1+ & CH1- pins of the Driver
  • Right Back motor 2 wires with         >>         CH2+ & CH2- pins of the Driver
  • Left Front motor 2 wires with           >>         CH3+ & CH3- pins of the Driver
  • Left Back motor 2 wires with            >>         CH4+ & CH4- pins of the Driver

Then connect the logic pins of the driver to the Arduino Mega like that:

  • First PWM pin with        >>         pin 2 of the Arduino Mega
  • First DIR pin with           >>         pin 17 of the Arduino Mega
  • 2nd PWM pin with          >>         pin 3 of the Arduino Mega
  • 2nd DIR pin with            >>         pin 18 of the Arduino Mega
  • 3rd PWM pin with         >>         pin 4 of the Arduino Mega
  • 3rd DIR pin with            >>         pin 19 of the Arduino Mega
  • 4th PWM pin with         >>         pin 5 of the Arduino Mega
  • 4th DIR pin with            >>         pin 20 of the Arduino Mega

 

Third: Power connection

You need to supply 2 lines of power:

  • 5v for the Arduino Mega and the Driver logic which you will get from the 5v regulator.
  • 7v or more to supply the motors which you will get from the 2 series 3.7v batteries.

So, just make these connections carefully:

  • Driver V motors with         >>         Batteries +ve wire
  • Regulator Vin with             >>         Batteries +ve wire
  • Regulator GND with          >>         Batteries -ve wire
  • Regulator Vout with          >>         5v pin of Arduino Mega
  • Regulator Vout with          >>         VCC pin of the Driver
  • Regulator Vout with          >>         LED indicator +ve pin with a 330 Ohm resistor

 

 

  • You can add a switch in the line of the batteries +ve terminal with an indicator LED to add on/off functionality to the Arduino Bluetooth RC car.

4th: RGB LED strip connection

I have used cathode based RGB LED strip where there are 3 color pins for red, green and blue to be connected to the Arduino Mega and the 4th pin MUST go with the +ve power of the batteries. This RGB LED works the opposite of the normal Anode one as you need to give RED pin value of analogWrite(0) instead of analogWrite(255) to turn it on. If you have an Anode one then keep the red, green and blue connections and connect the -ve pin to the -ve pin of the batteries and inverse the logic in your code to be analogWrite(255) instead of analogWrite(0), indeed.

  • RED pin with               >>         44 pin of Arduino Mega
  • GREEN pin with         >>         45 pin of Arduino Mega
  • BLUE pin with             >>         46 pin of Arduino Mega
  • +ve pin with                 >>         Batteries +ve wire

 

And to make the GND of all circuit is the same, make sure that you connect:

  • Regulator GND pin with          >>         LED indicator -ve wire
  • Regulator GND pin with          >>         Batteries -ve wire
  • Regulator GND pin with          >>         Arduino Mega GND pin
  • Regulator GND pin with          >>        1Sheeld GND pin
  • Regulator GND pin with          >>         Driver GND pin

No big deal here, just make the GND one for all the components and you should end up with the hardware connected like that:

 

Code

The code is simple and contains 4 functionalities:

  • Controlling the car manually with the Gamepad by using functions like this:

  • Controlling the car with the Accelerometer by using functions like this:

 

  • Controlling the car manually with the voice commands by using functions like this:

 

  • Finally, playing with the RGB lights:

 

Of course, all these functions I have called are to simplify the code readability so that you can understand it easily.

 

And here’s the full code you are going to upload to the Arduino Mega for your Arduino Bluetooth RC car:

 

Code uploading

  • Connect the Arduino Mega via your PC.
  • Switch the 1Sheeld power to operate on 5v (Not the 3.3v):
  • 1Sheeld has 2 modes: Uploading mode and Operating mode. You can switch between them using the switch close to the Digital pins and is called “SERIAL SWITCH”.

As you will Serial pins RX3 & TX3 so you don’t have to move the switch to the Uploading mode at anytime! Yeah, just keep it on the Operating mode always during the code upload and while you are playing with the car.

Then upload the code …

Run it …

After that, open the 1Sheeld App, select these 5 shields:

  • Gamepad
  • Accelerometer
  • Voice Recognizer
  • Slider
  • GLCD

Then reset the Arduino Mega, cover your car and enjoy playing with your Arduino Bluetooth RC car 🙂

More …

This project will not stop here as I am going to make the Arduino Bluetooth RC car autonomous by adding ultrasonic sensors and face detection to it so that it not only avoid things but avoids people too! … Yeah, this seems cool and in the next project, I will show you how you can make it.

 

So, please play with your Arduino Bluetooth RC car carefully as you are going to need it for the next project 😉

Finally, if have any questions please let me know in the comments below .. stay tuned for the upcoming tutorials ^_^




Related Blogs

Arduino Robotics

Arduino Robotics Series, from a car to a robot arm

Arduino keeps standing out from the crowd of all-around development boards due too its ease of use and budget price. As a result, this has enabled almost anyone to get his own idea into life no matter how crazy or even useless to the whole world it was, except for its maker! Also, it has …

Arduino Robot Arm

How to build an Arduino Robot Arm placed on RC Car

Arduino robots are always funny and definitely more enjoyable when combined with robotic arm! And today, I will walk you through the making of a simple Arduino Robot Arm that’s made of cardboard and how you can attach it over your Arduino Bluetooth RC Car / Robot that you have made so far through this series. …

Arduino Line Following Robot

How to build an Arduino Line Following Robot using Cardboard

Arduino Line Following Robot is one of the easiest and most well-known projects that anyone can make to learn the basics of programming, electronics, and mechanics all in one project. It’s known that this project is common for most of the makers and tech students and today I am going to give it a revisit …

Arduino Obstacle Avoiding Robot

How to build an Arduino Obstacle Avoiding Robot using Cardboard

Back again with another Arduino Bluetooth RC Car tutorial but with an advanced feature that makes your car autonomous by adding ultrasonic sensors to the RC Car you have made before!. Yeah, I know that you may have seen other tutorials using ultrasonic to make the car/robot avoid obstacles ahead, but I am going to …

Arduino Security Camera

Arduino Security Camera System (Arduino Home Hacks #4)

Arduino Security Camera Have you ever wanted to check your home in real time? Afraid that maybe someone has stormed in, don’t remember if you shut the door or not or maybe wanna check if your Hyper-energetic dog has broken any of your dishes AGAIN!! 🙂 Then this is the perfect place for you cause today …

Arduino IoT

Arduino IoT Shield Functions Explainer

Arduino makers …. you can connect your Arduino to MQTT brokers(servers) and launch your IoT with Arduino IoT Shield! It’s the 1Sheeld IoT shield that will do the job for you. It’s one of the most important but recent Arduino shields in 1Sheeld. Simply, it turns your Arduino into MQTT client where you can publish and …