Help with a simple board...

Hi

i’m having trouble thinking my way out of a cardboard box this morning.

I have a simple circuit involving a photo interrupter that, on paper, should result in a logical high output when the beam is broken and logical low otherwise.

Here’s the circuit

Applying 5v I am seeing the transistor side opening and closing rather than staying open. The intent is that the output is pulled up inside a uController but at the moment it’s floating.

any thoughts on what’s going on?

Circuit is missing.

that's odd. it's ok on my screen.

i have edited the original post to attach the schematic as a file

45mA opto LED current and 20mA indicator LED current.
Is that really needed, got lots of ambient light?
Both currents are close to the absolute max of IR LED and transistor.

Try changing the 82ohm resistor to 220 ohm (~17mA), and the indicator LED resistor to 1k.
Leo..

thanks Leo

there is a potential for a lot of ambient light, and more importantly the design is for a probe that will be used attached to both 5v and 3v boards . Hence I'm testing at these levels.

do you consider that the resistor choices could be causing the transistor to pulse? how would that happen?

Maybe the MCU’s min/max logic levels are not met, maybe the IR LED or transistor are failing.
Only you can measure that.
Note that a LED is a zener diode below it’s Vf, so it can’t pull the collector fully up.
Must use internal pull up on the pin, or add a 10k resistor from collector to VCC.
Do increase that 150ohm resistor to 1k. Demanding 20mA from an opto transistor is just silly.
Leo…

Maybe the MCU's min/max logic levels are not met, maybe the IR LED or transistor are failing.
Only you can measure that.

thanks - but at the moment I'm measuring on a multimeter. I can see the continuity pulsing and the LED not illuminating in either state. So at the moment there's no point in connecting to an MCU.

the forward voltage is 1.4v or thereabouts. I'm feeding it 5v over the 82 Ohm resistor. But it does seem to me that the likely answer is that the IRLED itself is somehow pulsing and shutting off the gate.

I'd like to understand the why changing the resistances should stop the pulsing though. This is such a simple circuit that I would have expected it to function as intended across a wide range of passive resistance values.