I volunteer and coach a high school robotics club. We are going to use a Mega 2560 to control some robot functions. Our robot runs on an automotive type 12VDC battery. It gets charges with an automotive type charger but in operation it is running on battery only, no charging. So the voltage may go to typical charged 12vdc battery levels (13.6 VDC?)
The Arduino will control 2 opto-isolated relays so effectively just lighting an LED for those 2, and control 2 external motor controllers with RC servo style PWM. SO it's output current needs are pretty low I think. I don't know what the PWM takes but the relays can probably be run with 10mA each. Those relays are for manually switched items (a trigger to activate a pneumatic valve for a few ms, and a relay to turn a light on or off.
From searching here I understand the Mega can take 12V, but I don't know if it can handle the slightly higher charged battery level. And I gather it has a linear regulator onboard to generate it's 5VDC to run on. But I see several posts with people basically advising to not use that.
I am using a terminal block "hat" to do my physical connections to the robot wiring.
My questions:
Can I power this as described with my 12DC system (possibly 14V in charged state I guess)?
Knowing (measuring) what my current needs are are there any simple electonic solutions to drop the voltage a little to make it safe (e.g. simple = a resistor).
Is that too much load on the Mega's on-board regulator to make it get too hot and be unreliable?
My alternative is if I cannot safely use the charged 12V battery as a source... I have a 5VDC regulator I purchased off Amazon to supply the 5V power everything needs. If I use that, what's the best way to power the Mega? The Mega appears to have a couple pins labelled "5V", one in the "power section of the header, one beside pin 23. Do I connect to the power section only for the "input" power? Or is that other Pin OK, too? My Hat appears to break out the 5V to several 5V terminal block connections, I will have to see where those rout to header pin-wise.
I assume I could also use the USB port to supply 5V from the regulator, will that be equivalent to using the 5V header pin?
What happens if you have 5V power to the Mega (via the header pin) and you connect your PC to the USB to update programming? That a big deal, I'd have 2 different 5V sources.
It would be great if I could use the on board power jack and 12V (or 14V) from the system battery to power it, as that eliminates the 5V regulator component, but if I can't
Thanks Larry. But I understand what's in Bill's video already. That is, I know about VRs etc. My question is specific to the Mega and powering it with my available options. Specifically if its onboard VR can handle my "12V" system, any passive method to work around the charged voltage (not a VR), and if not, what are the options for physically connecting the 5V.
Not if you draw a significant amount of power from the Mega 5V pin. Use a switching regulator to produce 5V and apply that to the 5V pin. Pololu has the best selection of switching regulators.
Keep in mind that a "12V" lead acid battery can exhibit terminal voltage > 14 V.
The Mega automatically switches between various power supplies, so it is no problem to plug it into the USB port for programming, while powering from 5V. Those two sources are isolated by the electronics. For the details, consult the official schematic from Arduino.
Suggest you feed your voltage to a Buck converter set to 7 to 9v then feed that to the Vin.
You can power the Arduino by connecting the 5v Arduino pin to an external 5v power supply; disconnect this connection when connecting the Arduino to your PC USB port.
Don't let that happen.
It's one thing to have the barrel jack and the USB connected, but you don't want to pump an external 5V source into "5V" with the barrel jack or the USB live.
I've used regulated 12v input to the barrel jack and it got uncomfortably toasty. If you have to step it down, do like others said and just take it down to 5 volts.
Use a Buck Converter to efficiently go from 12V to 5V, the Mega max IO current is 200mA so you don't need a big converter. If you want, buck down to 7V and feed that to the barrel jack through VIN and GND.
LarryD: Good video, thanks for the link. Appreciate its block circuit diagram. The covered everything except powering via the 5V pin. But I understand how that works. Looks like that could casue a 5V conflict based on their reduced block diagram as the mosfet will remain on and 5V will come from both the 5V pin and from USB. Whether or not a level mismatch there casues and issue, dunno.
You can power the Arduino by connecting the 5v Arduino pin to an external 5v power supply; disconnect this connection when connecting the Arduino to your PC USB port.
Ultimately I'll have kids operating this thing, that won't know the details of powering the board. So I need to make it as kid proof as possible. The video LarryD shared above said (for an Uno) there is a mosfet switch in the power circuit that will turn off the USB 5V in the even the board is being powered via the Vin or the DC jack. Looks to me the best 2 solutions are to
a) use a 5V buck regulator and feed the board via the USB port (wire a jack). Then if programming has to be done, the 5V in has to be disconnected in order to program
b) find a off-the-shelf 6-7V regulator (mountable device with a case), and feed the Mega via the DC power jack. Then the onboard 5V regulator doesn't have to step it down much and generate heat.
a) is probably the easier route. And I already have the 5V regulator.
Arduino 5V is where you put regulated (converters count) 5V.
VIN goes to the onboard regulator which check that it may be a buck converter. There are also transistor-factor 5V-3V buck devices, and you will want 3.3V for SD and many modules. The 74HC4050 levels 5V to 3.3V on 6 channels, it's a lot cleaner and more efficient than 6 voltage dividers!
Look for OEM power supplies with screw-adjustable output voltages. A 60W brick used to run about 8 bucks. You can set up metal boxes/frames as common open ground and insulated thicker wires as power buses, red for 5V, yellow for 12V kind of thing.
Robots should be mudular. The cost of boards limits that.. but I will link you to examples of the board parts wired onto bare Uno chips after showing how little is needed and the how-to included at the bottom.
Nick Gammon on making your own duinos.
The second example is a DIP AVR with 16KB RAM, 2 serial, 32 IO pins that sold for $5.50 ea in 2019.
There are ATtiny chips to do small work, they program similar.
The UNO chip ATmega328P has a family of pin-compatible with less storage versions. The 168 has 16K flash, 1K RAM, 512B EEPROM, half of the 328. The 88 has half that and the 48 has 256B RAM, etc...
and they all can work on an UNO after bootloading.
The failed Obaka Arduino, where the goal of Obaka is to make a useless thing. It failed when it was plugged into a breadboard it becomes useful. Be sure to see the Evo!