korn0055 / bean-bag-toss

1 stars 0 forks source link

ambient light sensor #13

Open korn0055 opened 9 years ago

korn0055 commented 9 years ago

Implement A/D routines to read ambient level from photo resistor and adjust "off" brightness level

korn0055 commented 9 years ago

There is a lot of noise (>100mV p-p) on the photo resistor with just one emitter and the small LED strip running. From testing indoors with a 100k series resistor, it looks like the threshold will need to be a couple hundred millivolts, so some filtering will be needed. The plan is to use a first-order IIR filter: y[0] = (1-alpha)x[0] + alpha \ y[-1] with alpha close to unity in order to filter the noise. A warm-up time will be required before the filter output can be used to make any decisions.

NothingButGunpowder commented 9 years ago

You could also try stacking a cap on top of the existing resistor to filter the noise. Is the noise synchronous with the other devices pulsing or could it be noise from overhead lights being picked up at 60 Hz?