What's going on with my op amp?

I was reading about how to build a light seeking robot, and it mentions how you can use LEDs to detect light, and an op amp to amplify the difference between two of them. So I'd thought I'd check it out.

Long story short, it works fine before I connect the op amp. I measure the voltage from the LEDs and see how it changes with a change in light. But when I hook up the op amp, the voltage lowers, and doesn't change at all with the light value.

Long story long: Here's the working circuit.

5V
|
<

1K resistor
<

|
+----------+----------+
| |
LED2 LED3
| |
Analog Analog
Pin 2 Pin 3

This circuit works (values for Pin 2 & 3 are +/- 10)
Pin2 Pin3 Pin5 (floating)
Light On 763 743 681-801
Light Off 807 807 791-814

2nd circuit:
5V
|
<

1K resistor
<

|
+----------+----------+
| |
LED2 LED3
| |
+-------+ +-------+
| | | |
Analog | Analog |
Pin 2 | Pin 3 |
| |
Op-Amp Op-Amp
Pin 2 Pin 3

Op-Amp Pin 1 - connected to Op-Amp Pin 8 to give max gain
Op-Amp Pin 2 - connected as above (Input voltage#1)
Op-Amp Pin 3 - connected as above (Input voltage#2)
Op-Amp Pin 4 - connected to ground
Op-Amp Pin 5 - connected to Arduino analog pin 5 (output voltage)
Op-Amp Pin 6 - connected to +5V
Op-Amp Pin 7 - not connected (bypass)
Op-Amp Pin 8 - connected to Op-Amp Pin 1
If it matters, the Op-amp is LM386

This circuit doesn't work (values for Pin 2 & 3 are +/- 10)
Pin2 Pin3 Pin5 (op-amp output)
Light On 593 592 140
Light Off 593 592 140

Why does connecting the op-amp cause the LEDs to stop detecting light?

Are the LEDs forward or reverse biased?

I think they're forward biased. If I connect a ground where analog pin 2 and 3 are, they light up.

I turned the LEDs around.
With no op-amp, light on, the values jumped to 1023. Lights off, they dropped to ~400.

With the op-amp in, light on, pin 2 seems to jump 0-26. Not a real consistant value. Pin 3 is 0-5. Pin 5 goes from 139 to 896 (which I assume is from pin 2 jumping around)

Op-amp in, light off, gives the same results as the light on.

Well, I'm too sleepy to figure it out right now. The op amp is kind of a strange one.

Without a true schematic it's a little painful to try and work out what is what in your circuit. One thing however, a LM386 is not a general purpose op amp but rather a audio amplifier chip. It would seem strange to use this chip for your application, is there a reason you selected it?

http://www.national.com/ds/LM/LM386.pdf

Lefty

Semantics...

Calling the LM386 an OP AMP is misleading.

The LM386 is just an AMP designed to drive a coil speaker or similar low impedance inductive load. It has a few things in common with an op-amp but any standard operational amplifier has an "external" FEEDBACK LOOP for controlling gain. The LM386 does not exactly have this since you do not really have full control over the feedback loop.

If you wanted to drive small MOTORS from your sensors... this might be your chip of choice.

If you want to feed inputs to the arduino... you might want to look at an LM324 or maybe one of the RAIL TO RAIL op amps like: TS272