I am using this circuit to measure the voltage of a small solar panel - around 3 or 4 V max (so instead of the photodiode consider there is a solar panel). That means Vin = -3 V. When I first built it, I didn't think about the fact that the op-amp is single supply and what effects that might have. Today, I was thinking about it and after reading some things, came to the conclusion that a single supply op-amp should not accept voltages outside its rail-to-rail range. I have 2 questions:

  1. Why is the anode of the panel connected to ground and not the other way around? (I based this circuit on one I saw online)

  2. Why does this circuit work? The output is exactly what I expected it to be in the first place (-0.65*Vin), but it shouldn't, because it's a single supply op-amp, right?



simulate this circuit – Schematic created using CircuitLab


2 Answers 2


The current produced by the photodiode in the presence of light is a reverse current not a forward current. This means current flows from R1 thru D1 to ground.

This means that to keep both input pins of the op-amp at the same voltage (e.g. 0V), the op-amp output has to rise above 0V to feed current into R2 thus keeping -Vin and +Vin at precisely the same potential\$^1\$. As more light hits the photodiode the op-amp output has to rise higher.

If the photodiode were the other way round photo-current would be traveling into R2 and this means the op-amp output has to provide negative voltage and, of course it can do this when it has a negative supply.

I'm assuming you are using rail-to-rail op-amps in this analysis.

Same problem with solar cells - you need the left hand end of R1 to be pulled negative by the solar cell for this to work.

\$^1\$ If you don't understand why -Vin = +Vin then this is another question and is unrelated to photo-diodes or solar cells.

  • \$\begingroup\$ Thanks for your answer, it was very useful. I guess I was a bit confused because of what I read somewhere else. So to clarify: when someone says that a single supply op-amp can't take negative inputs (if supply is positive), it means the actual input at -Vin, and not an input before R1, for example? \$\endgroup\$
    – user43606
    Commented May 28, 2014 at 11:08
  • \$\begingroup\$ correct. Only the actual inputs need to be "inside" the power rails but there are exceptions. \$\endgroup\$
    – Andy aka
    Commented May 28, 2014 at 11:18
  • \$\begingroup\$ What exceptions do you have in mind, by the way? \$\endgroup\$
    – Nicolas D
    Commented May 29, 2014 at 7:56
  • 1
    \$\begingroup\$ @NicolasD some op-amps will allow inputs to be lower than the most negative rail or higher than the most positive rail. It's usually by only a few hundred milli volts. Also, some op-amps don't like the two inputs to be driven apart by more than 0.7V because of inbuilt protection diodes. Always read the small print!! \$\endgroup\$
    – Andy aka
    Commented May 29, 2014 at 8:00
  1. So a negative voltage will be presented to the input of the opamp.

  2. Since the circuit is an inverting amplifier, its gain is defined as:

     -Av = ---- = -0.65,

and with a negative input, then, the output voltage will be:

      Vout = Vin * Av = -3V * -0.65 = 1.95V

This is possible because the opamp's output will slew in whatever direction it has to in order to force the voltage on the inverting (-) input to be the same as the voltage on the non-inverting (+) input.

With the + input at zero volts, then, the voltage divider feeding the - input looks like this:

     -3V Vin
    [2M0] R1
      +--V2--> 0V TO OPAMP - IN
    [1M3] R2

and, since the current into the opamp's - input will be miniscule, we can determine the value of Vout by first finding the current through R1 with Ohm's law:

         Vin - V2    -3V
    I = ---------- = ----- = -1.5 microamperes   
           R1        2MR

or, current into V1.

Similarly, since the current in a series circuit is everywhere equal, we'll have 1.5 microamperes out of Vout, through R1 and R2 and into Vin, and R2 will drop:

    Vout = I R2 = 1.5 microamperes * 1.3 megohms = 1.95 volts, which is exactly what you got.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.