I would like to power my Arduino Mega from 12V battery and provide different voltage levels for his shield.
+12V: for futher use,
+9V : for MEGA Vin or other MEGA Vin
+5V : for sensors, 4x20 LCD panel
+3V3: or PS2 controller, IMU, XBee,
The total current consumption is less than 500 mA.
Before I'm going to finalize the PCB, kindly give your comments to the attached schematic.
If you are going to provide 5 V - preferably using a switchmode "buck" regulator, then use that to power the Mega 2560 because that is what it actually requires!
Just silly to use a regulator to feed the onboard regulator in order to get the needed 5V.
Read the line above, Operating Voltage 5V Those 5 volt You apply to the 5 volt pin. This is the case if You power the board by USB.
Make a search for "Arduino + power"! You will find tons of topics telling just this: The preferred, the recommended, way of supplying power is via the Vcc pin, for some controllers 5.0 volt, for some 3.3 volt.
Yes, that is a longstanding problem. That is a piece of nonsense written by the Arduino authors "way back when" and never updated. It seems to be a sort of religious belief or something like that!
"Stock" explanation:
A very real danger is that the obsolete tutorials on the Arduino site and others misleadingly imply that the largely ornamental "barrel jack" and "Vin" connections to the on-board regulator allow a usable source of 5 V power. This is absolutely not the case. It is essentially only for demonstration use of the bare board back in the very beginning of the Arduino project when "9V" transformer-rectifier-capacitor power packs were common and this was a practical way to power a lone Arduino board for initial demonstration purposes. And even then it was limited because an unloaded 9 V transformer-rectifier-capacitor supply would generally provide over 12 V which the regulator could barely handle.
If you are asking this question, it is highly likely that you will wish to connect something else. In which case, the answer is regulated 5 V.
This is because the on-board regulator is essentially capable of powering only the microcontroller itself and no more than a couple of indicator LEDs. The on-board regulator might be able to power a few other things if it had a heatsink, but on the (older) Arduinos, it does not.
Powering via the "barrel jack" or "Vin" connections is asking for trouble. The "5V" pin is not by any means an output pin, if anything a "reference" pin but most certainly the preferred pin to which to supply a regulated 5 V.
A practical power supply for the Nano (or UNO, Pro Mini, Leonardo etc.) is a "phone charger" with a USB output connector for 5 V, generally up to a couple of Amps though you can not feed more than 500 mA through the USB connection.
If you want to power it from 12 V or a car system, you need a 5 V switchmode "buck" regulator to supply the 5 V.
@ Paul__B: Thank You very much for Your very detailed explanation.
(It is very surprising for me and I think good learning point for the other Arduino users as well.)
Just for clarification, I attached a picture (first). Please check. Is it what You thought ?
Apart from pin # "5V", can I use the one of the two "5V" pins next to pin # 22 & 23 ? (See second picture.)
Top left in the diagram you will see the barrel jack connects through a reverse protection diode to a 5V regulator.
From MegaQuickRef - ArduinoInfo
VIN. The input voltage to the Arduino board when it's using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.
5V. This pin outputs a regulated 5V from the regulator on the board. The board can be supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it.
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.
"We don't advise it." Could potentially cause problems if USB powered? Lets see;
Top left in the diagram you will see the barrel jack connects through a reverse protection diode to a 5V regulator.
Bottom right is the USB connector where XVcc connects to USBVCc through a fuse link.
Bottom centre a FET disconnects the USB +Vcc if its powered from the barrel jack; I dont entirely understand what is going on here but there is a diode across the FET that would appear to provide reverse current protection to the USB port.
@Paul_B can you clarify what that bit does? I'm guessing:
if Vin is present T1 is OFF and the diode (and FET) prevents reverse current flow;
if V1 absent T1 is ON
however if +5V > USBVcc T1 will turn OFF and the diode (and FET) prevents reverse current flow;
In which case I see no issue in powering the MEGA from the 5V connectors - which are all connected together. (So are all the 0V GND)
There is no benefit in dropping 12V - 9V - 5V through linear regulators; it just wastes power from your battery; also as the battery voltage drops you would lose the regulation on the 9V. So better to use a buck regulator to drop the 12v to 5V.
If your battery voltage exceeds "15V" (zeners arent that precise) you would blow the fuse (or zener);
also if the 12V out is just to be used to sense the voltage I'd be inclined to put the divider on the board so the unregulated (but fused) 12V does not get used for something else.
thank You very much for Your swift respond.
In the same time, I was just checking the 'same' schematics. What a coincidence !
I found that the Vin pin is connected before the voltage regulator MC33269 (see on the attached sketch).
Therefore the same voltage can be used on pin # "Vin" as on barrel jack (7-12 V).
But not that one! It shows the second side of the op-amp unused whereas in the proper Mega it buffers the pin 13 LED so there is no loading on pin 13. And it calls the FET "T2" - but there is no "T1"!
Correct version of the current Mega. And actually readable to boot!
johnerrington:
"We don't advise it." Could potentially cause problems if USB powered?
Well, there is a concern. ...
But most certainly not a reason to consider using "Vin".
johnerrington:
Bottom centre a FET disconnects the USB +Vcc if its powered from the barrel jack; I dont entirely understand what is going on here but there is a diode across the FET that would appear to provide reverse current protection to the USB port.
@Paul_B can you clarify what that bit does? I'm guessing:
if Vin is present T1 is OFF and the diode (and FET) prevents reverse current flow;
if V1 absent T1 is ON
The FET is a P-channel, so turns ON with a negative gate voltage. It is here deliberately used with source and drain swapped (which is perfectly effective) in order that the intrinsic diode does prevent reverse current flow.
johnerrington:
however if +5V > USBVcc T1 will turn OFF and the diode (and FET) prevents reverse current flow;
What makes you think that? The comparator is only comparing a fraction of "Vin" to 3.3 V - nothing to do with the 5 V connections. The FET is turned ON and will conduct current from source (5V) to drain (VccUSB).
johnerrington:
In which case I see no issue in powering the MEGA from the 5V connectors - which are all connected together. (So are all the 0V GND)
Unless "Vin" is powered, the FET will turn on and permit back-flow into the USB port. This of course only happens where the external 5 V source is a higher voltage than the USB is supplying.
johnerrington:
So better to use a buck regulator to drop the 12v to 5V.
Most certainly! the on-board regulator - with virtually no heatsink anyway - is essentially useless.
So powering and Arduino via the 5V pin has come a long way from "not recommended" to "recommended" :o
There has been Arduino users that blew the voltage regulator (reverse peak current to charge the capacitor), and current flowing into the computer via the USB wire is not very nice.
I use the 5V pin myself to power the Arduino, because the advantages are obvious when a DC/DC-converter is used or when the whole project runs at a 5V power supply.
The Arduino team has to change the design to allow this, for example a limiting filter at 5V and preventing that current will flow in the computer. We need version R4 of the boards !
first of all thank You very much for Your suggestions and guidance in this subject.
I made a draft diagram based on the above feedbacks.
Kindly check and if some modification or improvement required, please share.
One solution for many applications is to use a Mega version that has upgraded power capabilities onboard including switchmode 5V 2A regulator onboard and improved 3.3V regulator, that can run from a +12V supply.
I have the same regulator from the same builder on thousands of the RoboRED SEE HERE They were making a version for me with all those pins and updated board artwork (Including my wife's 'robot'!) and they said they "Probably had another upgrade coming too if they could get it in my version". That was the 5V2A regulator! Love it.
Last time we met with them in China I suggested that it would be great to have a MEGA with that regulator. Their main tech guy nodded briskly and the manager said "We're working on that". Really nice people, excellent engineering, clean factory with good working conditions. When my wife and I and our partner in Shenzhen came in, the manager met us and she was holding a new Grandchild. Many family businesses in China!
And the board build quality is excellent every time. I just got several hundred small sensor modules to make kits for the University of Vermont EE101 course and they are all the same high quality PC Board build.
As you can probably tell, I love doing this stuff.
@terryking228, What programmer does not check the links of a message he just posted ? Ha ha, sorry, just having fun with you.
Please fix your Amazon link: Amazon.com
And can we please avoid clicking the "Prevent this page from creating additional dialogs" checkbox when posting links. It is a useless function but a real nuisance when browsing the forum.
@terryking228: thank You very much for Your comment. I was not aware with this board.
One more reason why we need revision 4 from Arduino.
As I see, even the supplied current it can go further:
NSP1117 – 1A
AMS1117 – 1A
MP2307DN – 3A !
MP2308DN – 4A
My case a little bit more complex, so I would like to design the extra PCB (shield).
I made one step further on the shield.
May be some diode required between A&B points (reverse diode over the voltage regulator) or other improvements ?
Your positive comments are truly appreciated.
Thank You !
Koepel: @terryking228, What programmer does not check the links of a message he just posted ? Ha ha, sorry, just having fun with you.
Well NOW I checked it But I'm an Engineer, not a Programmer. About 1980 I did take a job with the "IS" ("IT" these days) department at IBM. My Engineer friends said "You Joined the Other Side!".. But it was a job offer I couldn't refuse.
The 3rd level manager actually said to me "I'm looking for a Hardware Guy to run Amok among the Software Guys".. I am Your Guy!