2
\$\begingroup\$

Revison 1.3 (New circuit, more background information added, PCB made and tested, it WORKS)

Background: I would like to use a BeagleBone Black (=Minicomputer) for data acquisition in an automotive vehicle. It will be plugged into the OBD interface and will therefore be supplied by the 12.0 V - 14.0 V battery power / alternator.

The following specifications were defined:

  1. The minicomputer has to power on when the engine starts.
  2. The minicomputer has to stay alive when the engine goes out (e.g. new start/stop system in new vehicles at traffic jams)
  3. A clean shutdown (i.e. not cutting the power) should be made when no CAN or OBD messages have been received for 2 minutes.
  4. After the BeagleBone Black shutdown the power has to be cut to the automotive battery. (i.e. no further power consumption)

Actual progress/solution (Thanks to Olin and Dave!)

Two separate circuits. The trigger voltage indicates if the main switch is open or closed.

  1. Voltage sensing by TL431: When a voltage > 13.25 V was detected, the main switch will be opened by a P-Mosfet.
  2. A NP-MOSFET switches the power supply for the BeagleBone Black. When the battery voltage is above a specific threshold (e.g. 13.25 V) it closes the P-Channel (engine started, vehicle battery ~ 14.0V, the BeagleBone starts up). When the BeagleBone Black starts up, the internal 3.3 V closes also the N-channel MOSFET (This will keep the BeagleBone on, also when the car engine is out)
  3. When the engine is out, and the BeagleBone receives the poweroff system call, the BeagleBone powers down. The connection to the vehicle battery is cutted (No trigger voltage and no 3.3 V of the BeagleBone).

The circuit is shown below. Of course there is a protection circuit before and a step down converter after that part.

  • MOSFET used: VISHAY SI4564DY-T1-GE3
  • +12.0V = Vehicle Battery
  • TRIGGER = When vehicle battery is > 13.25 V, this voltage will be pulled down
  • VDD = Supply voltage for the BeagelBone Black (Goes into a step down converter)

Switch Circuit

\$\endgroup\$
  • 1
    \$\begingroup\$ @DaveTweed If the idea is for the Pi to sleep until the car starts, then there's a bit of problem. Since the Pi draws a fair amount of current when running, you want it powered down when the engine is off. A day or two can drain the battery to the point where the car won't start. Been there, done that. Had to call my father in law at an ungodly hour to get my car jump started. \$\endgroup\$ – JRE Aug 22 '16 at 13:17
  • 1
    \$\begingroup\$ Why would you trigger from a voltage low (starter cranking, transient load, or low batt.) to see if a car engine is running? Wouldn't it be more reliable (and easier) to simply run the device only when main bus voltage is >14v? This way, your device detects the 14+ volts of a turning alternator & runs, but won't ever drain your battery below 14v, so no risk of your pi causing a no-start condition. \$\endgroup\$ – Robherc KV5ROB Aug 22 '16 at 14:07
  • 1
    \$\begingroup\$ You are missing a bunch of edge cases for input voltage (most of which will destroy your device). Automotive voltages are a lot uglier than what you are planning for. Check out ISO7637-2. Don't ignore it, been there, done that, released the smoke. \$\endgroup\$ – pgvoorhees Aug 23 '16 at 13:37
  • 1
    \$\begingroup\$ @jarvis If you're working with a hybrid (mentioned due to your comment about multiple engine star/stop events while driving), then I haven't studied their electronic enough to say anything definitive. However, for "engine-only vehicles with lead-acid vatteries, your cut-out threshold may be set a bit low. My very old/worn-out truck battery is sitting at 13.4V right now & the truck hasn't been running for over 12hours, so with a 13v turn-off voltage, your system would still be 'on' in my truck at nearly a day after turning it off. \$\endgroup\$ – Robherc KV5ROB Aug 23 '16 at 20:32
  • 1
    \$\begingroup\$ @pgvoorhees: Thanks for the hint. There is already a protection circuit, but I have not mentioned it. In this post, everything is about the switch :) Anyway, I will edit the question, that nobody uses it without a protection circuit ;) \$\endgroup\$ – ben Aug 24 '16 at 7:16
2
\$\begingroup\$

What you are attempting sounds backwards. You want to detect higher than idle voltage, not lower. When the engine is running, the alternator raises the battery voltage to the float charge level. This is usually around 13.6 V, but can vary quite a bit. A threshold of around 13 V or a little higher is probably right. Measure your battery voltage with everything off and with the engine running, then pick a voltage in between.

The rest comes down to detecting this threshold voltage using very little current. Something like a TL431 and a couple precision resistors may be good enough. Carefully compute the error band to make sure it is acceptable. Then turning on power to something else when the TL431 triggers is trivial.

\$\endgroup\$
  • \$\begingroup\$ Of course I can use the TL431 instead of the Mosfets. Most of the new cars use start/stop engine systems at traffic jams. When you stop, the engine also stops -> 12.0 V battery power. --> When you drive 14.0 V. This means the TL431 is always switched on when the engine runs but switched of when you stop. I can use the TL431 instead of the two Mosfets, but removing the Thyristor should not work. I also want to collect data when the car is not driving. Thanks anyway :) \$\endgroup\$ – ben Aug 22 '16 at 15:59
  • 2
    \$\begingroup\$ @jar: That's not what you asked about. This extra information should be in the question. Also, the TL431 is only to do the threshold detecting. It would switch a pass element, which then does the actual power switching. Also, you could leave the system on for a minute or two after alternator power went away to ride out temporary engine off periods while actually driving. \$\endgroup\$ – Olin Lathrop Aug 22 '16 at 16:02
  • \$\begingroup\$ The idea of using the TL431 for detecting the threshold is a nice idea. I think, using the output voltage of the TL431 as input for the Thyristor should work. Only the gate of the Thyristor is then always high... But I think this should not be a problem? \$\endgroup\$ – ben Aug 22 '16 at 16:22
  • \$\begingroup\$ @jarvis: I wouldn't use a thyristor, just a P-channel FET switched by the TL431. You can add circuitry for the computer to keep the power on once it's on. When to shut off is then determined in firmware. The computer can measure the batter voltage and decide what to do, including adding a couple of minutes run time after the alternator has shut off. \$\endgroup\$ – Olin Lathrop Aug 22 '16 at 17:01
  • \$\begingroup\$ @jarvis: I think Olin has the right idea here. A lead acid battery develops what is known as a surface charge during charging, and that takes some minutes of modest discharge to "remove". So I'm thinking if you don't care about the RPi shutting off quickly after engine off, you could tweak the threshold voltage (perhaps as low as 12.75V) such that surface charge keeps it on for much longer than a traffic stop, but definitely shuts it down before draining the battery too much to start. A 100% charged lead acid battery has a post-surface-charge voltage of about 12.7 V IINM. \$\endgroup\$ – scanny Aug 22 '16 at 20:35
2
\$\begingroup\$

Assuming you really want the computer to start up on cranking rather than running, I would propose a circuit like this:

schematic

simulate this circuit – Schematic created using CircuitLab

The zener diode D2 determines how low the vehicle power must "droop" before switching on the computer. The computer itself determines when to shut down — by pulsing the base of Q3 high.

This circuit draws no quiescent current. If you replace D2 with something like a TL431, there will be some current through its bias network.

The general idea is that the computer will fire up on any cranking event (or other transient load), and then it can evaluate conditions and decide whether or not to keep running.

\$\endgroup\$
1
\$\begingroup\$

I strongly suggest that you do a little bit of searching around automotive power supply design. There's a lot more going on than just a slightly (12-14V) power supply. A good starting point is Little Fuses's AN9312 app note which gives a good overview of what's going on.

For example a figure of 14V is mentioned in the original post but the alternator on my TDV8 L322 is regularly outputting 14.5V because there is so much demand on the battery from all the electrical systems. Similarly cranking a 3.6L V8 draws quite a bit of current, particularly over the winter, and it will easily drop to 6V, and these are not abnormal figures.

The main thing to be aware of is the rating on various devices. For example Q1 in the schematic above is connected "directly" to the battery and noisy circuitry. Care must be taken to chose a FET that is appropriately rated for the environment.

NB: there are devices (Linear produce some for example) that are specifically designed as automotive protection circuits and power supplies.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.