I made a dumb mistake building a voltage divider board - will it hurt?

Status
Not open for further replies.

Talkiet

Well-known member
I am (want to be) reading a bunch of automotive sensors (Oil pressure sender, fuel gauge, brake pressure SWITCH an low oil pressure switch) and knowing that I couldn't just chuck 12 (or 14.7 under charge? see below) I built a back of the envelope voltage divider board using 12k and 5k resistors, giving a 5/17ths reading. (12v = 3.53v)

I didn't do this with any real method because when I built it I only really wanted the oil pressure SWITCH and brake SWITCH, so I just wanted a safe, sufficiently non-zero number when the signal went from 12->0v or 0->12v. Of course as soon as I got the dash off I put a multimeter over the fuel gauge and the oil pressure gauge as well. They are resistive type senders and even at good oil pressure the raw voltage I am getting is only about 5V (before the divider). I THINK this is because the sender has specific bounds for the resistance (that I don't know)...

However when I did this, I chose 5/17th because that would bring worst case charging voltage (about 14.7v) down to a safe (for 5V!) 4.3V. At the time you see it completely escaped me that the analog inputs on the Teensy are 3.3v, not 5v.

The happy accidental situation is that the 12v signals for the brake switch and oil light are 12v only (even with engine on) and it appears that the two gauges will never read 12v (I'll need to fill the fuel tank to be sure 100% though).

This brings me to my actual question, hopefully having given enough background.

I believe the Teensy 3.5 Analog input pins A0-A9 are 5v tolerant, meaning that my input worst case scenario (which I WILL SEE for the 2 switches) will see 3.53v presented. I have read that this isn't an issue except obviously the reading will max out for any input from 3.3v to 5V (and beyond if I choose to explode things). Is my understanding correct?

Is it safe to present a 3.53V signal to pins A0-A9, understanding I'll see 2^12 as the result only?

If either gauge ends up presenting the full 12v to my slightly inappropriately sized divider array, is the only issue that I'll lose any resolution above 3.3V and get 100% readings?

Or am I going to blow things up?

Cheers - Neil G

ps. I did all my testing on a Mega2560R3 so I was able to observe the behaviour so far without going beyond any design parameters. I literally sat down to add the code into my Teensy app and realised when I googled for Teensy 3.5 analog in sample that I had forgotten about 3.3!
 
Even if a Teensy 3.x pin is 5V tolerant, that is mainly for digital signals (GPIO). It will when configured for analog readings internally be connected to one of the ADC inputs which will be saturated at 3.3V. Thus, it is strongly recommended to limit the input voltage to max 3.3V. Thus, interfacing it with car sensors involves at least two steps:
1) scaling the 0 to 14.4V signal range down to 0 to 3.3V.
2) add some protection to make sure that the input voltage never exceeds 3.3V (after the voltage divider) or 14.4V before the voltage divider.

Car electrics are considered as a rather rough electrical environment, one should never think to have clean voltages but rather noisy signals with lots of spikes. Thus, interfacing these with microprocessors asks for careful design and protection, especially when using parts which are not especially designed for automotive environment.
 
I understand what you're saying in a perfect world I'd wait for the optoisolators to arrive and build it then - but I am impatient and this is holding up development (yes I could generate voltages on a bench but the data should be a little bit sane since I still want to test other parts of the whole solution - possible automatic sync of several datastreams and production of demo videos with real data)...

Having stipulated to agreeing that what I am describing is not the "right" way to do it, will the Teensy happily accept 3.53V on A0-A9 when using them to read analog values without blowing up?

(The reason I haven't just replaced the 5k resistors with something smaller to bring it into range is because I will be building a better version of this after the software is mostly in the can)


Cheers - N
 
The dual digital/analog pins can withstand 5V and just read max, the analog only pins not so much. One thing to watch for though is that the protective circuit may increase the current flow as it tries to pull the input down to 3.3V. With the voltage divider this shouldn't be doing anything too exciting to your senders but worth watching if directly connecting to a transducer, since it ends up driving a low impedance load.
 
I made the same error when prototyping a project recently. It was my first use of reading analog voltages on a Teensy, and to top that off it was a direct connection to an unfamiliar device whose amplified output went up to 4.9V. There could have been a half hour or more at high levels before I realized the problem. After adding the divider the Teensy 3.5 didn't appear to have suffered and it's been working fine ever since.

But as the other guy said, the ugliness possible from automotive systems is probably your biggest worry. Watch out when large inductive loads switch off. This article talks about transients that get above 200V:

http://www.electronicdesign.com/pow...motive-load-dump-circuit-protection-headaches

One tried and true method is a zener to protect your circuit, following a high-ohm series input resistor in order to protect the zener itself. I've used 10K and above.
 
I understand what you're saying in a perfect world I'd wait for the optoisolators to arrive and build it then - but I am impatient and this is holding up development
Mistakes are much more likely when you are inpatient and in a rush. And if you blow up your teensy that may hold you up much longer.

The automotive environment is rather nasty electrically since voltages can vary significantly, plus there is always a possibility of spikes. You should design your voltage divider to get 3.3V at the top end of the possible range (43k & 12k will get you up to 15.125V) plus you need a Zener (say, 3.9V) and a cap to protect against spikes.
 
Status
Not open for further replies.
Back
Top