LM358 Op amp problem

simulate this circuit – Schematic created using CircuitLab

simulate this circuit

Right now my configuration of my circuit is this: https://i.stack.imgur.com/F1Pey.jpg

The only difference is that now I have 5V being fed into the +Ve rail of the op-amp and 3.3V fed into everywhere else. This is within the specifications of the LM358 minimum voltage for the single supply rail (3V) and the offset difference from rail to input (+Ve - 1.5V or 3.5V in this case) as shown here: http://www.ti.com/lit/ds/symlink/lm158-n.pdf

The circuit works and by adjusting the light of the opto-interruptor I can see a change of 3.35V (When light beam is unobstructed) to 1.53 (When it is), although I would like to have a larger difference so that the the system is more sensitive to changes in light levels.

So I decide to try to use this YwRobot 545043 breadboard power supply and measured 14.63V across it's positive and negative terminal. I have the +Ve (Pin 8) being fed from this, and all grounded nodes and other sections of the circuit going into the - pin of the power supply so I have one single common ground. In the circuit above all instances of 3.3V is replaced with 5V (so 5V being fed into the opto-interruptor).

However now the op amp will not output and there is no change due to the light level. Is there something I'm missing?

• You will get more answers to this if you draw out the schematic using the inline schematic editor according these guidelines electronics.stackexchange.com/questions/28251/… Aug 12, 2015 at 17:11
• oh my gosh, please don't put 3.3V rail on the bottom.. Draw your schematic properly using the built-in circuit layout on this website like @StefanDzisiewski-Smith suggested, and do the receiving side of the phototransistor with the correct orientation. You describe two different situations, try to draw the schematic for the initial working circuit, and then show a second schematic for the second set of conditions where it does not work. Make sure you show appropriate voltages and also check your physical wiring and ensure common grounding etc. Aug 12, 2015 at 17:30
• I actually didn't realize there was an inline designer so doing that now although it doesn't have specific parts, is there a way to design specific parts? Also what is wrong with 3.3V? Aug 12, 2015 at 17:37
• Added in the inline schematic, the other situation is basically replace V3 in the op amp rail with a 14.63V source and V1 & V2 with a 5V source. I couldn't find an optoisolater in circuit lab so the diodes output (The light) is the 'gate' of the NPN transistor. Aug 12, 2015 at 17:50
• You really have no current limiting resistor in series with the optocoupler's LED? Aug 12, 2015 at 17:51

That circuit cannot work- the LM358 has about 40nA of current flowing out of the input pins and you have a phototransistor and resistor to +5, so there is no way it gets pulled down.

Try grounding one end of R2. leave the other end connected to the op-amp, and connecting the phototransistor emitter to the non-inverting input.

• I've added a bleed resistor of 20k so R6 is brought to ground, and the output is already connected to the non-inverting input. However circuit one configuration works while circuit 2 does not. Is this some sort of saturation issue? Aug 12, 2015 at 23:46
• You mean "bleed resistor of 20k so R2 is brought to ground" correct? R6 doesn't need a bleed resistor. When it's not working what are the voltages on the + and - terminals and the output of the op-amp? The LM358 is a PNP input stage where the bias currents flow out of the terminals so neither circuit you show should work without a pull-down on the emitter or + input of the amplifier. Aug 13, 2015 at 16:51

What are you trying to achieve?

Do you want a analog output according to the light level of the LED? Then you can not use opto-coupler for converting.

If you want just a digital output (which give a good voltage output difference for LED-on & LED-off ) then use a comparator instead of an amplifier.

• I do indeed want a linear analog output and not a digital ON/OFF sort of deal. Why is an opto-interruptor not able to do this? Aug 13, 2015 at 6:35
• it is designed to give digital output. As the name says ("interrupt") interrupt something Aug 13, 2015 at 7:19