Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Linearising a Wheatstone Bridge??

  • 28-09-2013 5:10pm
    #1
    Registered Users, Registered Users 2 Posts: 1,164 ✭✭✭


    I am building a basic temperature measurement system using a thermistor in a wheatstone bridge. I would like to take this output through a microprocessor and produce a reading on an LCD eventually but have an issue I am a bit confused about with the bridge first...

    I understand that the change in resistance of the thermistor is non linear and also that the output from the bridge is not linear! What do I need to do to linearise this output?

    Do I need to connect a parallel resistor to the thermistor? Or does the bridge and thermistor together produce a linearised output as the curves increase/decrease exponentially in opposite directions? You might see what I mean by the graphs in the image below which I have plotted from some quick reading I took!

    Any help greatly appreciated....Hope its in the right forum! :confused:

    graphs.jpg


Comments

  • Registered Users, Registered Users 2 Posts: 2,738 ✭✭✭mawk


    Thermistors are always screwy. Why not use a pt100 instead? They change linearly


  • Moderators, Home & Garden Moderators, Technology & Internet Moderators, Regional East Moderators Posts: 12,641 Mod ✭✭✭✭2011


    mawk wrote: »
    Thermistors are always screwy. Why not use a pt100 instead? They change linearly

    +1.
    Thermistors are not normally used to measure temperature, they are used to established when a temperature has exceeded a certain point. They are commonly embedded in motor windings and connected to a relay in the motor starter that will cause the motor to stop if the windings get too hot. They generally have a negative temperature coefficient (as your 2nd graph illustrates).

    Whereas a PT100 has a positive temperature coefficient, were you to graph it you would see that the relationship between temperature and resistance is much more linear. This makes the maths much easier (y=mx+c).

    BTW a PT100 has a resistance of 100Ω at 0°C.

    This may come in handy.

    At work we use them to measure from as low as -100 to + 350°C.


  • Registered Users, Registered Users 2 Posts: 1,164 ✭✭✭rob w


    Thanks lads,

    Ill see if i can get my hands on a pt100 maybe!

    But if i do use the thermistor, would the bridge/thermistor combination produce a linear output or am i way off?


  • Moderators, Home & Garden Moderators, Technology & Internet Moderators, Regional East Moderators Posts: 12,641 Mod ✭✭✭✭2011


    rob w wrote: »
    But if i do use the thermistor, would the bridge/thermistor combination produce a linear output or am i way off?

    As your graph shows the relationship between temperature and resistance is far from linear. This will make it very difficult to get a linear output. This is why thermistors are not normally used in this way.

    Recently I installed a level transmitter (guided wave radar) on a horizontal cylindrical tank that has dished ends. Clearly the relationship between the hight of the liquid and the volume of the liquid is non linear. In fact it would be "S" shaped when graphed. However I had the transmitter programmed to provide an analog output (4 to 20mA) that is directly proportional to the volume of the contents of the tank. My point is it is possible, just not always that easily done.


  • Registered Users, Registered Users 2 Posts: 5,401 ✭✭✭DublinDilbert


    2011 wrote: »
    +1.
    Thermistors are not normally used to measure temperature, they are used to established when a temperature has exceeded a certain point. They are commonly embedded in motor windings and connected to a relay in the motor starter that will cause the motor to stop if the windings get too hot. They generally have a negative temperature coefficient (as your 2nd graph illustrates).

    .

    Thermistors are used everywhere to measure temperature. People who do automation tend not to like them cause of the non linear curve so use a pt100.

    Ntc thermistors are normally used to measure temperature in cars, domestic appliances etc, cause they are nice and cheap. Ptc thermistors are sometimes used for sensing, but more often for poly fuses (re-settable fuse) or to control the likes of the degaussing coil on crts.

    Back to the original question, you need an instrumentation amp after your bridge so you don't unbalance it. Then there's two ways to linearise it in software, using a formula or a look up table.

    For the formula you can use the simplified stien-hearth equation or for lut just calculate it in excel every 5 degrees, then do a linear interpolation in between these points.


  • Advertisement
  • Moderators, Home & Garden Moderators, Technology & Internet Moderators, Regional East Moderators Posts: 12,641 Mod ✭✭✭✭2011


    Excellent post Dilbert

    Thermistors are used everywhere to measure temperature.


    Interesting.
    As above, I have only seen this used to generate a digital signal (to see when a temperature threshold is crossed).

    People who do automation tend not to like them cause of the non linear curve so use a pt100.


    Fair enough, I see your point.
    I am always trying to provide a nice linear signal back to the PLC.

    Ntc thermistors are normally used to measure temperature in cars, domestic appliances etc, cause they are nice and cheap.

    Agreed they are cheaper than PT100s, but PT100s are still relatively cheap as well as being very robust/reliable with a larger temperature range. I would have thought that the main advantage of thermistors would have their quicker response time.

    Back to the original question, you need an instrumentation amp after your bridge so you don't unbalance it. Then there's two ways to linearise it in software, using a formula or a look up table.


    For the formula you can use the simplified stien-hearth equation or for lut just calculate it in excel every 5 degrees, then do a linear interpolation in between these points.

    Very good.


    This is worth reading: http://www.enercorp.com/temp/Thermistors_comparision.html


  • Registered Users, Registered Users 2 Posts: 5,401 ✭✭✭DublinDilbert


    Yea in a PLC i wouldn't fancy attempting a stien-heart equation, unless using something like C to program it.

    There are some situations where a PT100 would be much better than an NTC, for example if your trying to measure temperatures over a wide range. An NTC termistor is gives a pretty good response when the temperatures of interest are over a narrow enough range, for example room temperature measurement. Or even in a car where your trying to measure up to say 120C.

    BTW you don't need to use a wheatstone bridge with a thermistor, it will work, but is over-kill. A simple 10K pull up resistor to 5V normally works perfect. As this looks like a homework assignment / college project so won't post a solution, but feel free to ask any questions.

    One equation you can use is shown here:- https://dl.dropboxusercontent.com/u/1326656/Steinhard_hard_equation.PNG

    You will need to sample the signal with an ADC and convert the integer value (typically 0->1023) back to a resistance value. This resistance value can be used in the above equation.

    The other place you should be careful when writing the code (assuming your writting in C), is to using make sure divisions are done correctly, done as floating point rather than integer. for example in C "some_value/25" is very different from "some_value/25.0f"


  • Registered Users, Registered Users 2 Posts: 1,164 ✭✭✭rob w


    Thanks for the replies lads. It is a project for college, but am a bit of a loss with the design of it, kind of in over my head at the moment as Ive moved into a new course. Not looking for solutions but just some advice/tips!
    Back to the original question, you need an instrumentation amp after your bridge so you don't unbalance it.

    If i go down the simple voltage divider route, i think it might be easier. Then I can linearise the output using a parrallel resistor and if i understand correctly, shouldnt need an amplifier? Would i be right in assuming that?

    Thanks for the info so far, been reading up on the links posted along with tons of other stuff. But think im reading too much and just confusing myself!


  • Registered Users, Registered Users 2 Posts: 5,401 ✭✭✭DublinDilbert


    rob w wrote: »
    Thanks for the replies lads. It is a project for college, but am a bit of a loss with the design of it, kind of in over my head at the moment as Ive moved into a new course. Not looking for solutions but just some advice/tips!



    If i go down the simple voltage divider route, i think it might be easier. Then I can linearise the output using a parrallel resistor and if i understand correctly, shouldnt need an amplifier? Would i be right in assuming that?

    Thanks for the info so far, been reading up on the links posted along with tons of other stuff. But think im reading too much and just confusing myself!


    Yes your correct, if you use a simple 10K pull up resistor, you won't need an amplifier or anything like that. Just use a pull up resistor to the CPU 5V, provided your not running it long distance etc... If your going to run it long distances its not a good idea to run the CPU 5V's, as you might generate EMI or if it gets shorted to something you'll fry your CPU. So in that case just use a separate 5V PSU, but obviously connect the grounds together.

    Your car just uses 10K pull up resistors on the thermistors.


    If you want to do some experimentation just do it in microsoft excel.

    Put in a few temperatures (eg -10, 0, 10, 20, 25, 30C ) and accompanying resistance values. Then set up a column and calculate the voltage you will get with a 10K pull up resistor.

    Then just do an Analogue voltage to Digital number calculation in excel and implement the resistive divider calcs. You'll even be able to implement the equation I've given above.

    If you can't do it in on paper or ms-excel, you'll have a real head ache moving to the actual system. Also if you have a table of values calculated in ms-excel it will help you when you have to debug some C-code.


  • Registered Users, Registered Users 2 Posts: 5,401 ✭✭✭DublinDilbert


    Oh and if they want an accurate system maybe choose a 0.1% 10K pull-up resistor rather than the normal 5%. You can also use your ms-excel sheet to look at what effect the pull-up resistor will have on your calculations.

    When i worked in the car industry we used to use excel all the time to figure out these calcs, system accuracy etc, its a very handy tool.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,164 ✭✭✭rob w


    Been busy working away on this now for a few days...

    I used the steinhart-hart equation and have figured out the values of resistors which will provide the most linear output possible.

    Have come up with a graph along the lines of this, (roughly)

    graph.jpg

    Seems a lot more linear now anyway. More accuracy would be nice but to get it up and running first and tweak it from there is more important right now!

    Now to figure out the signal processing side of things to produce the output on the LCD! :o


  • Moderators, Society & Culture Moderators Posts: 12,853 Mod ✭✭✭✭riffmongous


    Hi, I was just wondering what year of your course you are doing this project for? I recently did something very similar myself and was wondering what sort of level this is considered?


  • Registered Users, Registered Users 2 Posts: 1,164 ✭✭✭rob w


    Hi, I was just wondering what year of your course you are doing this project for? I recently did something very similar myself and was wondering what sort of level this is considered?

    It was for a level 8 Honours Degree course. Just a small project though....four week timeline!


  • Registered Users, Registered Users 2 Posts: 1,164 ✭✭✭rob w


    Just want to say thanks again for the help here lads. Figured it all out in the end. Here's a pic of the system working with the LCD just earlier on today!

    IMG_20131010_181337.jpg

    (Don't mind the wiring from the processor to LCD, its a bit messy but just had it hooked up to get it working first....tidying comes next ;))

    It was an interesting little project to work on alright and learned a good deal from it that I had no clue about a month ago! The system also ended up being surprisingly accurate compared to actual measurements, which I was delighted with! As you guys had posted before, it would definitely make life easier using a PT100 over the thermistor, but that was part of the challenge I suppose.....there was also some issues to deal with regarding the op-amp loading the bridge once it was connected up, which I wasn't aware would happen (I think a instrumentation amp would avoid this next time!) but sussed it all out!

    Thanks again for the advice!


  • Moderators, Society & Culture Moderators Posts: 12,853 Mod ✭✭✭✭riffmongous


    rob w wrote: »
    It was for a level 8 Honours Degree course. Just a small project though....four week timeline!

    And what semester is it in if you dont mind me asking?

    It looks pretty cool, I turned my one into a datalogger :rolleyes:


  • Registered Users, Registered Users 2 Posts: 1,164 ✭✭✭rob w


    And what semester is it in if you dont mind me asking?

    It looks pretty cool, I turned my one into a datalogger :rolleyes:

    Sorry, its year 3 semester 1!


  • Registered Users, Registered Users 2 Posts: 1 arj.511


    Hi there rob,
    I'm doing a similar project. Could you help me? I just need information on how you calculated the resistances to get a linear graph. Which values did you use? Also how did you set up the Temp display? Basically the whole lot! :D
    Thanks!!


Advertisement