arduino to read car sensors

03-02-2013, 09:46 AM

ok after allot of search, i have decided that i will go with arduino , to read my car speed/rpm etc... the problem is, that my dashboard is completely ruined, so my only way would be to read the signals from the car sensors directly. i know that most of them wilgive 0-12v signal, and arduino reads only up to 5, but that can be solved. could anyone point me to a direction, at what signals do the sensors produce?? (i'm driving an audi 80 , b4 1990 , and i am corently interested, only in rpm,speed,temp,fuel sensors!!)

Your best bet is to get a shop manual for your car and start from there. It should show you the voltage ranges and such that you are looking at. You will need that information before you can continue. You may be able to pull the information by finding out the sensors your car takes and look at the specifications for the sensors but really you need the information that the dealer would be using. If your speedo is cable driven then you will not have speed information available easily. If your car does not monitor the RPM you will have to add a sensor for this depending on if your car runs off a coil that has an RPM output.

You might be better off adding an after market PCM of a modern variety that will allow you to access this stuff easily and still tie into your factory stuff. You may have to add some sensors that you would have had to anyhow and you likely will get better performance if you know how to tune.

Comment

I dono how would you interpret data without specks of what you are getting (you will need to be good with formula building or dig out pecks) bit to reduce signal in half you need voltage divider (2 identical resistors would work) you can reduce voltage with any proportion respectively if you change values of resistors
to make it easier i calculated resistor values for you. Of course if you need something more efficient there are ICs for that... but i think analog works perfectly fine

Comment

yea thanks allot! well my guess is, that it wont be that hard to map the signlas. you just have to do a real time, scan with a voltometer or ohm-meter, and that is all. we will now soon enough. hardest part for me seems how to make a disent speedometer app

Comment

Speedometer app is easy, i can build one probably in less then an hour as i believe i still have automotive UI components installed on my dev machine. Basically if you have speedometer UI you just feed data to it say every 1 sec, and you get that data from ardrino serial port.

Comment

This is why you need to find the factory specs on what each sensor does which can be had with a dealer manual. This car should be relatively easy to get a manual for but you might have to look around to find it. As I also said, you may be able to bypass the manual by getting the specs on the sensor its self. You may not have a simple voltage return or it may not be linear or any of a sort of "might be". Not to mention you need to check the range of the input of your A/D convertors as well. MANY A/D convertors only accept 0-40 MILIVOLT inputs as well since most real world (Non-automotive) sensors output 0-40 to output to a strip chart recorder.

The dealer specs and the sensor specs should show you the pinouts of the sensor, what each pin does and the range it is looking for. Trying to reverse engineer this stuff is not the best route and may end up causing sensor, automotive or computer damage when you guess wrong.

If your speedo is a cable driven one you may be better served by using a GPS sensor. Otherwise you likely need to use a magnetic based sensor that doesn't connect directly to the drive train and sense the speed of the drive shaft. As I mentioned before the RPM MAY be simple if you have a coil output which many cars did have.

Comment

so, today i started mapping the sensors signals. so far:
RPM is an AC voltage between 0.10 V and (max?) 0.29V (with crankshaft sensor!!)
Temp,An ohm resistor, where the resistance DROPS when temp rises: max(dunno, cause car was hot arledy) ~90celcius 87.8 ohm
Fuel lvl : simple resistance as well.
AS for the speed now... i know that that i am looking at the correct sensor, but i cant seem to find what it gives... it has a constant 13v , BUT no AC, and no current change... i think that it might be digital signal, cause if u strip down my instruments cluster, you will see that, the speedo, has as input the same cables that i look at, BUT the way that it drives the needle is with DC... also between is a micro-chip, wich i suppose, convertes digita to analog signal...
Any ideas where to look? or, what sould i do to map its signal??

Comment

Most pulse sensors are open collector types aka OC - ie, they are switched to GND else not (and hence floating so some pull-up resistor is required to pull them high).

That tacho is a classic example. A traditional (Kettering) ignition system is a set of pints that are ether closed to GND (which charges the IgCoil) else open. The point of opening is when the IgCoil sparks the splugs.
Electronic ignitions are no different except they use a transistor etc instead of points. (There are a few exceptions including CDI, but often their "sensors" are still OC - eg, Hall Effect & Optical modules.)

Speedos are often similar. I know some Audi speedo sensors are diff mounted, hence I presume a Hall Effect module. But others are reed switches - maybe in or on the speedometer if a mechanical speedo cable goes to it.
Nissans (N13 etc) have a pulse driver/transducer in place of the normal speedo-cable outlet at the gearbox. (They too have an OC output.)

One big difference with a tacho circuit and others is that if from the IgCoil, the circuit must be protected from the HV spikes produced by the primary of the IgCoil (typically 200V or higher). But that is usually a part of normal input protection anyhow - eg, thru a resistor to the input with 2 clamping didoes either side that are reverse biased to each (Arduino) power rail (+V & GND), else a Zener to GND diode which clamps to the Zenor voltage.

You may find that AC readings are useless. They don't give info on voltage ranges (because they are an average reading assuming a continuous sinewave voltage) and though an AC voltage might indicate a pule or frequency type of signal (as with a tacho), they might merely be showing noise on the line.
And if the speedo "transducer" is a reed switch, it is merely closing and opening and has no voltage unless there is some voltage across it. But DC continuity or the resistance range should "pulse" as the speed-sensed wheels are rotated (front wheels for some Audis; rear wheels for others). But make sure there is no voltage to the circuit if using resistance and continuity ranges - that's a universal rule for multimeters.
And OC outputs require a pull-up resistor to show voltage. (Typically 10k or 1k.)
Yours sounds like an OC speedo sensor (Hall Effect?) and you are measuring the pull-up resistor's +ve voltage and not detecting the pull downs. Alas one of the limitations of DMMs.
Analog meters may be better, though a CRO is usually required to see the full waveform, but that is usually not required anyhow - just knowing the sensor type and its reference voltage is sufficient (eg, GND for OC).

As to resistive sensors, you need to find their maximum resistance and then chose another resistor so the Arduino analog inputs have a good voltage range to work with.
EG - your temp sensor (~90R @ 90C) may be 200R (200 Ohms) when cold, hence you might use a 47R resistor fro the grounded temp sensor to +5V. The Arduino then sees 200/(200+47) x 5V = 4.0486V when "cold", and 87.8/(87.8+47) x 5V = 3.2567V when ~90C.
Also need to check resistor power consumption. EG - the current at ~90C is 5V/(87.8+47) = 5V/134.8R = .037A. Hence power dissipated (I x I x R) = (0.037 x 0.037)R = .00137 x 47 = 0.06W, hence a 1/8W resistor is more than adequate (else 1/4W or 1/2W etc).

Comment

some update : i have dicided that i will use gps for speed.
but as for the rpm. oldspark i dont really get what you are saying could you try it simplier, cause it seems i am bit noob ?
i have found out that the car uses hall effect sensor, witch indeed gives ground or not. but, how could i read that from an external source?

Comment

dude. thank you SO much. i would have never thougt that, when it was not GND, it would be 12v. but it turns it is!! so yes, just a voltage divider and its good to go i will post the final results when i am done!

Comment

As long as you realise (and I think you do) that the diode is reverse biased - it only conducts if the (input) voltage goes higher than the Arduino's onboard +V, hence not blowing the Arduino inputs.
If the diode were the other way, it would be supplying Arduino +V to the sensor (Hall effect sensor) which could blow it, though the series resistor would limit current (and in this case with say 1k or higher, NOT blow the sensor).
It is not a voltage divider, though that could be used instead, but even then the diode could be added for protection.

FYI stuff....
Reverse diodes to both power rails (+ve & -ve) are often used to protect inputs. Many digital chips use that method (aka voltage clamping??). (And most digital chips have specifications that inputs tolerate Vcc +0.6V and Vdd -0.6V - ie, their +ve supply and -ve supply each extended by a diode;s voltage drop.)
But 2 else 1 reverse biased diodes are often added to circuits that have inputs from other circuits or supplies, or with other voltages or noise (spikes etc). (EG - they are essential for inputs taken from coils (inductors) such as relays or Ignition Coils (points, ignitors) etc.)
An alternative is to use a Zener diode of a suitable voltage. (They conduct like a diode in the normal direction, but "break down" and conduct in their reverse direction when the voltage exceeds their breakdown voltage.) For example, if the voltage needs to be limited to 5V, then through a resistor to a reverse biased to GND 4.7V Zener. That limits the voltage to ~4.7V, and also to above "GND -0.6V". That's essentially a Zener-type voltage regulator which is a popular method for powering low current loads. (Low current because otherwise a high Wattage resistor and Zener are required.)

I suggested the protection diode because then the +ve voltage that the Hall effect sensor output goes to is irrelevant (ie, 3.3V, 5V, 12V, 14.4V). The diode clamps it to no more than the Arduino supply (plus the diode's voltage drop of ~0.6V) and the resistor limits the current to what the diode can handle (but supply enough current to drive the (Arduino) input).

If you know the pull up voltage of that sensor, then you could use a voltage divider instead. You could still add the diode(s) for noise or extra protection, and you would if that sensor was triggering a coil (but it isn't).
The voltage divider is probably best... What if the diode fails in open circuit mode? Nothing then limits the input voltage....

My only other comment refers to "open collector" outputs. Your Hall effect sensor is almost certainly a Hall effect module (eg HKZ101) as opposed to a "raw" Hall effect sensor.
Such sensors are usually "open collector output" meaning that their output is a grounded transistor which is either GND when on, or floating when off. It's no different than ignition points on older cars etc - it is only their "load" that pulls them up to whatever voltage.
OC (Open Collector) switching is used on CPUs and many digital chips.
The advantage of OC type outputs is that you can interconnect various circuitry irrespective of their supply voltages. EG - a 5V CPU can use a 3.3V memory, or a 12V ECU can signal a 5V Arduino - only their GNDs need be common.
Another advantage is that you can connect them all together for an "OR" type function - eg, when CPU output OR Hall output OR manual kill switch is ON (=GND) - you don't need diodes to isolate the different outputs to prevent possibly damaging backfeed if they were +V outputs.

Damn - another 101 ramble.

Comment

well. after all it will take some time until its done, because i have decided i will implement, as many things from the car as i can! actally, if u hook up, 12v relays, in your instrument cluster light indicators, then you can give them to arduino as normal switches!