Hi all,
Sorry if this is a vague question, but here goes:
I am building a toy nightlight with software controlled hysteresis, so I need to get changes in light into the MCU via the ADC. To this end, I am using a cheap light dependent resistor (LDR) but haven't settled on a good circuit. Could someone recommend the best approach?
My design goals are:
- output must be between 0 and 5 V for the Atmega328P ADC
- output should be close to linear
- not crazy complicated or expensive
My ideas so far are:
- use a simple voltage divider circuit. I find it hard to get nice output from this, but maybe it's just not enough analysis on my part (I just fiddled with the breadboard so far).
- use a simple wheatstone bridge, somehow scaling and biasing to fit into 0-5V. I like that I can adjust the null setting with a pot, but I now have negative values that need to get biased for the uC.
- use a complex wheatstone bridge with a linearizer circuit and an amplifier. An in-amp has an offset adjustment (cool), but this might be overkill and it seems hard.
- do something completely different (a photodiode? a photo transistor?)
Really it is just for my practice with uC programming the ADC, but I still want to do something cool and elegant if possible.
Please share your ideas and experience! Thanks!