0

I want to sense a circuit state in an Automotive circuit (12V nominal) from a 3.3V microcontroller (MSP430Gxxxx). The circuit is normally 12V (or VBat) until either the Wireless ECU or a Door Key grounds the line, triggering an event. How can I safely (in terms of not frying the MCU or affecting the state of the line) sense this?

From the Manufacturer description, this seems to be a simple Open Collector system, it is not a power circuit, so I don't know how much current can be sourced.

enter image description here

I would tap into junction J6.

As this is automotive, current consumption is a concern as well. My MCU will be set up to interrupt on a falling edge trigger, and asleep unless that happens.

Passerby
  • 72,580
  • 7
  • 90
  • 202
  • This is separate from my other question. – Passerby Sep 13 '14 at 21:46
  • 2
    Check this question: http://electronics.stackexchange.com/questions/73857/detect-car-12v-using-arduino – Mike Sep 13 '14 at 21:49
  • Updated question to reflect that the line/circuit is not a power source. @mike my concern is that the line is pulled high by an unknown resistance, by default, then grounded. How would the 2mA draw of the opto + resistor to ground affect that? And I would like to avoid that scenario as having the 2mA on the car side and the 1mA on the mcu side, in an always on circuit, while small, might lead to drained battery at one point. If the signal was active high instead of active low, I can see that working. – Passerby Sep 13 '14 at 22:11

2 Answers2

4

Use a pullup on the input. Put a diode reverse-biased on the input. When 12V is applied to the cathode no current will flow and the input will be pulled high. When 0V is applied to the cathode the input pin will be pulled to 0.7V, triggering a low.

schematic

simulate this circuit – Schematic created using CircuitLab

Passerby
  • 72,580
  • 7
  • 90
  • 202
Ignacio Vazquez-Abrams
  • 48,282
  • 4
  • 73
  • 102
2

By far the safest way to do this is with an opto-isolator. Simply power the LED from the 12V source, perhaps with a limiting diode to block very high voltages (e.g. zener). The phototransistor side is connected to your microcontroller, in a fully isolated and safe manner.

user
  • 1,789
  • 10
  • 20