I have an IR LED emitter and receiver. The emitter is always on so the receiver notices when something blocks the emitters beam. I have this connected to my ESP32 board and it reads about 300 (units of some kind) when the light beam is unbroken, and 0 when it is broken, as it should.
If I block the beam slowly it works fine, if I block the beam with say, the speed of a bullet, the microcontroller can't catch the 0 being passed to it.
I think this is because the microcontroller 8Mhz GPIO read speed is too slow. What I'm looking to do is make it so the 0 stays 0 for longer once the receiver notices a blocked beam. After extending the 0 signal for around 1 second, I want it to return to business as usual until the next 0 comes along.
What kind of simple circuit design do this?

If I block the beam slowly it works fine, if I block the beam with say, the speed of a bullet, the microcontroller can't catch the 0 being passed to it.
I think this is because the microcontroller 8Mhz GPIO read speed is too slow. What I'm looking to do is make it so the 0 stays 0 for longer once the receiver notices a blocked beam. After extending the 0 signal for around 1 second, I want it to return to business as usual until the next 0 comes along.
What kind of simple circuit design do this?



