Automotive 'on' as logic signal

Go To Last Post
22 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi guys,

I am designing an circuit for use in an automotive environment, the circuit itself will be powered constantly using a automotive grade switch mode regulator (National/TI) to provide 5V. I need to be able to detect when the ignition is in the on, which is obviously going to be a 12V+ signal. What is the easiest way to reduce this to be able to use as a input to an AtMega? I guess a voltage divider may work, but do I need to concern myself about load dump etc? Analog electronics isn't my strong point.

Cheers
Simon

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are likely to be lots of high voltage transients on that 12V input, you need to protect the AVR input. Clamp diodes to +5V and Gnd should help. Inputs have internal diode protection, but they probably won't be sufficient. You will also need transient protection on the AVR supply.

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Leon,

I agree about the high voltage transients. I just got hold of the schematic for the vehicle it will be going in and the 'ON' position of the started switch is connected directly to the battery.

I am at this stage planning on using an LM2841 (http://www.ti.com/lit/ds/symlink/lm2841.pdf)for the power supply, which I beleive will deal with the transients. Happy to be told I am wrong.

Do you have any suggestion for an appropriate part for the clamp diodes?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is a useful document I found for supply protection against load dumping etc.:

http://www.vishay.com/docs/88490...

Here is one I found for MCU input protection:

http://www.datasheetcatalog.org/...

I'd use Schottky power diodes.

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Opto-coupler.

Ross McKenzie ValuSoft Melbourne Australia

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wouldn't the opto-coupler need protection, as well? LEDs don't like transients.

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Two resistors (47k..200k range to avoid phantom powering), a small capacitor, a couple of small signal Schottky diodes to the 5V rails and a 5.6V TVS between the rails are enough.

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

But there is a difference between key on and motor on. Key on is 12.x volts and motor on is 13.x volts. Is that what you need to detect?

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Simon,

Anything connected to the micro, on any pin, needs to have Load Dump protection.

Here is an example of an Ignition On/Off signal conditioner. Not the "best" out there, but a good starting point.

Note that this draws continuous current, (i.e. wastes power), when the ignition is ON, but when the ignition is on one generally has surplus power to work with, so no big deal.

The input diode blocks any reverse voltage spikes.

The R7 & R8 resistive divider bring the "12V", (13.8, 24 if jumpered, higher with spikes...), voltage down to a reasonable level for a logic input.

The R7 & Z3 provide an additional soft shoulder'd clamp on this signal level for when the input exceeds the "normal" operating steady-state value.

R7 (and R8 ) & C10 provide an additional filter.

JC

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It would really be nice if a manufacturer came up with a simple 3-pin device that incorporated all the nifty protection bits inside. Something in a sot-23 package, input, output and GND. Save a lot of board space compared to all those discretes.

Dean 94TT
"Life is just one damn thing after another" Elbert Hubbard (1856 - 1915)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bob,
I am looking to get a valid signal when the key in in the 'on' position, no matter whether the engine is actually running or not, so the input could be anywhere up to 14V with all sorts of noise and spikes.

JC,
Thanks for that circuit, it looks like it will do the job. Just one question, would it be wise to place a TVS diode in the circuit between ground and 12V?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
would it be wise to place a TVS diode in the circuit

There are many ways to protect the input( s ) to the micro.

With the design shown, a TVS isn't required.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Depending on exactly what your "module" does, you might want to consider the concept of "keep alive". In an automotive environment, you use the keyline hardware signal as a "wake up" trigger. However, the operator can "keyoff" at any point, and so i generally give the micro control of it's own power switch. If you use a voltage regulator with an "enable" input this is very easy, if not then a Mosfet does a similar job at the cost of slightly more complexity.

I use the KL15 line (6.5Vmin (during cranking!) and 14.7Vnom(normal op) or ~40Vmax (load dump) via a voltage divider, diode and OR'd with a micro output pin to the Enable pin of the Vreg. When the operator turns the key, current flows from the KL15 line, and enables the Vreg, powering the micro. The micro then sets it's pin high, so if the operator key's off it can keep it's own power on, until it has finished what it is doing (like saving adaptive / runtime data to eeprom etc). If you use the ADC to read the battery voltage on the KL15 line you know when the operator has turned off etc. (in fact, if you're clever, you can do all that with just one hardware pin ;-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Two resistor, one transistor, maybe cap, you don't have to worry if your system is disconnected from power supply and input still powered. Transistor can be almost 'what ever' small signal tr.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Use a comparator with an OC output, pull that up to VCC. Power the comparator off the +12.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
so if the operator key's off it can keep it's own power on, until it has finished what it is doing (like saving adaptive / runtime data to eeprom etc).

Depending on how critical the data is, you might want some backup strategy; completely unexpected sudden power loss can happen.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for all the suggestions. The circuit will run constantly, but mostly in sleep mode so the power drain will be minimal (the truck its going in will also have 400Ah of batteries and solar cells). One of the wakeup interupts will be the ignition switch.

JC, with the circuit you suggested, what power rating would you recommend for the resistors/caps/zener? I will be using SMT devices for the circuit as I hate drilling holes ;)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I sighted a part number for the zener.
That was a compromise between what was available and what I "wanted".
The heftier the zener the greater the transients it can withstand.

The cap should not see much more than 5 V across it, if the zener is doing its thing.

Since small SMD caps come in higher voltage ratings for the same physical size a little over spec'ing here is reasonable. If you are doing the entire PCB with 0.1 uF caps at 25 V rating that should be fine. My original design used 100 V caps, but that was a carry over from another project, and I had lots of them in stock. The by-pass caps were then from a different lot, 16V or so.

R8, 10K, won't see much more than 5 V, so its power idssipation is about 2.5 mWatts. Pick whatever you want.

R7, 18K, has to withstand a significantly higher voltage drop across it, and hence a higher power rating.

There are many references for Load Dump characteristics. Wiki, for example, sites 120 V. Some references go significantly hgiher than that.

With the zener clamping the right side of R7 to about 5V, one could have 120-5 V across the resistor, briefly, (not steady state).

The power dissipation is therefore around 300 mW.

The good news is that this is for brief transients, not continuous power dissipation.

How safe do you want to be?

500 mW would be reasonable.

Some would say that is overkill.

It is all a matter of how "mission critical" and bullet proof you want the design to be. An F-16 has different requirements than a moped... ;)

Improved redundancy is easily obtained by adding a second zener in parallel with the first one, and dividing R7 into two resistors, in parallel. A failure of any one of the four components will alter the operating point for the components, but won't zap the micro input, for example.

This, (rather old), through hole project photo shows my implimentation. Zbasic AVR, GPS, MMC card, Bluetooth module (to upload the SD Card data), 3-Axis accel. The power monitoring, (Ignition and Lightbar/Siren), input clamps are just to the right of the 4 diodes on the left side of the PCB.

There are a few of these out in the real world, doing there thing, without a failure, (yet).

JC

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JC,
Thanks so much for all you help. Since I didn't have the values you suggested I will order SMT equivalents (1W for both the 18K resistor and the 4.7V zener). While the circuit is not life supporting it is going into a friends camper to control the heating of hot water. My friend may forgive me if I mess up, but the girlfriend may not.

Cheers
Simon

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Chancy99 wrote:
It would really be nice if a manufacturer came up with a simple 3-pin device that incorporated all the nifty protection bits inside. Something in a sot-23 package, input, output and GND. Save a lot of board space compared to all those discretes.

 

replying to an old thread here -- but wondering if the answer to the above wish has changed in the intervening years.  i'd like to do some very simple automation / intelligent control in my RV, and i confess that the electronics necessary to protect power/inputs/outputs is daunting enough to make me use relay logic, instead.  :-)

 

does anyone make automotive-to-5V interface devices, or even (major fantasy here) a breakout board (for just about any uC) that has all that stuff on board already?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are 'wide input' regulators.... 9 to 32 volts in, 5V out at digikey and mouser. I wonder if TheRat ever got his hot water heated. Sounds redundant to me...

 

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

paulfox wrote:
i'd like to do some very simple automation / intelligent control in my RV, and i confess that the electronics necessary to protect power/inputs/outputs is daunting enough to make me use relay logic, instead.  :-)
Consider otherwise.

Medium trucks are 24Vdc; are some RVs 24Vdc?

24Vdc switches, contactors, and relays exist though there are alternatives; one such is a 24Vdc load switch (protected power NFET with gate boost drive and 5V logic input for control and output for state and/or failure signal).

In IRF's automotive catalog; add to it protection from load dump.

http://www.infineon.com/cms/en/product/power/smart-low-side-and-high-side-switches/high-side-switch/automotive-smart-high-side-switch-profet/channel.html?channel=ff80808112ab681d0112ab69e2d40357

paulfox wrote:
does anyone make automotive-to-5V interface devices, or ...
Power -

One of DocJC's posts above is similar to a design for load dump on a power circuit (high reverse voltage diode for current polarity, surge-rated resistor to limit current or maybe a PTC, TVS).

A load dump can be up to 400V plus or minus; I have forgotten the duration of a load dump.

A PolyZen will have a PTC and a zener diode but would need a TVS diode to protect the zener diode; PolyZen are not for automotive usage though could dissipate significant power (about 1W continuous).

Automotive PTC :

http://www.te.com/content/dam/te-com/documents/circuit-protection/global/technical_overviews/po-automotive-surface-mount-devices.pdf

PolyZen :

http://www.te.com/usa-en/products/circuit-protection/overvoltage-overcurrent-devices/pptc-zener-diode-devices.html?tab=pgp-story

 

Amplifier -

The Art of Electronics (AofE, third ed.) has, IIRC, a section titled "A riff on robust input protection" for instrumentation amplifiers (continuous high voltage blocking, current limiting, current dump but not to a power rail).

A post above stated use a comparator (a differential amplifier); that's one way to do impedance transfer ("high" to digital's "low").

Protect the comparator as for an instrumentation amplifier or an op amp.

 

Digital -

AofE has a section in digital interfacing on how to protect a digital input (multiple ways).

Sometimes as simple as adding impedance (R for current limiting, C to reduce dv/dt, L to reduce di/dt).

EMI is reduced and EMC is improved by adding impedance to match the required rise/fall time for a signal instead of what a digital gate is capable of; use the AVR's schmitt trigger to restore the edge rate within the AVR.

Digital output - the body diodes in the P and N FETs can be enough though still evaluate the circuit's impedance and might need a diode for a clamp and a resistor or two.

An AVR has some ESD capability though it's not stated.

Whereas, ESD capability is usually stated for discrete gates and some cPLD; add to that some EFT and lightning protection.

Sometimes easier to use a load switch; isolators were mentioned earlier in this thread.

 

Interface -

A Bourns TBU or TCS is similar to part of the AofE instrumentation amp protection but these are for lower impedance circuits (differential or single-ended).

There's a TBU for RS232.

One version of RS232 has a reduced I/O voltage that's close to 5V; might consider that for a discrete signal that's 5V (circuit impedance and edge rate are similar).

There's a TBU for CANBUS.

Ethernet is in some cars, and light & medium trucks; there's a TBU for Ethernet.

Have seen USB on a medium truck; uncertain how to protect USB for automotive.

LIN - Atmel has some LIN basis chips (LDO, LIN hardware interface) for use with automotive AVR; there might be an app note on LIN protection.

As for RS232, like LIN might be another way to implement a 12V or 24V discrete signal to 5V.

http://www.bourns.com/products/circuit-protection/tcs-high-speed-protectors-hsps

http://www.bourns.com/docs/Products-General/Bourns_TBU_TCS_short_form.pdf

 

 

"Dare to be naïve." - Buckminster Fuller