How to power Arduino in cars?
Posted: 22 Apr 2019, 18:15
This is more like a blog, i will add posts describing each aspect one by one, and also examples. So keep your eyes open on updates!
Talking about car power supply always involves talking about "12V" battery power. But this is a wrong assumption! Even if the cars main power comes from it's battery and this is given as a nominal voltage of 12 Volts, it will be sometimes more sometimes less, like every battery. From the beginning, where it is fresh and fully loaded it may be 13V down to 9V if it is weak or 6V if it is nearly broken. But the battery needs to get loaded by a generator, which produces AC current and needs to get flattened to DC and regulated to about 14V. Because the generator is directly driven by the engine, the RPM of the engine also influences those parameters (think about a bicycle generator driving the light).
On the "consumer" side of the power, every load which get's switches on produces a small breakdown in voltage (in older cars you can see headlamps dimm if you switch on the electrical window heater) and also a peak if switched off. Also motors and other consumers causes noise on top of the power lines. If cranking it could go down to 9V or less, which is normal even if everything is in perfect shape. Think of Start-Stop systems doing this all the time.
And last but not least, think about what failures could happen here also. What if the regulator circuit of the generator gets an malfunction? What if your car needs to be jump-started from another car? What if many systems runs at the same time, like lights, heaters, blowers in winter? What if mass cable get's cut from battery? What if someone welds parts on your car? And so on...
Smart people define tests for all those enviromental situations, normal and fails and put it into ISO tests. Those tests describe what a automotive circuit must withstand to get an approval. A very informative diagram from these documents is this one, called the "load dump", where you can find all of what i told above:
Conclusion: The voltage level of the car is far from being stable 12V and also far from a clean battery power. Don't mix it up with the output of an laboratory power supply or even a simple plug-supply.
But let's keep it straight and simple for us hobbyists! We do not want to certify our work, just protect it that it will run more than a few month and, more important, is no threat to our car or our life because of fire or electronical breakdowns.
Resons why the internal voltage regulator of the Arduino is not suitable to be powered by cars 12V net
So let's start with a closer look to the schematic of the power supply regulator placed on the Arduino Nano board itself (and most clones):
As you can see the board could be powered directly by 5V if put to the "+5V" pin of the board, or by a higher voltage put at "Vin". The board uses a "LM1117-5" Low-Dropout linear regulator (LDO) with a fixed output of 5V. There is no further input protection or buffering of the LDOs input (Vin). It can deliver up to 800mA, which is more than enough for the small Atmega and parts (uses about 30-50mA only).
The word "Low-Dropout" means that the input voltage must only be 1.2 Volt higher than the regulated voltage. So 6.2V is needed for it to function properly on 5V output. But as from the datasheet, the maximum input voltage is 20V. It has internal thermal shutdown, so it could not overheat or break by current overload. This is much more better than good old LM7805 which will break and then put Vin to Vout. Heat comes from current and voltage (P=U*I). So if you drive it with 12V and 100mA for example (10mA for the regulator itself and 90mA for the board), the LDO has a waste power of 0.7 Watts ( P=(12V-5V)*0.1A). If input voltage rises to 15V the power dissipation goes up to 1W. If you need to drive a relay, 100mA is not much... let's assume 500mA and you are at 5W. No doubt that it would not do this for long! The operating temperature must be between 0°C and 125°C. Well, if you only drive in summer, or live near the polar circle, this may not a problem...
The 1117 also has no protection against overvoltage, reverse polarity, undervoltage (brown out) and no sleep mode. It also produces heat because of the nature of this regulator (not for big loads, but for reference voltages). It also has no protection for reverse current coming out of the 5V circuit (e.g. a relay).
Conclusion: The internal voltage regulator should be void for automotive use. It would not withstand the rough environment for long!
Next, we will learn how to do it right, or even better We talk about three blocks named "protection", "voltage regulator" and "ripple filter". As we learned above, we should bypass the on-board voltage regulator of the Nano. To safe power we use our own regulator and may also remove any LEDs if they never get seen by anybody.
The most basic protection is a fuse. It will not really protect the circuit (chips are long gone before the fuse is blown in case of overload or short circuit) but the car and other components, so never run a circuit without a fuse, e.g by directly connecting it to the battery terminal!. But we do not need a fuse ourselfs and if, it must be accessible. It makes no sense to put a fuse inside a case and hide this under the cars trims where you never find it. If, place it inside the fuse box of the car or use an unused fuse socket from this box. Or, my favorite, use an power line with an existing fuse
Links and references
The listings of this electronics FAQ is somewhat like the holy bible of automotive power supplies. Read it, if you can understand it and have some days off: http://www.dse-faq.elektronik-kompendium.de/dse-faq.txt
Also this application note from Maxim gives a good overview of the problematics and how to deal with it: https://www.maximintegrated.com/en/app- ... vp/id/4240
Talking about car power supply always involves talking about "12V" battery power. But this is a wrong assumption! Even if the cars main power comes from it's battery and this is given as a nominal voltage of 12 Volts, it will be sometimes more sometimes less, like every battery. From the beginning, where it is fresh and fully loaded it may be 13V down to 9V if it is weak or 6V if it is nearly broken. But the battery needs to get loaded by a generator, which produces AC current and needs to get flattened to DC and regulated to about 14V. Because the generator is directly driven by the engine, the RPM of the engine also influences those parameters (think about a bicycle generator driving the light).
On the "consumer" side of the power, every load which get's switches on produces a small breakdown in voltage (in older cars you can see headlamps dimm if you switch on the electrical window heater) and also a peak if switched off. Also motors and other consumers causes noise on top of the power lines. If cranking it could go down to 9V or less, which is normal even if everything is in perfect shape. Think of Start-Stop systems doing this all the time.
And last but not least, think about what failures could happen here also. What if the regulator circuit of the generator gets an malfunction? What if your car needs to be jump-started from another car? What if many systems runs at the same time, like lights, heaters, blowers in winter? What if mass cable get's cut from battery? What if someone welds parts on your car? And so on...
Smart people define tests for all those enviromental situations, normal and fails and put it into ISO tests. Those tests describe what a automotive circuit must withstand to get an approval. A very informative diagram from these documents is this one, called the "load dump", where you can find all of what i told above:
Conclusion: The voltage level of the car is far from being stable 12V and also far from a clean battery power. Don't mix it up with the output of an laboratory power supply or even a simple plug-supply.
But let's keep it straight and simple for us hobbyists! We do not want to certify our work, just protect it that it will run more than a few month and, more important, is no threat to our car or our life because of fire or electronical breakdowns.
Resons why the internal voltage regulator of the Arduino is not suitable to be powered by cars 12V net
So let's start with a closer look to the schematic of the power supply regulator placed on the Arduino Nano board itself (and most clones):
As you can see the board could be powered directly by 5V if put to the "+5V" pin of the board, or by a higher voltage put at "Vin". The board uses a "LM1117-5" Low-Dropout linear regulator (LDO) with a fixed output of 5V. There is no further input protection or buffering of the LDOs input (Vin). It can deliver up to 800mA, which is more than enough for the small Atmega and parts (uses about 30-50mA only).
The word "Low-Dropout" means that the input voltage must only be 1.2 Volt higher than the regulated voltage. So 6.2V is needed for it to function properly on 5V output. But as from the datasheet, the maximum input voltage is 20V. It has internal thermal shutdown, so it could not overheat or break by current overload. This is much more better than good old LM7805 which will break and then put Vin to Vout. Heat comes from current and voltage (P=U*I). So if you drive it with 12V and 100mA for example (10mA for the regulator itself and 90mA for the board), the LDO has a waste power of 0.7 Watts ( P=(12V-5V)*0.1A). If input voltage rises to 15V the power dissipation goes up to 1W. If you need to drive a relay, 100mA is not much... let's assume 500mA and you are at 5W. No doubt that it would not do this for long! The operating temperature must be between 0°C and 125°C. Well, if you only drive in summer, or live near the polar circle, this may not a problem...
The 1117 also has no protection against overvoltage, reverse polarity, undervoltage (brown out) and no sleep mode. It also produces heat because of the nature of this regulator (not for big loads, but for reference voltages). It also has no protection for reverse current coming out of the 5V circuit (e.g. a relay).
Conclusion: The internal voltage regulator should be void for automotive use. It would not withstand the rough environment for long!
Next, we will learn how to do it right, or even better We talk about three blocks named "protection", "voltage regulator" and "ripple filter". As we learned above, we should bypass the on-board voltage regulator of the Nano. To safe power we use our own regulator and may also remove any LEDs if they never get seen by anybody.
Code: Select all
Car 12V -> [protection] -> [regulator] -> [ripple filter] -> 5V
Links and references
The listings of this electronics FAQ is somewhat like the holy bible of automotive power supplies. Read it, if you can understand it and have some days off: http://www.dse-faq.elektronik-kompendium.de/dse-faq.txt
Also this application note from Maxim gives a good overview of the problematics and how to deal with it: https://www.maximintegrated.com/en/app- ... vp/id/4240