Arduino Voice Controlled Robot


5,041

71

32

Introduction: Arduino Voice Controlled Robot

Over the years as technology advanced and grew at a tremendous pace, so did the horizon of ideas and creation in our mind. If we look a few years back, a teenager like me would dare think about creating a robot that would operate listening to their voice and follow the given commands. All they could do was dream about making such a fancy robot and let the idea pass from their mind. But with the help of today's technology, those great ideas are no more left being dreams but are coming true. Having not to deal anymore with complex circuits, Arduino gives us a very simple approach into building projects that were once impossible to make unless you were a genius and had all the materials required for making such a project.

In this Instructables, I have accomplished a project that was once a dream to me. With the help of materials and components that I found lying around in my house, I ended up making this simple yet fascinating voice controlled robot with the help of an Arduino UNO.

If you find this helpful and fascinating, do drop a vote for me in the "first time author" contest.

Step 1: Gather the Materials Needed

In order to make this project, you'll need to gather the materials mentioned below. They are easily found at a nearby local electronic shop or simply purchase them online.

Electronic components:

  • Arduino UNO - 1x
  • L293D motor driver - 1x
  • Servo motor (MG995) - 1x
  • DC gear motor - 4x
  • HC-05 bluetooth module - 1x
  • Ultrasonic distance sensor - 1x
  • Mini breadboard - 1x
  • 3.7v LiPo battery - 2x
  • Jumper wires

Hardware:

  • Chassis - 1x
  • Rubber wheels - 4x

Tools:

  • Soldering iron
  • Screwdriver
  • Double sided tape (or you can use hot glue if you have a glue gun)
  • Scotch tape
  • Scissors

Step 2: Building the Base

To begin with, fix the motors to the chassis. In my case, I used a wooden chassis. With the help of double sided tape, get the four motors fixed in their respective corners. For safeties sake, I put a layer of scotch tape around the chassis and the motors. Make sure the wires coming out from the motors are neatly arranged for in case there's a problem, it's easily solved. Once the motors are attached to the chassis, fix the wheels to the motors.

Step 3: Getting Into the Circuit Part 1

Place the Arduino in the centre of the chassis as it will be acting as the brain for the robot. You will need four jumper wires. Place the first one in one of the Gnd port of the Arduino. The second wire in the 5v port. The third wire in the TX port and the fourth wire to the RX port of the Arduino. Once done, place the L293D Motor Driver right on top of the Arduino.

After the motor driver is fixed properly on top of the Arduino board, take the motor wires one by one and with the help of a screwdriver, connect the wires of motor 1 to M1 of the motor driver, then motor 2 to M2,then motor 3 to M3, and finally motor 4 to M4. Make sure there's no loose connection.

Step 4: Getting Into the Circuit Part 2

Place the mini breadboard close to the Arduino. Fix the HC-05 bluetooth module onto the breadboard and connect the Gnd wire coming out of the Arduino board to the Gnd of the bluetooth module. Then connect the 5v wire to the VCC of the bluetooth module. Take the RX from the Arduino and connect it to the TX of the bluetooth module. And finally, connect the TX of the Arduino to the RX of the bluetooth module.

Once the bluetooth module is connected, place the Servo Motor (MG995) right at the front of the chassis. I have attached the servo with the help of double sided tape, but if you have a glue gun, then you can use that as well.

Finally, fix the Ultrasonic Distance Sensor on top of the servo's head. In my case, I used a thin layer of polystyrene. I inserted the pins of the sensor into the polystyrene as it's a soft and light material.

Connect the three wires coming out of the servo to the specific 'servo ports' on the motor driver.

In the end, connect the two 3.7v LiPo batteries to the motor driver's power source. Once done, you're ready with the hardware.

Step 5: Uploading the Software

Download the code I've shared below and make sure you have the Arduino IDE installed on your computer.

Before uploading the code onto the Arduino, you'll need to download the 'AFMotors' library. You will need to go to: https://learn.adafruit.com/adafruit-motor-shield/library-install and download the respective library. Once downloaded, open the Arduino IDE, go to the library section and click of the 'AFMotors'. You will also need to select the 'Servo' library which comes preinstalled with the Arduino IDE.

IMPORTANT: Before uploading the code onto your robot, make sure the RX and TX pin of the bluetooth module is disconnected. Also, make sure you choose the correct Port and Micro-controller before uploading the code.

Step 6: Install the App on Your Smartphone

You will need to go to Google and search for the app called: ARM_Voice. Once the app is downloaded, turn on your robot with the help of the external power supply and on your phone turn on bluetooth. From the app, choose the 'HC-05 Bluetooth Module' option and you will notice that the fast blinking red light on the bluetooth module slowing down into a slow blinking gesture which means you successfully connected your smartphone with your newly made robot.

(To make it simpler, I've attached two pictures of how to connect the robot's bluetooth module with your smartphone.)

Step 7: Command Your Newly Built Robot

In order for the robot to go forward, simply say, "move forward" and to go backward say, "move backward".

To make the robot turn left or right, command, "turn left" or "turn right". While your robot is performing a specific task, if you want it to stop doing what it's doing, simply command, "stop".

I really hope you enjoyed going through my Instructables and liked this project. I will highly recommend you to try this out if you like tinkering during your free time or you are passionate about such cool stuff. Personally, I had a lot of fun making this project. I hope it will be the same for the ones you try it out.

Once again, thanks for your patience and please drop a VOTE for the "First Time Author" challenge :-)


First Time Author Contest

Participated in the
First Time Author Contest

Be the First to Share

    Recommendations

    • Digital Fabrication Student Design Challenge

      Digital Fabrication Student Design Challenge
    • Home and Garden Contest

      Home and Garden Contest
    • Colors of the Rainbow Contest

      Colors of the Rainbow Contest

    32 Comments

    0
    26thgenius
    26thgenius

    Reply 3 months ago

    Hi there! Thanks for sharing this link :-)

    0
    braedenmh
    braedenmh

    Question 1 year ago

    Hi again! Do you remember the exact batteries you bought for this project. Thank you!

    0
    26thgenius
    26thgenius

    Answer 4 months ago

    Hi there! I've used two 3.7v LiPo batteries. Hope this helps you

    0
    FranciscoR130
    FranciscoR130

    1 year ago

    Good
    I have a problem with the voice commands that nothing works at all when I give it functions but it does not do anything, could you tell me that a greeting may fail my granddaughters liked your assembly very much they are very interested in making it work
    thank you very much for your help
    my email is alborada_lm@yahoo.es

    0
    26thgenius
    26thgenius

    Reply 1 year ago

    hola amigo!
    if you used my code, did you come across any error while compiling it? you could also re-check if the 'command string' in the code is the same as to what you are commanding to the robot.

    for example, if you've written, if(command == "*move forward#"
    then make sure you give the command "move forward."

    also, did you download the right app on your android? if yes, is your robot connecting successfully to your phone?
    if you yet come across the same problem then do let me know, i'll try looking into the problem deeper and answer via your email. hope it works out!
    thank you very much :-)

    0
    FranciscoR130
    FranciscoR130

    Reply 1 year ago

    Good
    I tell you everything is reviewed, the bluetooth connects with the mobile the sequence of lights, everything is fine, but nothing moves at all, which could be the fault
    greetings and thank you very much my granddaughters and this server we thank you for your time
    I pass my email to alborada_lm@yahoo.es from MADRID SPAIN

    0
    sai1478
    sai1478

    Question 1 year ago

    can u pls add a circuit diagram?

    0
    26thgenius
    26thgenius

    Answer 1 year ago

    oh yes, i will add one. sorry for the late reply, i had got busy with college work. just give me a couple of days. thanks

    0
    FranciscoR130
    FranciscoR130

    Question 1 year ago

    Buenas
    tengo un problema con los comandos de voz que no funciona nada de nada cuando le doy funciones pero no realiza nada podrías decirme que puede fallar un saludo mis nietas les a gustado mucho su montaje están muy interesadas en que funcione
    muchas gracias por su ayuda

    0
    26thgenius
    26thgenius

    Answer 1 year ago

    ¡Hola amigo!
    si usó mi código, ¿encontró algún error al compilarlo? También puede volver a verificar si la 'cadena de comando' en el código es la misma que la que le está ordenando al robot.

    por ejemplo, si ha escrito, if(command == "*move forward#"
    entonces asegúrate de dar el comando "move forward."

    Además, ¿descargaste la aplicación correcta en tu Android? Si es así, ¿su robot se está conectando correctamente a su teléfono?
    Si aún se encuentra con el mismo problema, hágamelo saber, intentaré investigar el problema más a fondo y responder a través de su correo electrónico. espero que funcione!
    Muchísimas gracias :-)

    0
    braedenherriott2004
    braedenherriott2004

    Question 1 year ago on Step 4

    Hi! Is the motor driver's power source a separate component from the batteries? Is it something you have to buy additionally? Thank you!

    0
    26thgenius
    26thgenius

    Answer 1 year ago

    Hi there! Sorry for late reply.
    I powered up the motor driver with the help of the arduino. Whereas the batteries which are connected to the motor-driver will be powering the four motors.
    If you have an arduino, and the specific battery that I've mentioned, you don't need to buy anything separately other than these two components. Hope I could help clearing your questions.

    0
    braedenherriott2004
    braedenherriott2004

    Reply 1 year ago

    Thank you so much! I am enjoying this project a lot!

    0
    braedenmh
    braedenmh

    Question 1 year ago on Step 6

    Would the HC-05 Bluetooth Module connect to an android laptop instead of an android smartphone? Do you think the project would still work? Great project!

    0
    26thgenius
    26thgenius

    Answer 1 year ago

    If you could download the given app on your laptop then I don't see a problem as to why won't work. You can get the app by downloading a software called BlueStacks on your computer. Once downloaded, open it and you'll see that it's a complete android world in there. You can download all the apps a smartphone has. So, you can download ARM_VOICE as well and work this project out perfectly fine 😁

    0
    braedenmh
    braedenmh

    Reply 1 year ago

    Thank you!

    0
    mekong07
    mekong07

    Question 1 year ago

    I replicated your project but it doesn't work, some advice?

    0
    26thgenius
    26thgenius

    Answer 1 year ago

    could you be more specific what doesn't work? I could help you then...

    0
    mekong07
    mekong07

    Reply 1 year ago

    not everything works