Circuit to detect when a car's ignition is on

Discussion in 'Automotive Electronics' started by jjmalove, Aug 11, 2016.

  1. jjmalove

    Thread Starter Member

    Jul 6, 2016
    39
    1
    Hello,

    I am working on a larger project, but one of the many small tasks is we need a decent way to spit out an input to a microcontroller we a vehicle's ignition has been turned on or off.

    We have a potential solution. Simply tap into the fuse box onto one of the various ACC fuses that only turn on when the ignition is on. That is all fine and dandy except A: Its a bit invasive. B: It changes based on the vehicle. I would like a solution that is more cross-platform and easier for a user to install. I am limited in what I can say about the rest of the project, but all I really need is some sort of "tell" that I can either directly or step down the voltage (know how to do that already no problem there) so that I can feed a GPIO pin of a microcontroller elsewhere in the system.

    I would like to come off a usb or cigarette lighter. On some cars, this would work great. Some cars have ports that only turn on when the ignition is on.
    However, on some cars they are on all the time. Also, on some cars you have a few on all the time and a few on some of the time.
    I want to design a circuit that can be used on either variant, either on all the time or on only when the ignition is on. I think I have an idea but not sure if this is correct.

    I know when you crank the ignition the voltage dips for a short period of time. Does this dip always pass onto the rest of the ports like the cig lighter and usb? If so I believe I could design a circuit that sits there expecting to see either 0v or 12v, but if it ever sees a range of say, 6-10v, it lets me know. The big question is whether or not my assumption is correct that the cig lighter/usb do in fact dip during crank?

    Any thoughts? I plan to go do some testing today but just wanted to put some feelers out as well.
     
  2. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,570
    2,381
    The lighter/USB is going to dip with the rest of the car system, there is usually nothing to maintain the voltage during this time, particularly on a lighter outlet. IOW The battery output dips to this level.
    Usually 6v the motor is not going to crank, anything below ~9v is too low, particularly in sub-Zero C° temps.
    Even if the cranking amps drop the voltage to 6v the μp can detect down to 5v.
    Max..
     
    Last edited: Aug 11, 2016
  3. wayneh

    Expert

    Sep 9, 2010
    12,155
    3,061
    I'd be more inclined to use a voltage above 12V to indicate the engine is running. But if you need to detect it's in "accessory" mode without the engine running, you might be able to get that from the power to the radio. Not super easy to get to, though.

    I think most cars have an extra, empty fuse position for adding another accessory. Not sure. If so, that'd be a fairly easy access point.
     
  4. KeepItSimpleStupid

    Well-Known Member

    Mar 4, 2014
    1,150
    205
    You can also get it from the CAN bus Ignition On is probably a lot easier than engine running.

    Do you have to distinguish "being in accessory"?

    If you have to detect "engine running", you might be able to use alternator ripple.

    Wipers, heater;

    With CAN, I don't think it's easy anymore. Next thing you know, the car may have just a few fuses. A +12 buss and fuses for the micros.
     
  5. roadey_carl

    Active Member

    Jun 5, 2009
    116
    5
    Does it matter if it is a Diesel Or Petrol? If its petrol you could use a home made clamp meter round a HT lead to detect the engine is running? Or you could use a flow sensor in the engines coolant system to turn something on? or a Air flow sensor on the inlet manifold??

    They'd all be relatively easy to fit to any existing design.
     
  6. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,570
    2,381
    Which do you want to detect Ignition on, or motor running?
    Max.
     
  7. jjmalove

    Thread Starter Member

    Jul 6, 2016
    39
    1
    Thanks for all the replies.

    So good news, I have a working solution for the short term at least. The vehicle in question we are using has three fuses that only get to 12V after the engine has been turned on. They are always at 0V when the car is Off, Accessory, or ON but not running. Got a piggyback fuse connector and am able to get a lead coming off them that I can use. So problem solved for a brute force solution at least.

    @Max want to detect motor running.
    @Roadey had not thought about a more mechanical solution like that. All good ideas I'll give them some thought and bring them up to the other guys.
    @KeepItSImpleStupid Saw your response to my other forum, thanks! I had thought about tapping into CAN bus. What about detecting the RPMs off the CAN bus? I know with my little OSB2 tool I can see the RPMs. Not knowledgable how to take that data and export it though. The one I have isn't even for work, just for home, and syncs with my smartphone.
    @wayneh testing has revealed plenty of places I can tap into fusebox that are only hot when the car is in ACC/ON. We are "ok" potentially with that, and its pretty easy at that point, but we prefer to only be on when car has actually been started and motor is running. The vehicles I tested all had empty spots I could simply use, but even if they didn't I could just use a piggyback fuse off of any existing one I wanted to pick.
     
  8. wayneh

    Expert

    Sep 9, 2010
    12,155
    3,061
    That's the easiest scenario. Just watch the system voltage. It will never be above ~14V without the engine running, and rarely below that when it is running. (An automotive expert can probably tell us the best target voltage to distinguish the two states.)

    Monitoring voltage requires circuitry, but it could be self-contained within your device and wouldn't require the user to make a connection somewhere.
     
  9. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,570
    2,381
    Well that is not really motor running? just ignition on.
    If you check the Service man, the schematics usually show two sources, "Hot at All times" and "Hot in Run and Accessory", Run usually means Ignition key switch ON position, but not necessarily motor running.
    It is on my Olds anyway, it runs at 14.5v when running .
    Max.
     
Loading...