Yaron Vazana

NLP, Algorithms, Machine Learning, Data Science, tutorials, tips and more

  • About
  • Blog
  • Projects
  • Medium

Contact Me

yaronv99 [at] gmail.com

Powered by Genesis

You are here: Home / Robotics / Arduino Robot part two

Arduino Robot part two

January 9, 2015 by Yaron Leave a Comment

This tutorial is the second part of the Arduino Robot project, here is a quick reminder of the first part. This part will focus on the hardware and software assuming you already followed the first part and assembled the robot.

As always, I’ll start with the final Robot just to keep you focused

Arduino robot front

So our goal is to make this robot drive while avoiding obstacles ahead. Remember that last time I showed how to connect the motors to the motor shield. Now I’m going to show how to connect the servo motor and the ultrasonic sensor and operate them. After I will have all the parts connected, I’ll write the Arduino board code which will start navigating the robot.

This Tutorial Includes The Following

  • Connecting the Servo Motor to the breadboard
  • Connecting the Ultrasonic Sensor to the breadboard
  • Writing the navigation algorithm

Connecting the Servo Motor

A servo motor has 3 wires:

  1. 5V – usually red
  2. GND – usually black
  3. Signal – usually white

In order to connect the Servo motor, we need to extend the protoshield output pins into the breadboard, and then connect the motor wires.
Find the 5V pin and the GND pin on the Arduino protoshield, connect a wire to each one of them and connect the other side of the wires to separate rows on the breadboard. The breadboard is useful for connecting many electronics on a single board. Now make sure the 5V and the GND of the Servo motor are connected to the 5V and GND of the protoshield. The signal pin should be connected the same way, I connected it the pin 10 (pins 8, 11, 13, 9, 3, 12 are saved for the motor shield so you shouldn’t use them).

Connecting the Ultrasonic Sensor

Like the servo motor, the Ultrasonic sensor has 3 wires:

  1. 5V – usually red
  2. GND – usually black
  3. Signal – usually white

Connect the wires from the sensor into the breadboard the same way we did with the motor. Make sure you choose a signal pin which is not already being used. I chose pin 7.

Arduino robot topAt this point, you should have the robot like in the image, but without his brain. Let’s start writing some code, you can Ctrl+C Ctrl+V the entire code to your Arduino IDE and it should work perfectly (assuming you connected the signal pins the same I did).

I’m using the Arduino IDE 1.0.6 under Ubuntu 14.04 machine.

Download code from GitHub

The Navigation Algorithm

Cheers

Filed Under: Robotics Tagged With: Arduino, Hardware, Programming, Robotics

I am a data science team lead at Darrow and NLP enthusiastic. My interests range from machine learning modeling to solving challenging data related problems. I believe sharing ideas is where we all become better in what we do. If you’d like to get in touch, feel free to say hello through any of the social platforms. More About Yaron…

SUBSCRIBE TO BLOG

Subscribe to Blog

Subscribe to get the latest posts to your inbox

Recent Posts

  • Training an AutoEncoder to Generate Text Embeddings
  • Using Dockers for your Data Science Dev Environment
  • Identifying Real Estate Opportunities using Machine Learning
  • How to Create a Simple WhatsApp Chatbot in Python using Doc2vec
  • Average Word Vectors – Generate Document / Paragraph / Sentence Embeddings
  • Visualizing Vectors using TensorBoard
  • Training a Doc2Vec Model with Gensim
 

Loading Comments...