So, even though I’ve built a wide variety of crap over the last few years, all of them with varying utility, I’ve decided to build a quick robot. With oodles of free time and the feeling of having to go back to work on the horizon after what feels like an eternity of holiday (1 week) I quickly grabbed a bunch of stuff I had sitting around and put this guy together with all the grace of a kindergarten macaroni art sculpture.
Based off of an Arduino Nano, this guy works just fine. I don’t like using Arduinos for the following reasons.
- Perceived lack of control of what’s going on inside
- Feels like cheating since it’s so easy
- Arduino UI is kind of shitty, especially for larger source files.
- When dealing with AI routines, making it difficult to use multiple files is a minus
Anyways, i plugged ahead and quickly pounded this out with the following IO
- Input – The only one, the Echo pin on the ultrasonic sensor
- Output – Trigger on ultrasonic sensor
- 4 Digital output – for controlling direction on SN754410 Quad half h-bridge driver. These go to two gear motors which are attached directly to wheels
- 1 PWM out for duty on motors
- 1 attached servo out of the servo to turn the sensor
Most everything worked out swimmingly until I fucked around with some wiring and produced a short. I hooked the robot on to the USB supply on my computer, I noticed after a few second that the power to the unit wasn’t running… hmmm POOF! Well, as it turned out, there was a problem with the wiring to the ultrasonic dealy and it blew what I beleive was a zener diode
I wasn’t able to figure out exactly what it was, I suspect that it is a zener diode that selects between main power and USB since it is on the output of the VReg. I could be wrong. Since I didn’t have any more Arduino Nano’s I simply tried to fix it and soldered a wire across the offending gap. The device seems to work fine…? Anyways, if anyone know what that part was on the Arduino Nano v3.0, I’d like to know ’cause I couldn’t find the 3.0 Schematics and the design has moved those parts around.
Anyways, The robot moves around based on a very simple algorithm.
- Stop Moving
- Scan from 40Deg Right to 40 Deg Left in 10 deg increments
- return appropriate movement from a function that analyses it
- execute proper movement (Forward, Backward, Right, Left, Hard Right and Hard Left)
It seemed to work reasonably well. I’d like to build a more sturdy version for shits and giggles so that I can play with the algorithms. I’m probably gonna build one with a PIC18F2685 instead of an Arduino. Also, instead of a single sensor, I will use IR proximity sensors to detect low lying objects. Moving the sensor with the Servo make the robot seem more intelligent than it actually is like it’s ‘looking around’. I quite like that. 🙂
Anyways, it’s my first post of the year, considering it’s January 1st and 3:52 am as I write this. maybe I should go to bed. Here’s a video of it getting around.