Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: sdelica on August 18, 2010, 01:15:35 PM

Title: Sharp IR range sensor and op amp
Post by: sdelica on August 18, 2010, 01:15:35 PM
Hello,

I was reading this link  http://www.societyofrobots.com/schematics_voltamp.shtml (http://www.societyofrobots.com/schematics_voltamp.shtml) about amplifying the output voltage for sensors. I am using an Arduino microcontroller that has a 10-bit analog to digital converter. This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. This yields a resolution between readings of: 5 volts / 1024 units or, .0049 volts (4.9 mV) per unit. However the sharp IR sensor only outputs between 0.4 and 2.5V. Thus I introduced an op amp circuit for a gain of 2 (using Ra=Rb=1kohms).
The issue: When I connect the components and run the Smoothing/Calibration program http://www.arduino.cc/en/Tutorial/Smoothing (http://www.arduino.cc/en/Tutorial/Smoothing) the serial monitor shows readings of 800 which is about 3.92V. Using the multimeter, I measure this voltage from the output of the op amp (741, 8-pin DIL). I am using 5V and ground power source.
Please help me troubleshoot this.

Without the op amp the sensor and Smoothing program works fine, but I am assuming the distance are inaccurate since the max voltage is 2.5V thus the resolution of analogRead() is inaccurate.
Title: Re: Sharp IR range sensor and op amp
Post by: Razor Concepts on August 18, 2010, 05:51:41 PM
We need more information.
What op amp are you using? What is the schematic, or is it exactly the one from the tutorial?
Title: Re: Sharp IR range sensor and op amp
Post by: waltr on August 18, 2010, 08:36:12 PM
The op-amp is powered from 5V, positive rail, and you are expecting a 2.5V input to be gained by exactly 2 to +5V. However, all op-amps can not have their outputs as high as the positive rail, although some can get very close. I'll bet that with an input voltage of 1.5V you do get a 2X gain and an output of 3.0V.

Temporally, try powering the op-amp at 8 to 10V. The output should now be the 5V you expect. Just don't over-voltage the input to your processor.

Look at the Output Voltage Swing specs in the op-amp's data sheet.

The LM741 is a very old op-amp. There are many newer much better op-amps now available.
Title: Re: Sharp IR range sensor and op amp
Post by: Soeren on August 20, 2010, 06:06:11 AM
Hi,

You may be better of (precision-vise) just leaving things as they are - after all, you'll get 430 values and I doubt that you'd need half of them.

With whatever circuit you introduce, you WILL introduce errors and hence, your precision will suffer.