Arduino 4WD bluetooth controlled rover
This is a simple 4WD rover i made with Arduino.
the rover is controlled with an android phone or tablet over bluetooth. With that app you can control speed (using Arduino's pwm) , run it with the accelerometer and many other things.
The Arduino sketch is fully commented and open source, also the communication protocol (developed by me) from the app to Arduino is explained in the sketch .
Knowing the protocol you can use the app to control other robots...
Step 1: What You Need...
In order to build your own Arduino 4wd rover you should buy all the needed parts from your preferred store.
Most of them can be bought on ebay or amazon or other online electronics/hobby stores.
I try put some links but they could be outdated and not working, in this case try search the part manually by name. Sorry for that.
Anyway it’s a very simple robot kit usually made by a chassis, four Dc (up to 12V) motors with gearmotor and four wheel.
The parts used are:
- 1 pcs of chassis complete with 4 DC motors, usually called Arduino rover 4wd, for example these:
Also a search on Ebay with the '4WD chassis robot arduino' keywords will return a lot of results.
- 1 pcs of Arduino uno R3 or Arduino Leonardo board
- 1 pcs of Bluetooth module HC-06 with adapter board or equivalent (must be SLAVE model), for example this:
- 1 pcs L298 bridge dual motor controller board, for example this:
There are many different of these but the pinout is 99% the same for all.
Just connect wires to the right pins based on the board diagram. with this tutorial you can find the datasheet of the one I used (see next step).
- 3 pcs 3.7V 1200mA (or more) Li-Ion rechargeable battery AA size or 11,1V 1200mA LiPo battery pack.
if you use the AA size battery you can put them in a battery holder.
- 1 pcs Jack plug for Arduino power plug.
- 1 pcs 1Kohm resistor.
Step 2: The Schematic Diagram...
This is the schematic diagram for wiring the rover, please follow it while assembling it in the next step...
The L298 pdf will help you in case you have a different board pinout.
Step 3: Assembling the Rover…
Follow the numbered images and the short video for the assembling order (some things may differ depending on your chassis…).
- Start with the motors on the chassis and wheels (image 1).
- Mount the L298 motor controller board and wire motors to it.
Also add 2 wires to power the board (image 2 and 3).
- A piece of flat cable will connect the board to Arduino, you need only 6 wires but I left some other free for future use (maybe lights or ultrasonic sensor…).
Also wire the jack plug , pay attention to polarity, the central pin is positive (+11.1V from battery) (image 4).
- Place the battery holder (or the battery pack) in the front of the rover, fix it with a piece of double-sided tape. If you choose the AA size battery it’s simple to remove them individually for recharging.
If you choose a battery pack then could be a good idea to put a connector between the battery pack and the rover (image 5).
Place the top of the rover…the flat cable and the jack plug passes through the hole (image 6)
Assemble the bluetooth module with the resistor using a piece of flat cable (usually provided with the module). Cut the RXD wire (not the pin!) and solder the resistor in series to the wire.
Seal with a heat-shrinkable tube (image 7).
Place the Arduino board and the module. Connect the flat cable as in the schematic.
Fix the Bluetooth module with a (very) little piece of double-sided tape.
Connect the power jack to Arduino (image 8).
Step 4: The Arduino Sketch...
Open the Arduino sketch and upload it to an Arduino uno R3 or Leonardo Board.
Connect (almost) the Bluetooth module HC-06 as in the schematic (remember the 1Kohm resistor! on RXD pin of the module).
Power on the Arduino board and run the serial monitor, the string ‘Connected to: ArduinoRover’ should appear (maybe not for Leonardo board) if the communication speed already match.
In the serial monitor set the communication speed to 57600 baud to match the line with Serial.begin(57600) and the NL (New Line) terminator.
From the serial monitor write the string: ‘Echo on’ and click Send, you should see ‘Echo is on’, this will echoes the next commands to the screen.
From the serial monitor write the string: ‘Device’ and click Send, you should see:
‘Connected to: ArduinoRover’
Now send the string ‘AT’ , you should see ‘OK’ after about one second, this mean your Bluetooth module is correctly connected and the baud rate match the one set in the sketch at: BtSerial.bregin(9600).
To change the Bluetooth module name send the string ‘AT+NAMEArduino’ (for example), you should see:
'OKsetname' in about a second.
Now try find the Bluetooth module with your smartphone or tablet and pair with it, insert the pin, usually 1234 when asked for.
Complete the project (see assembling the rover) if not already done.
Step 5: The Android App...
Now your Rover is ready to run!
You need the FREE android app IRacer & Arduino BT controller from the playstore here:
The app allow you to drive the rover with the four way joystick in portrait mode or with 2 joystick (multitouch) in landscape mode.
Open the menu (the gear button), choose settings and select the device Arduino Rover.
From the menu, choose connect and select your already paired bluetooth module name from the list to connect to.
In the settings menu there are a lot of options (backgrounds, speed limits ...) to play with, enjoy :)