This afternoon I have been thinking about a wall following sensor to help a robot navigate a maze. They are popular in the robot vacuum cleaners but not so much elsewhere.
For the purpose of discussion the robot wil run in a maze with paths up to 10 inches wide. I want to point a narrow beam IR LED at the wall next to the robot. If the robot is parallel to the wall the beam will come back as a uniform cone. Reflected cone size will indicate the distance from the wall. When the robot is crooked the beam will be distorted. This will be detected by a line of photo-transistors ahead of and behind the emitter.
I can get about 9 photo-transistors to an inch and more if I stagger them. It is my hope that about 10 on each side of the emitter will be enough.
The problem that is bugging me is that I need the uC to control the voltage going to the IR LED in addition to modulating it at 40KHz. Let the computer pick the intensity that works best.
The first thing that comes to mind is to PWM the high part of the 40KHz, use a capacitor to smooth out the voltage. Can this work or is it too choppy.
A digital pot could be used if one could be found that handled the current (should not be a problem) and the correct resistance range. The smallest resistance pots from microchip are about 0 to 5K.
Maybe use a digital pot with an opamp. If it was setup right once could have all the pots steps in a useful range.
Suggestions?
For the purpose of discussion the robot wil run in a maze with paths up to 10 inches wide. I want to point a narrow beam IR LED at the wall next to the robot. If the robot is parallel to the wall the beam will come back as a uniform cone. Reflected cone size will indicate the distance from the wall. When the robot is crooked the beam will be distorted. This will be detected by a line of photo-transistors ahead of and behind the emitter.
I can get about 9 photo-transistors to an inch and more if I stagger them. It is my hope that about 10 on each side of the emitter will be enough.
The problem that is bugging me is that I need the uC to control the voltage going to the IR LED in addition to modulating it at 40KHz. Let the computer pick the intensity that works best.
The first thing that comes to mind is to PWM the high part of the 40KHz, use a capacitor to smooth out the voltage. Can this work or is it too choppy.
A digital pot could be used if one could be found that handled the current (should not be a problem) and the correct resistance range. The smallest resistance pots from microchip are about 0 to 5K.
Maybe use a digital pot with an opamp. If it was setup right once could have all the pots steps in a useful range.
Suggestions?