15-11-2012, 07:55 PM
The op-amp doesn't behave predictably with both inputs near to the negative supply rail. Either supply rail, indeed. I've mentioned this more than once - pay attention at the back 
To prove the point, you could temporarily use a battery to make pin 4 of the op-amp negative with respect to 0V, and you'll probably find that it behaves itself. If you try this, do make sure the maximum supply range of the op-amp isn't exceed.
Op-amps vary enormously in this regard - some do work close to one of the rails, some work at both, but most don't - as always, study the datasheet. Some op-amps (e.g. the TL06x/07x/08x series) go one stage worse - as the two inputs get close to the positive (IIRC) rail, they swap around, causing all sorts of weird problems!
A comparator is essentially an op-amp with very poor properties as an amplifier, although you could choose to make one work as an amplifier if you really wanted to. Often, they have an open-collector output stage, thus making it easy to interface with logic circuits. Check the datasheet carefully, as an open-collector output won't light the LED in your circuit - in which case you need to swap the two inputs around, and wire the LED (and series resistor) between output and pin 7.
Good idea to add the current meter. And while you're at it, add a volt meter if you don't already have one. Or, if you're feeling adventurous, make a single meter switchable.
Perhaps needless to say, but the current meter will probably need an external shunt resistance, and this shunt resistance can be shared with the LED circuit. Even if the meter has an internal shunt, this can be shared. No need to put the two in series - that just wastes volts...
All the best,
Mark

To prove the point, you could temporarily use a battery to make pin 4 of the op-amp negative with respect to 0V, and you'll probably find that it behaves itself. If you try this, do make sure the maximum supply range of the op-amp isn't exceed.
Op-amps vary enormously in this regard - some do work close to one of the rails, some work at both, but most don't - as always, study the datasheet. Some op-amps (e.g. the TL06x/07x/08x series) go one stage worse - as the two inputs get close to the positive (IIRC) rail, they swap around, causing all sorts of weird problems!
A comparator is essentially an op-amp with very poor properties as an amplifier, although you could choose to make one work as an amplifier if you really wanted to. Often, they have an open-collector output stage, thus making it easy to interface with logic circuits. Check the datasheet carefully, as an open-collector output won't light the LED in your circuit - in which case you need to swap the two inputs around, and wire the LED (and series resistor) between output and pin 7.
Good idea to add the current meter. And while you're at it, add a volt meter if you don't already have one. Or, if you're feeling adventurous, make a single meter switchable.
Perhaps needless to say, but the current meter will probably need an external shunt resistance, and this shunt resistance can be shared with the LED circuit. Even if the meter has an internal shunt, this can be shared. No need to put the two in series - that just wastes volts...
All the best,
Mark







