4 ms·
You can use this to make a cheap "toilet-paper-ometer" by sending a 1KHz square wave to one LED and using a second LED's "detector" output narrowband filtered f
by zunzun 8y ago
You can use this to make a cheap "toilet-paper-ometer" by sending a 1KHz square wave to one LED and using a second LED's "detector" output narrowband filtered for 1KHz. The 1KHz signale makes the "meter" insensitive to ambient light, and the device is easily calibrated by measuring "detector" amplitude with different layers and curve fitting the amplitude vs. sheet count. Nice science fair project for a Raspberry Pi.
- barbegal 8y agoHow do you implement the 1kHz filter? A 1kHz square wave is easily generated in software but surely you have to implement the filter using an op-amp and some passives?
- wallacoloo 8y agoGiven it's a raspberry pi, you could easily implement the 1 kHz bandpass filter in software, by sampling at a higher frequency and then implementing a discrete-time filter. Just about any microcontroller with an ADC could do that, actually (edit: actually, the raspberry pi doesn't have an ADC - I guess the author is doing that with a discrete ADC?).
- barbegal 8y agoThe problem is that most micro-controller ADCs use sample and hold with a capacitor so they require some time to stabilise. From the source code of other projects this seems to be on the order of 1 to 5ms which effectively turns it into a low pass filter.