I've been prototyping with a Reflectance Sensor to be used in different applications with a micro-controller, mostly as a speed sensor and as an encoder. My goal is to try to use it as best as I can at high speeds which at the end of the day is just reading Reflectance -or Not- for pulses that last a very short amount of time. Below is the Schematic in question - this design is not originally mine but seems to be the go-to design for many hobbyist IR Sensors.
First I tried working with just the circuit enclosed inside the Reflective Object Sensor area which produces an analog signal, but at high speeds the signal doesn't rise fast enough, with that in mind, leaving out the Comparator (LM393) or any solution that helps mitigate this problem is probably out of the question.
- Low Speed test: to my surprise, I noticed that the LED helps in the design
. It helps the signal rise faster or makes it look more like a square wave -which is a good thing as I'm reading the output using an external interrupt. I noticed when the LED (D1) is replaced with any diode, the output looks even better (on the downside it adds a ringing to the base voltage). Could someone explain why a Diode seems to help here? and why, as I increase the value of R5, the Base voltage tends to be lower? -again another good thing for the design seems. In this test I tried different diodes 1N5227B Zenner Diode1N5227B Zenner Diode, 1N914 Signal Diode1N914 Signal Diode and 1N4007 all with the same results.
- High Speed test: It seems that the current value of C3 is too high and affects the output when the sensor is reading reflectance at high-speeds (the pulses don't rise high or fast enough for the micro-controller to read High). In that case, what could be a better trade off? - adding the Diode and/or lowering C3 to lets say 0.01µF.
- Keeping the LED: adding the Diode seems to be a good approach -or maybe there is a different way-. What could be the best way of keeping the LED also? -It's a great way to have a visual feedback when the sensor is doing it's job and also to help calibrating the sensor.
If you made it this far, thank you for reading. Please let me know what you think in the comments.
Luis