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.

Simple - Input resistor question

Status
Not open for further replies.

Spadez

New Member
This is a really basic question but Id like to get my head around it. Im looking at the comparator on the PIC, using a resistor to set the voltage into one side, and then a thermistor on the other side which produces a different voltage to be compared with.

This is the layout of the input resistor:

**broken link removed**

I dont really understand why you just cant do this:

**broken link removed**

The PIC is connected to 0V. Is it simply done to limit the amount of voltage into the PIC?

James
 
Last edited:
To get a variable voltage from the thermistor into the PIC you need a voltage divider, which requires two resistors. If you connect the thermistor directly to the PIC, then the voltage divider consists of the thermistor resistance and the PIC input resistance. Since the PIC input resistance is many megohms (and is not controlled), the PIC input voltage would just stay very close to 5V for any typical value of thermistor resistance.
 
Last edited:
Basic knowledge about voltage dividers is to be found here.
 
Hello there,


One of the simplest methods for measuring temperature with a PIC (or just a trip point temperature) is to use a resistor from the +5v supply to the thermistor and connect the other end of the thermistor to ground. The junction is then fed to an AD input pin and the voltage measured with the PIC. The voltage is then converted into temperature with a short formula that uses the curve of the thermistor within the PIC code. The result is an estimate of the temperature of the thermistor.
The curve uses at least two constants A and B and the curve itself is basically the same for any thermistor. The nice thing is if your temperature is limited to some smaller range then the formula is a lot simpler.
If you only have to detect a trip point then you dont even have to do that. All you have to do is calculate the voltage (or just measure it) when the thermistor is at your set point temperature and then in code tell the PIC to detect that voltage. For example, with a thermistor rated for 10K ohms at 25 deg C, if you use a 10K ohm resistor from +5 to the thermistor and you want to detect 25 deg C all you have to do is look for 2.5v as that will be the correct voltage for 25 deg C.
If i remember right, for a single temperature like this you get the best sensitivity when the resistor is the same value as the thermistor at the given temperature. For example, if that same thermistor is 20k ohms at the required temperature then use a 20k ohm resistor instead of 10k. You will then still be looking to detect 2.5v. It's that simple.
Calibration would be as simple as heating (or cooling) the thermistor to the required temperature and either adjusting the 20k ohm resistor or adjust the detect voltage in code slightly.
 
Last edited:
Hi,


I think you meant to say 2.5v, 5v, and 0.4545v instead of 5v, 5v, and 0.5v, right?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top