Hi all,
I'm creating my first arduino project, and I'd like to power it with a car battery; it gives 12V-DC, and I think arduino can use it, but I have some external electronic components that need 5V (lcd, relay, etc).
Can I supply 12V to arduino, to Vin pin, and get 5V from the "5V" pin for external components?
It is a simple question, but I'm a newbie and I don't wont to break my arduino
NEVER EVER hook a car batterie to an Arduino. The car batterie maybe has got 12V but about 200A. Your Arduino can not handle that huge current. Use a normal 9V batterie with a clip like this:
I've always thought that components draw "the right" current,
The same here, car battery is a nice resource, you could run arduino for a year -);. To play safe, put a fuse (1A) in a line coming from the battery. Estimate current consumption on the +5V side, with +12V input you can't get more than 200 mA , as on-board voltage regulator could overheat.
NEVER EVER hook a car batterie to an Arduino. The car batterie maybe has got 12V but about 200A. Your Arduino can not handle that huge current. Use a normal 9V batterie with a clip like this:
NEVER EVER hook a 9V battery with a clip like this to your Arduino.
Your pocket/wallet can't handle the huge cash drain that will result.
If you do want to hook your Arduino to a car battery, put a fuse in the circuit by all means, but ignore the advice not to hook it to a car battery - that's just nonsense.
The only reason NOT to attach the Arduino direct to a car battery is it's very inefficient.
I would recommend getting a car USB charger adapter and powering everything from that. They provide 5V at up to about 1A or so through a highly efficient switching regulator - and the beauty is you can just use a standard USB cable to plug the Arduino in.
Also, if you shop around, you can pick them up for just a dollar or so.
The real problem with using a car battery is that your what would have been the-size-of-a-CD robot will now be the-size-of-a-shopping-trolley-robot and the motors will drain the battery just carrying the battery around....
If you take an electricity/electronics class, the 1st thing you will learn is [u]Ohm's Law[/u]: Current = Voltage/Resistance. From then on, you'll use Ohm's Law (to some extent) in just about every electronics class and every homework assignment.
Now, we don't know the exact "resistance" of an active circuit like the Arduino (it depends on the conditions, what it's doing, and how it's connected). But, we do know that the resistance is high-enough that it will only draw milliamps.
The voltage from a car battery is (approximately) constant, but the current depends on the load. Your headlights might require 20 Amps, and the radio might take two Amps. If you turn them both on, you will draw 22 Amps. The starter might take 200 Amps.
I is the symbol for current, so with algebra we can find the 3 forms of Ohm's Law: I = V/R
**V = I x R ** R = V/I
What would be simple is to get one of the "USB phone chargers" that plug into your cigarette lighter. Then just use the USB cable into the USB port.
If you don't want to do that, use the "power jack" on the Arduino rather than the Vin pin. That protects you against getting the wires around the wrong way, and helps reduce the 12V to 11.3V which will save the voltage regulator from getting too hot, particularly if you are running other stuff off the 5V pin.
Yes, I did know there is no problem with the current, but I didn't know that arduino can reduce it by itself to 5V. Great!
And ehm.. yes, I spoke about a car battery, but not about a entire car I can't use the usb connector or similar, I have only the battery. Ok, I can buy a 6V one.. but I need to manage some solenoid valve in a field for irrigation purpose, so I need some volts. And most (and cheaper) valves are 24V, not 12V, so probably I have to use two batteries (but I will connect arduino to only one battery).
You don't have to leave the car USB adaptor inside its case - Be creative and rip it apart. It's a simple enough PCB in there - just solder wires to the input
The real danger here in using a car battery is not about too much current or voltage or whether a plug in USB power supply is OK or not (They aren't except for the same class of load as the reg on the Arduino board could handle (the NCP1117 is a 1A low dropout reg)... the real danger is from the hydrogen generated in the battery, if the battery is vented, so is the hydrogen and an air or worse oxy/hydro mix in the battery will if ignited, spread sulfuric acid about the area with a rather large force. Not highly desirable or advisable and Yes, I've done it, with a motorcycle battery... was charging it, forgot about it and put a lit cigarette near the gas discharge tube... blew up ALL over my kitchen.
Anyway back to the original question, I used to wonder if you could get "too much power" from something like a large battery (or a big power supply), but think of it like this ...
If you go into a hotel where they have a "buffet" dinner (where you help yourself) you can't have "too much food". You will stop eating when you have had enough, regardless of how many thousands of people there might be food for.
However you can have too little, like if there was a single biscuit.
So think of a power source as something you can't have too much of (current-wise anyway) but you can have too little.
Of course you can have too much voltage, or the polarity the wrong way around, or the wrong sort (eg. AC rather than DC).