Introduction: MultiTasking Robot
Bluetooth-controlled robot, doing some task based on commands: Manual control (RC Mode), Autonomous (Obstacle avoider Mode), shows a text on LCD, also control the Robot's speed.
Step 1: Parts Needed
You will need:
- Arduino Uno/Genuino
- Motor Driver (I'm using 2A Motor Shield from DFRobot)
- Three of Ultrasonic sensors HC-SR04
- HC-05 Bluetooth module
- 16x2 LCD with I2C
- Jumper wires
- Mini-breadboard
- 9V battery for Arduino, 7.5-12 V battery pack for motors (custom)
- Robot chassis (I'm using DFRobot Devastator Tank Mobile Platform)
- Soldering tools
- Any tools that may help you work easily
- Creativity
Next...
Step 2: Modifying Some Parts
Here, you need to modify some parts, the HC-05 bluetooth module and the LCD. You have to make a voltage divider for the bluetooth module and add an I2C module to the LCD.
Step 3: Build It..
Attach your arduino and parts in their proper place, based on your creativity. For good looking, neat the jumper wires.
Step 4: Wiring Diagram & Programming
Follow this wiring diagram to hook up the parts. Instructions also included in the program. Install the libraries then upload the program. Make sure to release the HC-05 RX TX pins from the Arduino pins before uploading.
Step 5: Play With Your Robot
To control Robot from PC, use TeraTerm software. Software download available here: Tera Term
To control over Android, you can use this app: Arduino Bluetooth Controller
Pair your HC-05 with your device first. When it is asking for password, enter 1234 (default HC-05's password).
Then:
If you use TeraTerm: open the software, click 'Serial', choose your bluetooth port, play.
If you use Android, open the app > Proceed > choose HC-05 > open the Controller Mode > set your controller keys (Set Commands), play. You can also use the Vehicle Mode, set the controller keys too.
These commands based on the codes:
w : Move Forward
a: go Left
s: Move Backward
d: go Right
q: Stop
e: decrease speed
r: increase speed
x: LED ON
z: LED OFF
1: Obstacle Avoider Mode
2: Showing the text on LCD
0: Clear n turn off the LCD backlight
You can modify the codes for another commands. If you fail once, don't give up! That's what make this fun. Do troubleshoots. Hope you make it!
2 People Made This Project!
- Dimas Sheldon made it!
- Dimas Sheldon made it!
21 Comments
9 months ago
Hi Thank you for sharing this project, can I use the L293D or Motor shield
Reply 9 months ago
yes offcourse you can. you only need to adjust pins initialisation based on your motorshield if required
Question 2 years ago
This is not stopping...until the next key is pressed..so how to make it stop when we take out hand from the key...and when pressed it should move
Answer 2 years ago
Your code is executing the previous task..
Go through your code with very careful eyes :-)
4 years ago
Hi, thank you very much for sharing your work/instructions. I'm helping my nephew to building this as his first robot project. I have question about step 2, "Modifying some parts". It says "You have to make a voltage divider for the bluetooth module", is this referring to the 1k and 2k resistor as shown in the diagram? Can you please tell me what specific type of resistor to buy? Sorry if I'm asking something very basic...I looked up on ebay and there are many with different Watt and ohm, unsure which is the right one. Thank you for helping out.
Reply 4 years ago
Hi! Thank you for your comment. Yes it's referring to the resistors as shown in the diagram. You can use the 1k and 2k carbon film resistor with 5% tolerance and i think it's fine to use 1/4 or 1/2 Watt of them. Thank you.
Reply 4 years ago
Thank you for the quick reply. I'm having difficulty finding 2k resistor on ebay, but there are a lot of 2.2k ones....can i use them instead? thanks again.
Tony
Reply 4 years ago
Hi, Tony! Actually i experienced the same with you, so i replaced the 2k resistor with 2x1k resistors in series. Hence, you will need three 1k ohm resistor. Thank you
4 years ago
I need friends
5 years ago
hi i am getting errors in my compiling it is saying'NEWPING'does not name a type please help i really want to make it THANK YOU
Reply 5 years ago
Sorry for slow response. You might not find errors if you use the program and the library that i give in step 4, except if you modified the program with your own codes. Please check your codes again, make sure you have 'initialize' everything before. Thank you
5 years ago
Thank you DimSheldon That helped with the errors. I also had to figure out my I2C
address and configuration. Now working out my motor controller. Doesn't follow the
commands quite right.
Thank you again Peter
Reply 5 years ago
ok, you're welcome
5 years ago
C:\Users\Peter\AppData\Local\Temp\build6fb2e7783
4053d47e65979797fe94432.tmp/core\core.a
(Tone.cpp.o): In function `__vector_7':
C:\Program Files (x86)\Arduino\hardware\arduino\
avr\cores\arduino/Tone.cpp:539: multiple definition
of `__vector_7'
libraries\NewPing\NewPing.cpp.o:C:\Users\Peter
\Documents\Arduino\libraries\NewPing/NewPing
.cpp:284: first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling.
last post didn't print everything. Sorry
5 years ago
Hi, I tried compiling your code and am getting errors.
C:\Users\Peter\AppData\Local\Temp\build6fb2e77834053d47e65979797fe94432.tmp/core\core.a(Tone.cpp.o): In function `__vector_7':
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Tone.cpp:539: multiple definition of `__vector_7'
libraries\NewPing\NewPing.cpp.o:C:\Users\Peter\Documents\Arduino\libraries\NewPing/NewPing.cpp:284: first defined here
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling.
Can you help.
Thank you
5 years ago on Introduction
can i use hc 06 in place of hc 05
Reply 5 years ago
I haven't try it before, but you can try use it. But I recommend you to use the Hc05, because the HC05 can be a master and slave, where the Hc06 just can be a slave module.
5 years ago on Introduction
Thanks, this is great! I am making something similar but I'm using PIRs to look for a human and then follow the human (like a pet robot) I'm using ultrasonic sensors for avoidance while it looks for a human... if it cannot find a human after a time, it emits a cry. Feedback welcome!
Reply 5 years ago on Introduction
wow yours is great! i wanna try to make it later!
5 years ago on Introduction
Cool robot.