Powering Arduino in a vehicle

I have been experimenting with various projects in a couple of my cars lately while powering my arduino through a cigarette lighter port. I have found that my arduino Sainsmart Nano 3.0 will flicker and sometimes and freeze a live data stream from sensors when the engine is in gear and accelerating, putting strain on the electric system. I know this is not a vehicle forum, however, I know I'm not the first to install an Arduino device in a vehicle, so I'm curious as to what the recommended powering method is for this type of thing to regulate voltage spikes and drops?

  1. I have used a USB cigarette lighter adapter - glitches upon acceleration
  2. I have used a cellphone power chord with the mini USB plug end on my Nano 3.0 - glitches upon acceleration as well

Maybe I should try soldering on some power wires directly to the board? What would you all recommend?

Is it really a cigarette lighter? The last several years the cars have gone away from that to 12V power outlets. That's what my 2004 Jetta Wagon had, and now my 2014 Jetta Wagon.
In the 2004, I ran my Duemilanove for 3 days straigth with a 1A USB cigarette-lighter plug adapter with no issues. The socket was live all the time.
In my 2014, I think the socket is powered down when the engine is off.
If you really have a cigarette lighter tho, I would expect the power to not be as clean, a heating element would not care so much. Some extra electrolytic caps with isolation diodes would help to hold the power steady during glitches and keep the caps from backfeeding into the electrical system.

Just add some large capacitors between power and ground to smooth the signal out. That should make it good enough for your regulator to be ok. I doubt there's much/any power regulation in most cars. Since the alternator supplies power based on engine RPM, the voltage of a typical car battery is hardly constant (11V - 14V).

Use some caps, and don't solder power directly to the board, use the regulator.

Gustermaximus:
I have been experimenting with various projects in a couple of my cars lately while powering my arduino through a cigarette lighter port. I have found that my arduino Sainsmart Nano 3.0 will flicker and sometimes and freeze a live data stream from sensors when the engine is in gear and accelerating, putting strain on the electric system. I know this is not a vehicle forum, however, I know I'm not the first to install an Arduino device in a vehicle, so I'm curious as to what the recommended powering method is for this type of thing to regulate voltage spikes and drops?

  1. I have used a USB cigarette lighter adapter - glitches upon acceleration
  2. I have used a cellphone power chord with the mini USB plug end on my Nano 3.0 - glitches upon acceleration as well

Maybe I should try soldering on some power wires directly to the board? What would you all recommend?

If you really are getting electrical glitches on acceleration, you might look to the rest of the car, as there could be a performance hit going on. The problem may simply be mechanical. There really isn't much to ensure a positive connection, only the springiness of the earth tabs on the sides of the charger, and one of mine was chronically troublesome until I butchered the earth to get a tighter fit.

Use some caps, and don't solder power directly to the board, use the regulator.

Update: I got curios and wired 12 volts from the car to my vin pin on my Nano 3.0. The results were a bit surprising as even when the engine was completely off and I was just running the board off the battery power, the board just flickered off and on. It never even really turned all the way on actually. It only powered up long enough to flash the LEDs on the board and then it shut off and repeated over and over. NO.. that refreshing loop was not in my code. :stuck_out_tongue:

I thought these boards were regulated to work just fine with 12 volts to the vin pin? could it be my board has a problem or it's just not regulated correctly ad I need to add something to moderate the power?

Filter (not regulate) the input current to your arduino.

Filter (not regulate) the input current to your arduino.

Can anyone post a picture or a link to an example setup for something like this? I'm sure I'm not the only one who's been looking for a good instructional on how to power an Arduino board like this with pictures to avoid confusion

bump I'm trying to figure out the voltage of power needed to the vin pin on my Arduino Nano for it to operate smoothly... every data sheet I've read says it can handle 7-12 volts, however, my board still just flickers with 12 volts connected to the vin pin and ground to the gnd pin. If I add resisters to my 12volt power supply, I still don't know what voltage the board actually needs, so I don't know what resisters to put on it. What do you all suggest?

It may be overkill, but I've been trying out quite a few power circuits for an arduino mega project where I need the unit to be rock solid in operation.
If you checkout the power supply circuit in the bottom of this diagram, just off to the right it has proven to be damn near perfect: https://raw.githubusercontent.com/noisymime/speeduino/master/reference/hardware/v0.2/speeduino-v0.2-schematic.png

It will protect against alternator dumps, reverse polarity, double battery hookup etc and doesn't fluctuate at all during operation.

Looks like you're making an arduino based PCM controller for your car?? Very cool project by the looks of it! It looks like you're using a LM2940T-5.0 regulator to regulate the raw 12volts from the vehicle battery and then inputting 5volts from the 12volt regulator straight to the 5volt pin on the MEGA? Please forgive me if that's a stupid question :stuck_out_tongue: I'm not very experienced in reading schematics like that and this is my first time using regulators, could you simplify that part a little bit more for me?

Update: I got curios and wired 12 volts from the car to my vin pin on my Nano 3.0.

The voltage in an automotive system can be as high as 16 volts and is TYPICALLY 13-14, so you may be overheating the voltage regulator.

Automotive electrical circuits are very hazardous to electronics, with transients of several hundred volts occasionally observed. Plus there is the possibility of polarity reversal (an incorrectly wired jump start) and the extremely hazardous "load dump transient" which comes from the alternator, if battery connections are corroded and loose. http://www.digikey.com/Web%20Export/Supplier%20Content/Tyco_8004/PDF/Tyco_AutoNetwork.pdf

If you want your electronics to survive for any length of time, you need to be serious about filtering and regulation. Here is a useful thread: Protecting automotive power input to boost reg - General Electronics - Arduino Forum

Gustermaximus:
Looks like you're making an arduino based PCM controller for your car?? Very cool project by the looks of it! It looks like you're using a LM2940T-5.0 regulator to regulate the raw 12volts from the vehicle battery and then inputting 5volts from the 12volt regulator straight to the 5volt pin on the MEGA?

You are 100% correct on all counts :slight_smile:

Doing it this way completely bypasses the Arduinos own voltage regulator, which doesn't have any benefits by itself, but allows you to design the power circuit from end to end to be something you trust.

And yep, Arduino Mega based Engine Management System (EMS). It's still working it's way through development, but has run 1 and 4 cylinder engines so far with 6 and 8 being on the horizon. check it out at GitHub - noisymime/speeduino: Speeduino - Arduino based engine management if you're interested.

Use a switch mode regulator with good decoupling.

The alternator on a car can debit 60+ Volt peaks for short ms/ns. Thats not a fault, its just how they work. Thats why some equipment is specifically rated for a automotive applications, if you check the datasheet.

Update: my dad is helping me put together a regulator with the right resisters to control the raw 12 volts coming from the car. We tried bumpin it down to 11 volts and it seemed to behave a tad bit better but still not powering on the board and the screen and keeping them on. What voltage should I be trying filtering the raw 12 volts to? 9volts? I am still going to use the vin pin on the Nano 3.0 as my power input pin so I can keep the board's power regulators in play.

Gustermaximus:
Update: my dad is helping me put together a regulator with the right resisters to control the raw 12 volts coming from the car. We tried bumpin it down to 11 volts and it seemed to behave a tad bit better but still not powering on the board and the screen and keeping them on. What voltage should I be trying filtering the raw 12 volts to? 9volts? I am still going to use the vin pin on the Nano 3.0 as my power input pin so I can keep the board's power regulators in play.

Thats dodgy, to say the least.

Use a 7809 Pre-regulator if you really cant afford a switch mode regulator.

I agree with casemod here, that's not an ideal solution.

TI do some really nice switch mode automotive regulators if you want to go down that path, but from my searching I don't believe there's any through hole ones available. Sticking with THT, I would highly recommend using a decent regulator such as a LM2940 or 7805/7809 in a pinch.

If you are insisting on using the inbuilt regulator, at the very least add high (~10uF) and low (~0.1uF) capacitors on the input as well as a suitable MOV and an inline schottky.

I've used the LM2940 in the car with no problems at all. It is specified for automotive use and has good internal protection. I think it's limited to about 500mA though. If you need to provide a bit more juice, I found some really nice regulators from Micrel (MIC29xxx range). They also have some nice features like an enable pin that allows you to switch them on/off remotely.

Ian.

update: I'm using a 5 volt 7805A regulator and it seems to be working well powering my Nano and uLCD-32ptu, however it runs very very hot while it's knocking the 12volts from the car down to 5. I'm going to experiment with a few other regulators to find one that doesn't get so hot and is a bit more stable, then attach it to a heat sync of some kind to keep it cool.

Thanks for the project guidance on this guys, hopefully this forum will help others with their projects as well :slight_smile:

They will all get somehow as hot.

Assuming you are drawing 100mA from the arduino and the car runs at 13.8V, the regulator "burns" the excess 13.8 - 5 = 8.8V

That gives you about 1W being converted into heat.

Just a note:

On one of my recent projects I was using an LDO, but the DSPIC ended up drawing far too much power so I needed a replacement.

I ordered these -> http://uk.farnell.com/jsp/search/productdetail.jsp?SKU=2319830 from Farnell. They perform quite nicely.