MouseBot: How To - IR Object Detection System!
Part 2 Wall Follower Mouse 'Bot Transformation
The Nose Knows...
Last time we took the little mousebot down to it's skeleton, let's put something back. We want our mousebot to look around without actually touching things. It's a solid improvement to the wall follower, it's a good robotics first step and it involves something almost every roboticist has to face: Object Detection and Avoidance. We will use Infrared (IR) generators and detectors to give the wall following mouse a touchless interface to the wall.
Let's make an IR Object Detection system. While we intend to use the module in our little wall follower mouse upgrade, anyone can use it for any "bot." Basically, it's pretty simple if you have the right attitude about just how much functionality to expect from the microcontroller chip you use.
The little teeny 8-bit pic microcontroller in the version of the picAxe chip seemed a fun choice and could give us a whole load of ideas about how to make it even cooler...
Basic IR detection circuit:
Here's the diagram of the nose test circuit...
![]() |
From Mouse Bot Tra... |
Driving the IR LED is easy with most chips, AVR, Stamp module, everything you can imagine, but with the m8 picAxe, there's only one way to do it... While that way is pretty neat, you gotta dedicate the whole chip to giving our mousebot the nose to end all noses. That's just what we do in this project. Give the picAxe one job to do and expect it to do that job well...
This mouse's nose will have an m8 picAxe chip driving any one of a handful of IR 3-pin IR detector modules while supplying it's own 38 kHz signal to the IR detector... The issue is that when you drive the modulated IR LED you can't stop sending while you check the IR detector because you'd have to shut off the IR you are generating... The m8 picAxe has a pwmOUT command (in Basic) which switches on and continues to run while the picAxe goes on to other instructions...
You guessed it, we start up the IR LED, then let it run while the processor takes a peek at the IR Detector output... In our case, if the detector input goes low (meaning it picked up the reflection of an IR signal from the LED, the m8 responds. In this example, it simply turns on an LED, but in the mousebot, it could tell the other motor to run, so it would turn mouse bot away from the refected signal. Without the reflected signal bouncing off the wall, the mousebot motors flip around and the motor switches so the power is applied to the wheel until it turns again and again, wiggling its way along the wall, just like it did before we cannibalized it.
![]() |
From Mouse Bot Tra... |
After all that, we intend to get the little mouse bot running without touching the walls, but performing only the simplest function... Wall Following... Since we have a microprocessor running the nose, we might as well take advantage of this by adding some sophistcated features... Like variable sensitivity...

If you drop mousebot in the middle of a big room, he needs to be able to find a wall to follow, so, by using the picAxe, we detune the IR LED's output signal so it still stimulates the IR Detector, but has very little of the power... Thus we can use the sensitivity of the "nose" to determine how far away from the wall the mousebot will wiggle along at... Oh boy, now the little guy can use the smart nose to enhance it's capability and justify the four bucks spent on the picAxe...
No comments:
Post a Comment