Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
LinkBack Thread Tools Display Modes
Old 15th January 2007, 10:00 PM   (permalink)
Default Differential Amplifier

Hi, I am very inexperienced with electronics and need some help working out the components I need. I am measuring temperature with an LM335 and an Atmega16. The Atmega16 has differential inputs on it's ADC but I want more accuracy and have been told I need a differential amplifier.

I want to convert voltage in the range 2.4815-3.4815V into 0.0-5.0V. Please correct me if I am wrong. I think if I make a 2.4815V reference for the (-)input and connect the LM335 to the (+) input and have a gain of 5x I should get the correct output. But I have no idea what component to use for the differential amplifier. I have been looking through parts lists on Digi-Key and other sites and am lost in all the specs of them.
Chris_P is offline  
Old 15th January 2007, 10:18 PM   (permalink)
Default

I'm not sure if a differential amplifier would do very much unless you are transmitting over long cables since the LM335 is a single-ended output, and the output of the diff amp is also single-ended (this means you can't make fully effective use of the differential ADC inputs).

You can use an op-amp.
http://www.phys.ualberta.ca/~gingric...s/node110.html

Temperature changes very slowly (has a very slow bandwidth) so almost any op-amp will do.

I don't know of a differential amplifier that also outputs differential signals, but it probably exists (and is a lot more complicated). Maybe someone else knows.

How much accuracy do you need? Is it a temperature sensor after all and temperature changes slowly (you can oversample by a serious amount to increase accuracy) and most applications only require temperature to be so accurate (most of us don't need the temperature much more accurate than to within a couple degrees). The main reason for differential as far as most temperature sensors go is noise over very long cables.

What I'm saying is just gauge how much accuracy you really need (scaling up the output to fit your ADC range is a good way to increase virtual accuracy and is so simple when it's all single-ended that it is a given), but take a step back and think if you really need all this differential stuff. The datasheet says the sensor is accurate to within 1 degree at room temperature and 3 degrees over the full range. All the effort to increase the accuracy might be pointless if you can already achieve this accuracy without all the hardware- it might make it even worse since the more components in the signal path, the more offset and gain errors get introduced.

Last edited by dknguyen; 15th January 2007 at 10:30 PM.
dknguyen is offline  
Old 15th January 2007, 10:25 PM   (permalink)
Thumbs up

hi there i think this site will help you in many ways, it describes many ways of using the lm335. check it out here http://www.national.com/ds/LM/LM135.pdf.
good luck , craigmezza
CRAIGMEZZA is offline  
Old 15th January 2007, 10:27 PM   (permalink)
Default

Quote:
Originally Posted by dknguyen
You can use an op-amp.
http://www.phys.ualberta.ca/~gingric...s/node110.html

However, I'm not sure if a differential amplifier would do very much unless you are transmitting over long cables since the LM335 is a single-ended output, and the output of the diff amp is also single-ended (this means you can't make fully effective use of the differential ADC inputs).

I don't know of a differential amplifier that also outputs differential signals, but it probably exists. Maybe someone else knows.

How much accuracy do you need? Is it a temperature sensor after all and temperature changes slowly (you can oversample by a serious amount to increase accuracy) and most applications only require temperature to be so accurate. The main reason for differential as far as most temperature sensors go is noise over very long cables.
Sorry, I didn't explain properly, by using a differential amplifier I will no longer need to use the differential inputs on the Atmega16. I can just use a single ADC input and get the full 10 bit accuracy I want. My accuracy drops to 8 bit when I use it's built in differential inputs.

The LM335 outputs a voltage varying by 10mv per DegreeK. It has a range of -40C (outputs 2.3315V) to 100C (outputs 3.7315V). I want to measure from -25C to +75C (2.4815-3.4815V) meaning the output will vary by 1.0V. I want to amplify this to 5V. I can then split this into 1024 pieces with the 10bit ADC giving me a resolution of 0.1C. Hope this explains it a bit better.
Chris_P is offline  
Old 15th January 2007, 11:05 PM   (permalink)
Default

I have just posted the basic circuit of a diff amp that could be adapted to do what you want, see
http://www.electro-tech-online.com/g...ng-help-2.html
__________________
Len
ljcox is offline  
Old 16th January 2007, 03:40 AM   (permalink)
Default

Quote:
Originally Posted by ljcox
I have just posted the basic circuit of a diff amp that could be adapted to do what you want, see
http://www.electro-tech-online.com/g...ng-help-2.html
Thanks Len, I had a read of the datasheet on the LM319 and noticed it says it has a minimum gain of 8 and max of 40. For what I want I need a gain of 5. Is that possible modifying the circuit you designed? To be honest, I would have no idea how to modify it to suit my needs.
Chris_P is offline  
Old 16th January 2007, 11:09 AM   (permalink)
Default

Check out the attached picture. The same exact concept as what you want to do. You want to provide the first op amp with your offset voltage(2.4815V) via the pot. This makes it so that when your temp sensor is at the lowest reading (when it outputs 2.4815V) the output of the first op amp will be zero. Then you set the second op amp to a gain of five to get the scale that you want. So that will give you an output from 0-5V with an input of 2.4815-3.4815V. The gain of the second op amp in the original circuit is set at 10, so you will need to change the 27k resistor so that it is a gain of 5.
The photo came from the Nuts and Volts web site and the article was in the August 2006 issue in the Q&A section.

Vgain = (1+ RB/RA) Where RA is the 3k resistor and RB is the 27K resistor.
Attached Images
File Type: jpg 24.jpg (35.2 KB, 52 views)
Attached Files
File Type: pdf LMC662.pdf (483.9 KB, 16 views)

Last edited by Sig239; 16th January 2007 at 11:13 AM.
Sig239 is offline  
Old 16th January 2007, 08:45 PM   (permalink)
Default

Quote:
Originally Posted by Sig239
Check out the attached picture. The same exact concept as what you want to do. You want to provide the first op amp with your offset voltage(2.4815V) via the pot. This makes it so that when your temp sensor is at the lowest reading (when it outputs 2.4815V) the output of the first op amp will be zero. Then you set the second op amp to a gain of five to get the scale that you want. So that will give you an output from 0-5V with an input of 2.4815-3.4815V. The gain of the second op amp in the original circuit is set at 10, so you will need to change the 27k resistor so that it is a gain of 5.
The photo came from the Nuts and Volts web site and the article was in the August 2006 issue in the Q&A section.

Vgain = (1+ RB/RA) Where RA is the 3k resistor and RB is the 27K resistor.
Thanks Sig239, exactly what I needed
Chris_P is offline  
Old 17th January 2007, 04:24 AM   (permalink)
Default

Quote:
Originally Posted by Sig239
Check out the attached picture. The same exact concept as what you want to do. You want to provide the first op amp with your offset voltage(2.4815V) via the pot. This makes it so that when your temp sensor is at the lowest reading (when it outputs 2.4815V) the output of the first op amp will be zero. Then you set the second op amp to a gain of five to get the scale that you want. So that will give you an output from 0-5V with an input of 2.4815-3.4815V. The gain of the second op amp in the original circuit is set at 10, so you will need to change the 27k resistor so that it is a gain of 5.
The photo came from the Nuts and Volts web site and the article was in the August 2006 issue in the Q&A section.

Vgain = (1+ RB/RA) Where RA is the 3k resistor and RB is the 27K resistor.
Thanks, the LMC662 is exaclty what I've been looking for.
__________________
Len
ljcox is offline  
Old 17th January 2007, 07:09 AM   (permalink)
Default

Hello Chris and Len
No problem, Nuts and Volts is a pretty cool mag, and it just so happens that I was rereading that issue and that article a few hours before I read your post. Ironic huh? Anyways good luck and let me know how you make out.
Sig239 is offline  
Old 19th January 2007, 06:30 AM   (permalink)
Default

I'm not having much luck here. I couldn't get any LMC662's so I have been playing with some LM358's. Is there any reason why these would not suit this application? I haven't connected the circuit to a microcontroller yet, I have just been playing with a volt meter to see the results.

First off I copied the diagram Sig239 posted. In place of the MPX4115A I have a 10K pot. Everything else is exactly the same. I have both pots set to 4.0V out to begin with and the output from the LM358 is reading 3.42V where it should be near 0. And when I wind up the pot in place of the sensor the reading does not change until it reaches 4.7V and the output from the LM358 jumps to 3.59V. No gradual increase just 1 jump.

Secondly I tried the first 2 circuits on the page that dknguyen linked to. I didn't get results anything like what I expected.

Can anyone help me work through this problem?

PS: I am using a 5V regulated supply to power the circuit.

Last edited by Chris_P; 19th January 2007 at 06:36 AM.
Chris_P is offline  
Old 19th January 2007, 08:16 AM   (permalink)
Default

Chris,
The problem is that the LM358 is not a "rail to rail" op amp as the LMC 662 is.

If you look at the data sheet for the LM358, The maximum output for a 5 Volt supply is typically 3.5 Volt. This is why you can't make it go higher than 3.4 V.

Also, if you look at Figure 1 in the data sheet (I have the Motorola DS) you will notice that for a 5 Volt supply, the input voltage range is only 4 Volt.

So you have 2 options:-

1. Use a higher supply voltage or

2. Find another rail to rail op amp.

Also, I don't see why you need 2 op amps. If you want a gain of 5, then you can do it with one amp.

Remove the second op amp and change the feedback resistor from 10k to 50k (ie. two 100k resistors in parallel or a 51k) and replace the 10k between the + input and gnd with a 50k.

This will make the differential gain = 5.
__________________
Len

Last edited by ljcox; 19th January 2007 at 08:29 AM.
ljcox is offline  
Old 19th January 2007, 10:13 AM   (permalink)
Default

TJ Byers seems to think that adding the gain in with the first op-amp may introduce "non-linear distortion", but he does mention that it can be done. But if your going to use a dual op amp IC then your really only adding two resistors, sounds like cheap insurance to me.
Sig239 is offline  
Old 19th January 2007, 08:25 PM   (permalink)
Default

Quote:
Originally Posted by ljcox
Chris,
The problem is that the LM358 is not a "rail to rail" op amp as the LMC 662 is.

If you look at the data sheet for the LM358, The maximum output for a 5 Volt supply is typically 3.5 Volt. This is why you can't make it go higher than 3.4 V.

Also, if you look at Figure 1 in the data sheet (I have the Motorola DS) you will notice that for a 5 Volt supply, the input voltage range is only 4 Volt.

So you have 2 options:-

1. Use a higher supply voltage or

2. Find another rail to rail op amp.

Also, I don't see why you need 2 op amps. If you want a gain of 5, then you can do it with one amp.

Remove the second op amp and change the feedback resistor from 10k to 50k (ie. two 100k resistors in parallel or a 51k) and replace the 10k between the + input and gnd with a 50k.

This will make the differential gain = 5.
Thanks Len, to make things simple I think I will get some LMC662's. So from what you are saying will this circuit work? I am now aiming for an input range of 2.532 to 3.532V. To set the 2.532V I have swapped out the pot for a voltage divider. Pretty sure the values I have used give me this. My schematic is not the best, sorry. I am learning as I go

Are R4 and R6 necessary? Thanks for all the help.
Chris_P is offline  
Old 19th January 2007, 09:20 PM   (permalink)
Default

R4 is necessary in order to make it a diff amp with minimal thermal drift.

R6 could be eliminated by choosing R1, R2 & R3 such that their Thevenin resistance is = 10k.

This leads to my next point. The circuit posted by Sig239 overlooked the need to make the Thevenin resistances on the + and - inputs equal. And I missed it also.

So I've drawn the attachment to do this and to use a 100k feedback resistor rather than 50k as I suggested.

The reason the Thevenin resistances on the + and - inputs must be equal is to minimise the thermal drift that would otherwise occur due to changes in the input bias currents when the IC temperature changes. However, this is less of an issue if the op amp has FET inputs.
Attached Images
File Type: gif Diff amp.gif (30.2 KB, 26 views)
__________________
Len
ljcox is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
Differential Amplifier for Thermosistor didbird Electronic Projects Design/Ideas/Reviews 19 8th January 2007 03:05 AM
200 watts Amplifier help sunny152 Electronic Projects Design/Ideas/Reviews 13 19th December 2006 10:29 PM
Differential amplifier brentonw2004 General Electronics Chat 2 2nd February 2004 07:18 AM
MOS differential amplifier design zsabre81 Electronic Projects Design/Ideas/Reviews 3 17th November 2003 01:53 AM
2 stage differential amplifier mozikluv General Electronics Chat 1 12th September 2003 03:43 PM



All times are GMT. The time now is 08:35 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker