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.

Reading resistive sensors

Status
Not open for further replies.

Eclipsed

New Member
I've been working on a gauge that reads resistive(10-180 ohms) pressure sensors through a PIC.I've done this 2 ways so far.

1- Charged a cap, then discharged the cap through the sensor, timing the transition.RC timing I believe it's called.
2- Used the sensor as part of a voltage divider, read through an ADC channel.

Both of these ways worked well and were easy enough to implement, but looking at aftermarket gauges of this type, I noticed some use #1 and some use #2.My questions is, which way is the most accurate and consistant?
 
Neither is neccessarily more accurate than the other, that depends on your ADC, tempco, etc. On the other hand, method 1 does not require an ADC, you can simply use a digital IO bit to measure the time constant and determine the value of R. The ADC method can probably sample the sensor faster, but that may not matter.
 
I agree with crust, it doesn't really make much difference for many purposes. It's usually down to cost considerations, a PIC with an A2D is probably going to cost more - so using the capacitor charging method saves money. BTW, this is also the way the joystick port on your PC works!.

One disadvantage is that the capacitor method isn't linear, but you can correct that in the software if you need to. Depending on the values used, you may be able to get higher resolution from the capacitor method.
 
The most recent gauge I looked at, appears to use the RC method(unless the 10uf caps on each sensor input are added for some kind of filtering?), but it also used a PIC 16f871, which has an ADC.This led me to believe the RC way was somehow better.Two other questions, I'm not calibrating the gauge, or even testing actual pressures, I'm using a pre-calculated lookup table.Since the lookup values are done mathematically, and not experimentally, which method would be the best way to go? And finally, these piezoresistive sensors(I believe they are called, they have a ground and an output, no power) are they generally linear?
 
Eclipsed said:
The most recent gauge I looked at, appears to use the RC method(unless the 10uf caps on each sensor input are added for some kind of filtering?), but it also used a PIC 16f871, which has an ADC.This led me to believe the RC way was somehow better.Two other questions, I'm not calibrating the gauge, or even testing actual pressures, I'm using a pre-calculated lookup table.Since the lookup values are done mathematically, and not experimentally, which method would be the best way to go? And finally, these piezoresistive sensors(I believe they are called, they have a ground and an output, no power) are they generally linear?

With the 16F871 version, I would look to see which pin the sensor goes to, as you say the 10uF caps may be for filtering - if the sensor feeds an A2D pin, it could well be using A2D. As you already know, to use the A2D requires an extra resistor to make a potential divider, again this would give a clue.

Neither method is 'better', they both have advantages though. The capacitor method is cheaper, and measures resistance - to measure voltage would require more external circuitry. The A2D method is far faster, it's linear, measures voltage, but requires extra circuitry (only one resistor) to measure resistance. For your purposes, neither would seem to give much of an advantage over the other - but, personally, if the A2D was already there, I'd probably use it.

What range of resistance change does the sensor provide?.

I've no idea if the sensors are linear or not, if you could find a manufacturers datasheet it should tell you - or you could try measuring it, if you can find some reliable way to accurately feed it.
 
They are common VDO pressure senders, 0-150 psi = 10-180 ohms.I only got a quick glance at the above said gauge, but the sensor inputs were connected to I/O pins that can be configured as analog inputs, each sensor input had a resistor and a 10uf cap.I'm now assuming the cap is a filter, and it reads the resistance via a voltage divider and not RC timing.Should I have a cap in my voltage divider circuit?
 
Eclipsed said:
They are common VDO pressure senders, 0-150 psi = 10-180 ohms.I only got a quick glance at the above said gauge, but the sensor inputs were connected to I/O pins that can be configured as analog inputs, each sensor input had a resistor and a 10uf cap.I'm now assuming the cap is a filter, and it reads the resistance via a voltage divider and not RC timing.Should I have a cap in my voltage divider circuit?

I just noticed, you also mentioned 10-180 ohms in your first post :lol:

I would include a capacitor, a car is a very noisy environment, you need to take precautions to keep noise away from the electronics.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top