Modulated Light Beacons for Orientation in a Room
in Robotics
Hi perhaps someone has done something similar or has some other comments? - Thanks in advance!
Idea is:
- A robot is moving inside a room.
- Goal is to have position and orientation.
- It has a fototransistor mounted similar to the robots having a ping sensor, so that it can be turned horizontally with a servo motor. Actually the idea is to use the same servo. The fototransistor is sitting in a tube, so that it's angle of vision is limited. - A 1 pixel camera.
- In the room there are at least 2 light beacons, which each have a light (preferable visible). These lights are modulated as square wave blinking on/off but the two (or more) beacons each have their own frequency, to be able to distinguish them.
- The signal from the fototransistor is high pass filtered, amplified and fed to a P2 ADC then filtered again either with the Goertzel Smart Pin Mode or with Goertzel Software working on a sampled buffer.
I had done something in this direction using a camera some time ago. It's frame frequency was low and the blinking frequency was also low. Now I am more thinking of something like 10 kHz.
The method seems to be interesting, because a beacon can be build cheaply and the hardware on board of the robot seems also to be very simple, if the P2 can do a lot.
Of course wondering about resolution and possible range.
Cheers Christof

Comments
While not same as you are planning, at least it might give you some ideas: Earlier this year I used modulated IR for navigation in a straight line, see this discussion (you were also participating): https://forums.parallax.com/discussion/comment/1566360/#Comment_1566360
I got a lot of help from @JonnyMac so kudos to him.
Hmm... Maybe one would want to use a camera to localize the beacon? In that case would want to use very low frequency, <<60Hz...
Thank you! There are indeed some valuable hints in your thread!
Thanks! Yes, a camera is a possibility. I actually have done some experiments. https://forums.parallax.com/discussion/175897/thoughts-about-robot-navigation-using-blinking-beacons-and-camera-s#latest
In my opinion P2 is not really matching to cameras. Not enough RAM. Also I had problems controlling the camera when brightness was low. The camera then switched to a very slow frame rate.
Idea now is to use the onboard possibilities of the microcontroller with minimal external hardware.
Made a funny first measurement. Wanted to know if a LDR D=5mm might work here. LDRs are slow but I don't know how slow.
So I varied frequency and up to 500Hz it gives reasonable signal.
Sender is a bright yellow 5mm LED.
At a distance of 7cm I can see the 500Hz at some 3mV.rms in the FFT of my scope.
This seems to work better than my selfmade fototransistor which is a BC107 with a metal cap that was sawn off many years ago. :-)
Perhaps I should try a small solar cell as area seems to help?
Tried a solar cell 50x50mm. Frequency response is OK at 10kHz. Tried L=2.2mH, C=100nF and 1k in parallel to the Cell. If I pull out the C, there is no difference. (?) The 10kHz peak can just be seen at a distance of 25cm in the FFT of my scope, which also says Vpp=1.28mV. (Only!) Most of that is coming from one of my monitors.
Aha: Switched over from the yellow LED to an IR LED. Diode is driven via R300 at 3V3. ~7mA.
No changement at the receiver but now the peak is much clearer against noise and can still be seen at perhaps 1m. My desktop is getting too small . :-) The solar cell can obviously use the IR light very well. If I rotate the solar panel, the signal get's weaker, so the idea to pan the receiver seems possible.
It seems to start to make sense to build a selective preamp and to try real Goertzel. The hope is, that averaging over a longer time improves S/N ratio.