I'm very new so please forgive my lack of knowledge. I'm making a project i want to be protable so i have a 12 volt battery pack. I also have dc motor and servo along with a number of other sensors. At first i was connecting the 12v battery to the vin on the arduino then running 5v output from the 5v pin to power everything else. The problem with this set up is when the servo or DC motor turn on it creates a large power dip in the whole project as the arduino can only supply so many amps. So now I'm thinking about how to deliver power another way. I'm currently thinking i have a breadboard power supply (yes i have a breadboard in this project) that i can connect the 12v battery to. That power supply should regulate the power from 12v to 5v into the breadboard. To which i would then run a 5v line into the arduino 5v pin. That would leave the power supply to power all sensors directly and also feed a regulated 5v to the arduino. My main question then is..... can i plug the arduino into my computer usb in this configuration with all the sensors being powered as well? So can you feed a regulated 5v power into the 5v pin and also have usb connected at the same time? The goal is to make the project work on only battery power but for testing and programming would like to have it be able to constantly have both usb and battery so i don't have to plug and unplug wires everytime i want to change the programming. So if my idea won't work is there a way i can make it work? I have read the arduino docs and i understand it is "not recommended" to power arduino this way but not recommended and not possible are not the same so even though it's not recommended how can this safely be done if my current suggestion is no good?
They ain't much better than the onboard regulator of the Arduino Uno.
No, you can not feed 5V into the 5V pin and at the same time feed 5V through the USB. You do run the risk to damage something (possibly the PC).
Please provide a schematic/wiring diagram with all components (and what they are).
Depends on a couple of things, mostly the Arduino in question.
So maybe just stick to what the docs say?
Really, it can work, but it depends like I said above. If you don't feel like or can't address the nuances, stick to the docs.
One way to get what you want is to ignore the USB connection on your Arduino and instead use an USB-UART adapter (a.k.a. "FTDI cable") and connect only the RST, TX, RX and GND to your Arduino (not the 5V/Vcc). That way, you can plug/unplug the USB/FTDI to your heart's content while the Arduino keeps running on its own battery all the time.
The only issue you can foresee in this setup is that if you disconnect the battery and you connect the UART/FTDI adapter, the latter may end up powering the microcontroller on the Arduino through its UART pins. That's undesirable, so better only plug in the USB thing as long as the Arduino is actually powered.
As you can see, there are always "buts" and "ifs" no matter what you do. So the best approach is really to describe your project and specify your Arduino board and then work out a specific solution that offers the best compromise for your particular situation.
Which Arduino?
I'm using a mega 2560 with plans to change to a giga with display but for now I'm using the mega. So being totally new this is actually my first real project so I'm kinda of making this up as i go as purely a learning experience. The original goal is to just have a box or platform with a number of sensors already installed. Once built be able to play around with different programs and testing all the ways the sensors can interact. The sensors i have are temp/humidity, photo resistor, sound, voltage, RGB LED, push button, buzzer, tilt, shock, 3 potentiometer, keypad, lcd display, oled screen, ultrasonic, i2c bus with about 8 sensors, then servo, dc motor, relay latch, and led light strip. (I'm aware that's a lot and probably to much to use all at once but that isn't really the main goal) i want to have everything just pre-wired and connected so i can then just play around with uploading different codes. I don't have a schematic but what I'm doing is i have a box with everything mounted to it. Two breadboards in the middle and all wires going into the breadboard. I'm running the power rails and have all sensors powered from those power rails. Then just connecting all the signal lines directly to the arduino GPIO PINS. The led strip and relay latch require 12v power hence why i have a 12V power supply. So with all that said ideally i would like to be able to have everything powered while also having the arduino plugged into PC as i plan to change and upload code often.
Power the Mega via a diode to Vin
Do not power anything from the Mega 5V or 3.3V output.
Use a 12V to 5V buck to power whatever needs 5V
So then you're saying i can connect the 12v battery to a breadboard power supply to power the sensors at 5v and also connect 12v to the VIN pin with a diode. I'm guessing with anode side going into the arduino to prevent the Vin pin from pushing current back out into the battery? This would allow the mega to be pluged into usb simultaneously? Sorry if that's obvious I'm just trying to make sure i understand what's happening in the circuit.
All the breadboard power supplies I've seen use linear regulators, if you use one with a 12V battery you are wasting at least 7/12 of the battery, or to put it another way, measure 7/12 along the battery and draw a line there, that much of the battery is wasted. Use a buck converter as others have suggested.
Thank you for the recommendation for a buck converter. So to understand that concept, using a buck converter would extend battery life. Does it offer any other benefits in this type of set up? [quote="PerryBebbington, post:8, topic:1269180, full:true"]
All the breadboard power supplies I've seen use linear regulators, if you use one with a 12V battery you are wasting at least 7/12 of the battery, or to put it another way, measure 7/12 along the battery and draw a line there, that much of the battery is wasted. Use a buck converter as others have suggested.
A linear regulator converts excess voltage to heat, so wasting it. A buck converter 'swaps' voltage for current, with the effect that less current will be drawn from the battery, extending its life. In this case it will approximately double the battery life.
Thank you for the explanation.
So my last concept to confirm then is it safe to have 12v power to Vin with a diode and also have usb plugged in?
Yes anode to Vin. Use an SB140 or 1N5818 diode. It's there just to drop the 12V a little to around 11.7V, Not really necessary but every little bit help to keep the Mega regulator cool.
The Mega has a power supply arrangement that prevents it from attempting to power the USB host even if you feed the Arduino through its Vin pin or its 5V pin. So you can safely apply 12V to the Vin or 5V (from an external supply) to its 5V pin and at the same time connect USB. There's no need for an additional diode in this case as the Mega is protected against trying to back-power the USB host.
Use a buck converter to make 5V out of the external 12V for your modules etc. The best is to power the Arduino with this same 5V applied directly to its 5V pin. The alternative, powering the Arduino with 12V through Vin will result in the Arduino phantom powering the modules through its GPIOs if the USB is connected to the Arduino but the external 12V isn't on. You don't want this.
Thank you all for the advice!!
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.