Introduction: Create a Robot That Follows Your Hand
In this tutorial, you'll learn how to create this little "robot" that follows your hand (or whatever is closest to it).
Don't forget to follow me for more, and favorite this if you like it!
Step 1: Materials
For this project, you will need the following materials:
- 1 HC-SR04 Ultrasonic Distance Sensor - $0.99 Cheapest results from eBay
- 1 9g Micro Servo + Horn - $2.00 Cheapest results from eBay
- 1 mini breadboard OR piece of perfboard (if you want it to be permanent) - $0.99 for breadboard Cheapest results from eBay
- Jumper wires (a few should be male/female, or you can use some pin headers)
- Arduino Uno + Cable
- You will need the NewPing library for this project to function, you can find and install it here using the instructions on the page.
- Fully setup Arduino IDE
- A hot glue gun or some other adhesive such as foam tape
- Optional - Some PVC tube connectors (for a stand)
Total Cost (Assuming you own an Arduino Uno, jumper wires and some sort of adhesive):
Step 2: Circuit
The circuit for this project is pretty straight forward, basically make all of the ground and power connections, then connect:
- The data (Usually orange/white/yellow) cord from the Servo to Arduino pin 3
- The 'Trig' connection from the Ultrasonic Sensor to Arduino pin 6
- The 'Echo' connection from the Ultrasonic Sensor to Arduino pin 5
Step 3: Create the Robot
With the above configuration, hook up the Arduino to your computer and then run this sketch. Then, after that sketch completes and the Servo stops moving, screw on the horn with the (hopefully) provided screw that (hopefully) came with your servo. Make sure not to move the Servo from the position it was at after running the sketch.
After preparing the servo, attach the mini breadboard to the top of your servo horn (I used some foam tape that I had lying around), and then attach the sensor to that as shown in the picture above.
Step 4: Arduino Code
Upload the code located here to your Arduino (everything is commented, so you might accidentally learn something!), if everything is connected according to step 2 (note that you can plug your jumper wires into the breadboard corresponding to the Ultrasonic connections), the servo should start looking back and fourth and moving towards whatever is closest to it.
Step 5: (Optional) Stand
If you want, you can attach a stand using a few pieces of PVC like so. I did a pretty bad job with hot glue, but there is probably a more permanent way. I would really recommend doing this, because it falls over a lot without a stand.
1 Person Made This Project!
- boneskull made it!