Reading Automotive Voltages

Status
Not open for further replies.
I'm using a Teensy 3.0 board for an automotive application right now, and I would like to do two things with it that I'm not sure the best way to work out. First thing I'd like to do is be able to read various signals from the car, these are just 12 V (or I suppose more accurately up to 14.7 volt) lines that run high when on, for error lights and such. The other thing I'm trying to do is be able to read battery voltage to initiate a low voltage shutdown procedure.

One way to do this would be with voltage dividers, to pull the pin high (or supply an analog voltage) without going over the allowable spec on the board. While I'm confident that this should work, it doesn't seem very safe as it is totally un-isolated in the event of a high voltage event (like the VR on the alternator dying) so I was wondering if you could think of something else.

Thanks
 
Slow optocouplers are cheap, you can use the 12VDC to turn on the LED part of the coupler, and use the teensy board logic suppply for the bias supply on the output transistor.
It's easy and cheap to detect on and off states that way. Also high voltage spikes won't hurt the LED as long as you have a current limiting resistor in there that limits to about 20ma. That way you can go to the automotive max of about 60V spikes and not hurt anything.
Tim
 
Yeah I thought about that too but was trying to keep component price down. It probably is the only way to do it safely though.

This just leaves my problem of reading the battery voltage off the car.
 
Optocouplers solve all sorts of problems, even ground differences.

If your ground is solid, you can use just a series resistor like 10K. Even a 60V spike is only going to cause 6 mA to flow into the pin on Teensy, which it can handle.

For example, using a voltage dividor with a 15K and 1K resistor will give you 1/16th of the voltage, which is just about right for measuring with analogRead() with the 1.2V internal reference. Or a 15K and 5.6K would be about right for dividing the 12V power to a "digital" signal directly into a pin.
 
The 12V bus in many cars gets hundreds of volt spikes during starter cranking, and sometimes as back-EMF from light bulbs such as brake lights.
There's an SAE spec (I can't find it just now) on what a proper power supply in a car/truck needs to tolerate, worst-case. It may be an overkill in some respects, but it does bound the problem.
This has to do with using vehicle power to run electronics, rather than sensor signals.
 
Last edited:
as to the on/off case, i guess a transistor switch might do as well? (say npn, collector tied to 3V3 via 10k or so resistor, etc). that's quite common in audio electronics, ie when interfacing control signals >> 5V with some mcu.

edit: haven't seen the above when posting this, ... no idea what automotive voltages entail.
 
Last edited:
Status
Not open for further replies.
Back
Top