3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Ard-e: The robot with an Arduino as a brain

Step 8Ard-e's robot senses: tracking how far his wheels turn and seeing IR light

Ard-e\
«
  • detail.BMP
  • Wheel sensors.BMP
  • wheel sensors sideview.BMP
Since humans don't have wheels their is really no need for us to be able to track how far our wheels have turned. Ard-e being a wheel based robot however needs to know this. To accomplish this you can employ many different methods. An instructable was just submitted for this contest that takes the data from an accelerometer then extrapolates the distance from that. For Ard-e however all we are going to need is an LED and another light sensor. We just need to shine a led through his tracks and then have a light sensor on the other side count how many times the light changes from high to low. Once you have a count on this number you can measure the distance between holes in the tread and correlate this to a distance. Or you could just set Ard-e to drive for a number of counts of the light switching from high to low then measure the distance that he traveled to get the conversion factor from counts to inches (or centimeters if you like working in SI). Then you can literally program Ard-e to go exactly six feet forward turn right go forward a foot or any other course you want it to take.

To actually build the sensor I used my trusty piece of scrap metal and folded a rectangular piece of it into a U shape. I drilled a hole to mount it into the side of Ard-e and then two holes for the led and the light sensor to fit into. I mounted it onto Ard-e so that the led shines right through the center of the holes in the treads onto the light sensor. I put the light sensor on the top part of the U and then put some electrical tape around the sides of the U to block out some of the ambient light that would mess up the readings of the light sensor. I then connected the light sensors just like I connected them for making Ard-e sense where the brightest light is, as a voltage divider to an analog input (using the same input pins and resistors as the "eyes" of Ard-e). The led was soldered to a resistor sized to enable it to run off of 5V and then plugged into the power being supplied by the Arduino.

Just by moving the wheel manually and watching the values that the Arduino outputs using the Serial.print() command to the serial monitor you can get a 600 point swing on the scale of 0-1023. The low is around 200 and the high is around 800. I attempted to write a program that uses 400 as the cutoff for a low to high value and counted the times it switched from below to above 400 but it was beyond the scope of my programming abilities. I think it was because i was using too slow of a speed on the serial printing and checking of the values of both sensors and the treads were being spun pretty fast. When I tried to use a higher speed it wouldn't print at all. In retrospect I don't even need to have the values printed. I wasn't able to get the Arduino to correctly read the values coming from the sensors as the wheels were spinning but I demonstrated that it was possible to use this sensor to count the number of times that the tread interrupted the light from the LED to the light sensor. And if your a better programmer than I am you could convert this number to a distance and program Ard-e to drive to that distance.

Another of Ard-e's robot senses that would be awesome for him to have is being controlled by an old VCR remote. I found a remote in the old pile of electronics junk and found a infrared Radiation sensor at Radio Shack. All that you would need to do is hook the infrared sensor up to the +5V and Ground and then the output to an analog input on the Arduino, just as it says on the back of the box for the sensor. Again if your a much better programmer than I am you could then program the Arduino to recognize the IR signal from the remote and correlate it to making Ard-e move. If the up arrow on the remote is pressed make Ard-e drive forward, if the down arrow on the remote is pressed go backwards, etc. I bought the sensor from radio shack but haven't been able to get the Arduino to interface with it it yet.

So now Ard-e's senses are complete! Or at least as complete as I can make them. You on the other hand should get started recycling some old junk to add on as sensors for your own version of Ard-e. Now whats next for Ard-e?
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
18
Followers
3
Author:imadami