I'm not really an electronics guy, I'll cobble together a circuit here and there every couple of years.
I need to take an IR beam break and use it to toggle an LED (on when the beam is broken, off otherwise).
I've done similar things before, using a microprocessor to sample the sensor diode. Because I need this to be battery driven and light, I decided to go with a seemingly simpler solution, using an op-amp comparator. Initially, I was quite pleased with the results of the comparator, as seen on an oscilloscope. While I had to fiddle with the microprocessor to get it to detect changes in the beambreak, this was quite clear with a nice 2V signal.
It seems the op-amp can't drive the LED directly, so I added a MOSFET.
Then the op-amp couldn't drive the gate of the MOSFET (it's what I had laying around, I've ordered some with lower Vgs requirements). I don't know where I got the idea to try a pull-up resistor, but that's not helping.
The resistors are ones I happened to have around with the prototyping breadboard and weren't chosen for any particular reason. The LED/photodiode model numbers are things I would have to track down, they are all IR (two different types of emitters).
I think I'm not far off from making this work, but I could use a little advice. I've tried a handful of minor variations of this, and tried running it through some simulators, with no luck. The diagram represents the circuit at the current moment.
I want to keep power draw on the battery as low as possible, but we are willing to change them regularly if necessary. The battery needs to power both sides of the beam break, any electronics to process the signal, and the output LED.