Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Hardware Offset Adjustment

Status
Not open for further replies.

StudentSA

Member
Good Day,

I have a simple temperature measuring system using a LM35 temperature sensor and a PIC16F690 micro controller interfaced to a 3 digit 7 segment led display.

I currently have the senor connected to a Analog pin (via a opamp), using A2D to sample. I was wondering how I could implement a simple offset adjustment in between the sensor and the pic?

I know that one could interface a trim-pot onto another Analog channel and use software correction, but I am wondering if there exists a simple hardware solution?

Thanks for the assistance,
StudentSA
 
hi,
If you already have an OPA between the LM35 and the PIC's adc input, it should be easy to add an offset adjust pot.

Please post your circuit.
 
Last edited:
Sorry, I do not have my schematics at the moment, but simply put I have a 5V supply that powers the LM35 sensor, the output is taken into a non-inverting opamp (rail-rail) configured with a gain of 8 this output is then fed into the uC.

I know I can adjust the gain at the opamp, but I want to be able to add a linear offset to correct the temperature reading.
 
Sorry, I do not have my schematics at the moment, but simply put I have a 5V supply that powers the LM35 sensor, the output is taken into a non-inverting opamp (rail-rail) configured with a gain of 8 this output is then fed into the uC.

I know I can adjust the gain at the opamp, but I want to be able to add a linear offset to correct the temperature reading.

OK,
I should be able to suggest a modification when I see your circuit, I will follow this thread.
 
Hi, Apologies for the delay, This is my schematic of my temperature sensor. I did not know where to find the LM35 in LTspice so I put a signal generator.

Also note that R2 in my circuit is made up of a 6k8Ω + 1kΩ var resistor.

TempratureCircuit.JPG

Kind Regards,
 
Here's the circuit with an offset pot to add a negative offset voltage to the output. The pot is buffered by another op amp so the pot resistance does not affect the gain setting of the output op amp circuit.

Temp Sensor Offset.jpg

Edit: Depending upon the offset required you may want to add a resistor in series between the +5V and the pot to reduce the pot adjustment sensitivity and improve the pot resolution.
 
Last edited:
hi SA,
If the 5V supply is not well regulated, the circuit showing the offset OPA connected to the +5V as a reference, could give offset errors.

I would suggest a TL431 Vref, derived from the +5V line, if you want a stable offset.

EDIT:
added zip, join the yahoo LTspice user group.
 

Attachments

  • lm35.zip
    1.1 KB · Views: 120
Last edited:
Thanks, This solution is perfect as the opamp IC I am using is a dual opamp. I will implement this later and provide feedback.
@crutschow, I need to offset small errors, so maybe +-0.5V.

The 5V line is simply regulated with a 7805 and filter capacitor, the load is very small so I assume the voltage will remain pretty much constant. I will also join the LTSpice group as suggested. :D

Your assistance is much appreciated.

Regards,
StudentSA
 
Last edited:
Hi,
I implemented the above solution, and I see now how it works by offsetting the voltage level at the 1k resistor. Anyhow this does not work for me because:
1 - The rail to rail opamp is actually rail+0.1 to rail-0.1 :D ... so I have to have a constant offset
2 - The input signal from the LM35 is only be used in the range of 0-60degrees thus my input signal is 0 - 600mV
3 - On a 600mV signal you can see that the 100mV offset from the rail-rail opamp is quite significant.
4 - lastly I need to somehow add and subtract from the input signal around +-20mV (2degrees) for sufficient offset adjustment

Any further suggestions are welcome and I will certainly consider a completely new design.

Kind Regards,
StudentSA
 
hi SA,
Which rail2rail OPA are you using.?
 
1 - The rail to rail opamp is actually rail+0.1 to rail-0.1 :D ... so I have to have a constant offset
2 - The input signal from the LM35 is only be used in the range of 0-60degrees thus my input signal is 0 - 600mV
3 - On a 600mV signal you can see that the 100mV offset from the rail-rail opamp is quite significant.
4 - lastly I need to somehow add and subtract from the input signal around +-20mV (2degrees) for sufficient offset adjustment
1 - That is not an offset voltage, it is just the minimum and maximum range of the op amp.

3 - Again, that 100mV or (10mV as the case may be) is not an offset.

4 - So you are you trying to adjust the offset of the output to remove the offset error of the LM35? Why not just remove that using software? Enter the offset value into memory and subtract that value from all the readings.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top