As my first microcontroller robot, I have made a two-wheeled robot with bumper switches and edge-detction (because I have death-causing cliffs in my house). The next step is to install a switch to turn on a sucking fan, although I'll have to add an additional power supply in this case, other wise the poor thing will only run for a short time before dying.
It uses a picaxe18X to poll the bumper switches and the IR detectors, then signal to a 74AC240 octal inverter chip which drives the motors. Both the picaxe and the motor driver are mounted on pcbs that I etched on my balcony - etching is fun, but can leave horrendous stains if you drop even a tiny bit of acid...
I'm not completly happy with the algorithm at present - Ideally, I'd like to have interrupts triggered by the bumpers, and by the IR sensors - it's easy enough to have an interrrupt attached to a physical switch, but less easy to have an interrupt triggered by a condition that needs to be calculated... (unless somone has a bright idea?).
The red case is a "hand vaccum" that I got at a local store here. As you can see, there have been a few iterations of ideas and so there's a few holes cut into the case with no apparent purpose.
The first mistake was using LDRs and bright LEDS for obstacle avoidance, but this really didn't work very well for fine objects, such as chair legs, power cables etc, besides, I want this robot to get RIGHT INTO the corner. Reflection by light really won't work for small, dull things (such as wooden chair legs..)
Oh, the hole here is just the acess for the programming jack
Bumper switches are made from heat-molded acrylic. They were cut to that funky shape so they will be triggered by any obstructions on the ground, such as powercords (there's a few power cords lying around), dumped bags or whatever on the floor (sloppy people, I know, that's why I'm trying to make a vacuuming robot, so I can be even sloppier
Yep, the price tag says 105 yen. that's what that stupid little battery-holder-with-switch cost me - and a rough approximation of the bot's total worth.
The Cliff detection caused me some grief, and here's the reason why; I think it's been noted often that the angle of the IR sensor is critical, I have to say - it really really really is. I had to tweak the angle of the detector so that it was pointing directly at the IR reflection. I did this by trial and error, watching the readadc values as I adjusted the angle.
The circuits for the IR detector/sensor system was pretty much identical to that given by oddbot (here). Here's a copy of the circuit, and PCB I used;
In case it's interesting, the left is the schematic for using the 74AC240 octal inverter as a motor driver - I don't know too much about what is better or best, but this IC seems to be really great as a cheap motor driver - and it has a lot of other uses too.
In the pcb diagram on the right, I put in a couple of protectiondiodes across the motor terminals. It's a really compact board - much (much much) easier to etch than to freeform.
Update!; the proof that the vacuum works too..All this after 10 minutes!
(yes, the house is dusty..)