I'm building a laser projector using the arms of a hard disk and I want to measure it's angular position using light (see here or here for background).
I've now tried connecting a photodiode using both these schemes. When I read the output I'm constantly getting a strong 50Hz disturbance. I cannot lower (or at least not significantly lower) R1 or R2, because for my application this is the right sensitivity-region.
I've tried adding all kinds of capacitors on different locations. Either it doesn't help or it filters my signal too much: I need readings with a higher frequency than 50 Hz (I'm guessing 300 Hz). Eventually, I want the laser-projector to be able to be connected to normal mains, so I expect that I can't easily get rid of this 50Hz. I've used an Arduino Uno and a Due, connected by USB and I've grounded my PC.
Now my question is: does anyone have any ideas how to solve or circumvent this? Ideas I have:
Use a good/clean power supply. When I connect both the USB cable (I need this for now) together with the power-in connector on the Arduino board, which power supply will it then use?
Use a light-to-frequency converter, for example the TSL235R. I understand that I can connect these without any additional components. Will this cost much computation power?
Let me know if you need any additional information.
Obviously, you are picking up AC line noise. With a photodiode that can get in through room lighting, capacitive coupling through the air, as well as exposed wiring and poorly filtered power supplies.
Work through the possibilities, eliminating them one by one. Put the circuitry (avoid breadboards) in a sealed grounded metal box, use batteries for a power supply, eliminate light leaks and so on.
jremington:
Work through the possibilities, eliminating them one by one. Put the circuitry (avoid breadboards) in a sealed grounded metal box, use batteries for a power supply, eliminate light leaks and so on.
I use these TSL devices a lot, visible and IR, and don't get any 50-Hz interference.
Contrary to any advice about not needing any external components, even in the most basic application you need a load resistor and decoupling capacitor on the supply, on the legs. See the data sheet.
As others have said, make sure no stray light. Fluorescents, mains powered LED replacement lamps (GU10 etc.) can cause havoc. The only time I got fooled was monitoring an LED on a gas boiler - looked like straight DC until I put a scope on it. A bit of lazy design by the manufacturer had it running on cut-down mains AC at exactly 50-Hz.
Even on long unshielded (Ground, Vcc and output) cable runs, a 0.1uF capacitor on the legs is all that's needed, assuming a reasonably clean supply like the Arduino 5-V is being used.
Paul_KD7HB:
That's exactly why ALL laser measuring devices use a pulse modulated laser so it's can be identified from all the stray light signals.
Paul
This actually solved the issue completely --> at 5 kHz, I now do an analogRead with the LED off, than I turn it on and wait for a few microseconds (to let the LED get to full brightness) and than I do another analogRead and subtract these two values from each other. The result is a very clean signal, with noise well below what I wanted.