IR Light Barrier with a microcontroller

Hi! I did a quick search and did not find anything so I hope this is not going to be annoying!

I have the IR Light Barrier MK120. I need to put this in a doorway to detect when people are walking by. Instead of producing a sound, I would like for it to generate a 3.3V or 5V signal to my microcontroller so I can tell when someone is in the path or not.

Thanks! Hopefully that wasnt too confusing to understand

Try this:

Pin 8 of IC1----|resistor 10 K|--------±----------------> to digital input of microcontroller
|

/\ zenerdiode 5.1 V

|
|
Ground

Thanks, I will definitely give that a shot. Also, I saw that an build in LED also lights up. I am assuming one side of this might also go to 5 volts!

Something has gone wrong with my drawing! The zener is not directly on pin 8 of IC1 but at the connection between the other end of the resistor and the microcontroller!

So:

Pin 8 — resistor ---------from here: to microcontroller and zener to the ground.

thanks for the reply! I got the circuit built and it was working great. I tested pin 8 with a dmm, and I was getting a constant voltage whether the beam was broken or not.

Not normal: because than the buzzer would sound continuously also…