(Its a lot harder than it looks)
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Did I say harder? Well, It was pretty simple really. I started out with some motors and gears with wheels bought from a discount house in New York city. From there I used a board for the main battery platform and then I used an old CD case cover for the upper deck that holds the Arduino MEGA256 and MotorShield. For the 'brains' I used a 9g servo and an Ultrasonic sensor. The ultrasonic sensor pans left and right feeding the Arduino with realtime info about the distances from objects. There are routines that will run when an object is encountered that guide the robot away by either vearing off, turning at a right angles or reversing course. It is a VERY good idea to use two separate battery backs, one to power the microcontroller and the second one to power the servos and motors. The electrical noise generated by these motors can scramble the program in the Arduino or PICAXE and cause other strange problems.
I tried many times to put this together without breaking something, but it was not to be. The plastic CD cover used for for the upper platform was brittle and when tightening screws, it would split in many directions. Next time I will use a better material for the job.
Above you can see the motorshield. It has 2 duel H-bridges and can run motors and servos. The value in using one is that you can power the shield with another battery pack seperate from the Arduino's supply. This way you can run the servos or motors at a full 6 volts and not burn up your microcontroller.
In my case I powered 2 motors and one servo from the motorshield and used the Arduino powersupply to power the ultrasonic sensor.
Here you can see the sensor mounted on a red piece of card board. The sensor is a HC-SR04 The sensor itself has four pins. Pwr, Echo, Trig, Grnd. It uses 5 volts and about 20mA.
Here is a closer shot of the HC-SR04 Ultrasonic sensor. The datasheet says it has a range between 9 and 10 feet. Here you can see it mounted on top of a servo that turns the sensor right and left. In theory this works, but real life is a bit harder on you. I have found that even though the sensor is VERY fast and does a great job at what it does, it just plain cant keep up with a very fast ground speed. I mean it needs to be really slow. If the robot is slow enough the system works well.
My next fix will be to address the input control system. LOL.
No comments:
Post a Comment