NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Sensors, Actuators, and Robotics » 2-Wire Automotive Sensors

October 13, 2011
by tonysq
tonysq's Avatar

I'm taking off from the temp sensor project for an automotive project. The problem I am having is that many of the temperature sensors in a vehicle are a 2-wire type that has a sensor signal and sensor ground. Sensors such as air temp, coolant temp, oil temp and fuel level all have these type of sensors. They read as a variable voltage with a scan tool.

I'm thinking that I have to use a pull-up resistor like this:

2-wire diagram

Am I on the right track?

Thanks, Chris Squier

October 14, 2011
by Ralphxyz
Ralphxyz's Avatar

Yeah I believe you are correct, or at least for a Dallas One Wire bus:

The Dallas 1-Wire network is physically implemented as an open drain master device connected to one or more open drain slaves.[3] A single pull-up resistor is common to all devices and acts to pull the bus up to 3 or 5 volts, and may provide power to the slave devices. Communication occurs when a master or slave asserts the bus low—that is, connects the pull up resistor to ground through its output MOSFET. Specific 1-Wire driver and bridge chips are also available. Data rates of 16.3 kbit/s can be achieved. There is also an overdrive mode which speeds up the communication by a factor of 10.

The quote is from WikiPedia

I got some DOW tempsensors that NOTER was using for a project, I have not done anything with them yet.

Ralph

October 14, 2011
by tonysq
tonysq's Avatar

I'm a real novice so I'll have to study what you posted but I'm confused because I'm not talking about data communication. I'm talking about reading an analog variable resistence using the same wiring setup as the vehicle manufacturer.

I visualize these sensors as a "volume" potentiometer where you're just using 2 of the posts...

What confuses me is that they use only a sensor ground (lowref) and a sensor "signal" that carries >0 and <+5 volts for the ECU to read. There is no seperate 5v feed in these 2-wire sensors.

Thanks,

Chris

October 14, 2011
by Ralphxyz
Ralphxyz's Avatar

Yeah, read up on the DOW (Dallas One Wire).

There is no seperate 5v feed in these 2-wire sensors.

Again from the wiki article:

One distinctive feature of the bus is the possibility to use only two wires: data and ground. To accomplish this, 1-wire devices include an 800 pF capacitor to store charge, and power the device during periods where the data line is used for data.

I believe the sensors, like for temperature, are actually digital IC devices not analog potentiometer!

So there actually is a data communications. At least for the DOW bus that is how they work.

Now posible for the automotive system you are looking at, it is an analog system, in which case you would obviously not need pullup resistors.

Ralph

October 14, 2011
by 6ofhalfdozen
6ofhalfdozen's Avatar

Any chance you have the data sheets?? That might clear up if they are 0-5V analogs or DOW type like Ralph suggestions... (I have worked with some odd-ball pressure trandsucers that are 4-20mA output with only two wires as well, so you never quite know unless the datasheet says....)

October 14, 2011
by tonysq
tonysq's Avatar

Nope, these are definately analog. I am using a simple 5K pot from radio shack to measure the upper and lower limits with the scan tool, it's alot cleaner than trying to mess with a used fuel pump module.

I set the pot to read "full" on the gauge, read the voltage over OBDII with the scan tool then measure the resistance on the pot. I can do the same thing with the coolant temp.

October 14, 2011
by Ralphxyz
Ralphxyz's Avatar

Are you sure the OBDII is directly reading the device?

I thought OBDII reads the car's computer which reads the various sensors?

Or is there an analog mode on the scan tool?

Also some sophisticated electronics systems will multipurpose a wire and depending on what is being seen on a wire behaves in different manners so when your scantool "sees" a pot (constant voltage) on the wire it behaves one way and when it sees a data stream on the same wire behaves differently.

Anyway if it is a voltage you are needing to monitor than a pullup resistor should not be necessary, to answer your question.

Ralph

October 14, 2011
by tonysq
tonysq's Avatar

I'm sorry, I didn't mean to confuse the issue more.

The ECU is reading the sensors. The scan tool uses OBDII to get the info from the ECU.

So, PC0 to a resistor to ground will give me a voltage value? Experiment time tonight.

Thanks

October 14, 2011
by tonysq
tonysq's Avatar

I think this is what I'm trying to go for...

http://ikalogic.com/proj_dig_thermo.php

I kept wanting to say thermistor but didn't think I had the right term.

Chris

October 14, 2011
by Ralphxyz
Ralphxyz's Avatar

Ok now:

So, PC0 to a resistor to ground will give me a voltage value?

No!

The ADC (PC0) is expecting 0 to AREF (with Nerdkit standard setup @5 volt).

Now as to the "thermistor".

A thermistor is a variable by temperature resistor.

To use a thermistor you would stick one leg into a + voltage source and the other leg to PC0.

Ralph

October 14, 2011
by tonysq
tonysq's Avatar

Thanks Ralph.

The problem is that in the automotive world they stick one leg to a common ground and the other (measured signal) leg actually has +11.72v DC supplied by the ECU. I just took a reading with the meter and that's what it says. I reversed the +/- leads and the common wire to all the sensors is definitely the ground side. That why I think I'm looking for a voltage divider setup.

I had the mis-understanding that it was 5v so I'm glad I never hooked it up to the breadboard.... sheesh. Measure twice, cut once.

Chris

October 14, 2011
by tonysq
tonysq's Avatar

Ok, Here are the results of my work this evening.

I set the potentiometer attached to the ECU, read the R with a meter and the V reported by the ECU to the scan tool. I then recorded readings through a full resistance range to a table.

I set the V to Vout and the R to Rb in the formula:

Vout = (Rb * Vin) / (Ra + Rb)

When I solved for Ra:

Ra = ((Rb * Vin) / Vout) - Rb

The Ra values for the voltage divider resistor were all over the place from 500 ohms to 950 ohms...

After banging my head against the math wall for a couple hours I ended up deciding I was just going to set up my voltage divider circuit the way I wanted to so that I could get a useful reading. I went back to the original formula, set the upper and lower Rb values from the actual sensor and used the WAG method to set Ra at 500ohms. I started out with 5v Vin and generated a list of expected Vout's. Just for kicks I set the Vin to 12v and my Vouts almost EXACTLY matched what I saw on the scanner. Close enough that rounding by the ECU could account for the mismatch.

So here's my dilemma. If I stick with Vin = 5v then I get Vout from 0.2v to 1.5v. If I set Vin = 12v then I get Vout from 0.5v to 3.66v which gives me twice the resolution.

BUT, if the Rb goes to an open then the full 12v will be sent to the microcontroller, right? Is that bad news for the chip? What's the best way to handle that?

Thanks a bunch for the help

October 18, 2011
by BobaMosfet
BobaMosfet's Avatar

tonysq-

If the sensor acts like a variable resistor, then being in series, you should be able to tap off of either sensor lead, go through a 1.8K Ohm resistor (Dissipating 27.2mW), which is to drop the voltage level to not more than 5V at about 3.8mA, max, right into your ADC input pin.

Engines generate a lot of noise; you might also have to put a ferrite bead on it, and a small bypass capacitor (.1uF) to help smooth out the signal.

BM

Post a Reply

Please log in to post a reply.

Did you know that you can control 120 LEDs with just 17 microcontroller pins? Learn more...