Power supply trouble

I am working on a school project that has various components such as an LCD, 2 LEDs, a keypad, buzzer, 3 limit switches, an NO button, and 1 positional and 1 continuous servo motor. I need to have an external power supply (not use my computer via USB). I know that a typical 9V battery will not be enough to power the servo motors. I have read on this forum that it is better to use 4 AA batteries instead. I have tried 2 different options but am having problems with the batteries overheating. Here are the 2 ways I've tried:

  1. Plug a 9V battery into the Arduino Uno barrel jack connector. And also plug the 4 AA batteries into the breadboard (red to +, black to -) then have a wire from the Arduino GND to the - on the breadboard to connect the grounds. This method resulted in significant overheating of the battery. I did this because on this forum it was mentioned that you should power all the basic components with a 9V battery but you would power the servo motors using an external battery source of 4AA batteries

  2. Used the 4AA as the sole power source. Plugged the red wire into Vin of the Arduino and black wire to GND. This worked better in that the batteries didn't overheat. However, in both scenarios, the batteries got warm even though the SPST toggle switch to turn my project ON/OFF was switched in the OFF position which kept the circuit open.

I'd like to use Scenario 2 for my power supply but am unsure why the batteries would be warm when left plugged in to Vin and GND of the Arduino even though I have the SPST switch keep the circuit open. My main question is what is the best option for a power supply for my project? Would a 4AA battery holder that has a plug for the Arduino barrel jack connector work better?

This is the battery holder I am using:

And this is the wiring diagram showing how I have the batteries hooked up for Scenario 2:

How about a proper power supply that plugs into a wall socket? You can pick one that's sufficient to power your electronics and you won't have to buy new batteries all the time - or pause work to recharge them.

Your batteries overheating suggests the current draw of your circuit is beyond their capability; it would help if you could specify which motors you're using (and how many of them).

The project is a game so all the components are contained in a box and I need the power supply to also be in the box and portable so a wall outlet won't do.

I'm using 1 positional servo:

and 1 continuous servo:

Okay, then I'd just get some better batteries. Those motors don't draw much current. I can imagine you may run into trouble trying to power it all from alkaline batteries. Try AA NiMH rechargeable batteries for instance. They should do fine.

Ok, yeah I'm using alkalines and was thinking about trying a different type. The battery holder that I am using (image in original post) has some deformity from the batteries getting so hot so I am planning on buying a new one. Do you think if I get one that connects to the barrel jack of the Arduino, would that be ok to use (the one I currently have has 2 wires)? I'm considering this one:

4AA's gives 4x1.5=6V. That gives only 1V overhead for the regulator on the Uno. It'll probably work, but may be marginal. For simplicity's sake, I'd give it a go; if it works, be happy and move on.

  1. I don't see a toggle switch in your diagram, so not sure how you have it wired. I agree with rsmls that battery heat is indicative of current draw, so maybe you don't have your switch wired correctly.
  2. What is a bigger concern to me is that you have everything powered from your Uno 5V line: this may work with one SG90, but with a stall current of 650mA that one motor could fry your Uno. You really need to separate the Uno from the motors.

I just picked up four different lithium ion to 5V boost converters (each less than $2). Add a TP4056 and a Li-ion battery (< $20 investment) and you have a rechargeable, robust battery solution to power your project.

That's a valid concern, although it might not actually fry. Most likely the output will simply sag, the microcontroller may lock up/reset and the regulator will overheat and go into thermal shutdown.

The solution is simple - just power the motors directly off of the 6V from the battery pack. They're rated for 6V anyway, which is likely not a coincidence.

1 Like

I drew an arrow to show where the toggle switch is. I just have one wire connected to + and one to - of the breadboard. I was also concerned about the 5V line, but when I take it out the LCD doesn't work so I don't know how I would separate everything. I am considering your solution to not damage the Arduino, do you have any wiring diagrams that could help me see how to hook everything up? Would I just get 4 lithium ion to 5V boost converters, 4 Li-ion batteries, and 1 TP4056?

That's a 4-element dip switch array.
Anyway, if that's a switch and it's connected across - and + of your breadboard, it'll basically just short the power lines. That will heat any battery up - and the circuit won't work of course.

Just 4 AA NiMH's will do fine and will be much simpler. Feed the 6V to the Vin of the Uno and 6V directly to the motors. Power the other 5V stuff (keypad, LCD etc) from the 5V pins of your Uno.

This is the actual switch I am using. It's a Gardner Bender GSW-18.

When I plug one wire to + and one to - and have it in the off position, nothing works, but when I toggle it to on, everything does turn on and operates as they should. So the circuit does work, but I'm not sure if wiring that way is actually a bad thing?

The thing that confuses me the most is how to connect the power supply separately for the motors. If you can see on the wiring diagram, the keypad, limit switches, and NO switch are connected to the same + rail that the servos are also plugged into, so how would I only give power to the motors and not the other components?

I have a power supply module that came with my Arduino kit. Do you think I could put 4 NiMH batteries in the 4AA battery holder that can connect to the barrel jack of the power supply module and have that be my power supply?

Your method of turning off the circuit consists of shorting the power supply. That's why your batteries heat up. It's evidently not a very good way to do this, although it does arguably "work". It's a bit like turning off the lights in your home by putting a fork into the nearest wall socket. It'll blow a fuse and hey presto, the light goes out.

You wire that switch between the + of the battery and the + terminal of whatever needs to run off the battery.

You can hook up the VCC/+ wire of your motors to whatever power source you want. Not everything needs to plug into the little "power supply" PCB you posted. You could use that for the 5V part of your project if you want. It's basically the same as the regulator on your Uno, so kind of redundant. But it'll work.

1 Like

Ok this makes a lot of sense. I redid the wiring diagram to have the switch connect to the positive of the breadboard and the positive of the keypad. Does this look correct?

And also, this project is just for a school project. My team just has to have one successful demo showing all of our components working. For the demo, the circuit should only be running for about 6 minutes. And the function of both servos is to rotate 90 degrees one way then rotate 90 degrees the other way. They are not doing a ton of motion and are not on for a long time. For simplicity reasons, would it be ok to just have 4 AA NiMH batteries connected to the barrel jack of the Arduino? I know this way might hurt the Arduino instead of giving the motors their own power supply, but we really only need it to work successfully once. We also have spare Arduinos that we can swap out so we can have a fresh one for demo day.

Or would this be a way to connect the servos separately? By moving the power pins away from the + of the breadboard.

If your intention is for the switch only to cut power to the keypad and its associated shift register, then yes. If it's intended to cut power to the entire project, it'll need to go between the battery holder and the rest of the project.

It probably won't hurt; these servos are tiny. I've run MG90's that way too for test purposes.

Now that you've got the problem with the switch out of the way, I think your alkalines might actually work, too. I didn't recognize why they overheated earlier, but it was probably only because you shorted them. However, using rechargeable batteries is evidently preferable because you'll generate less waste that way.

Good job! Yes, that should work. Keep in mind you can only give up to 6V to the servos directly. So don't do this with a 9V battery, but with 4xAA, it'll be fine.

Ok this is my (hopefully) finalized wiring diagram. I need to cut power to the entire project so I moved the switch and have one wire connected directly to the 5V pin of the Arduino and the other wire connected the + of the breadboard. Then I have the 4AA batteries powering just the 2 servo motors. And I have a 9V battery that will power all the other hardware components (the 9V battery will actually be connected to the barrel jack).

Does this switch configuration work for cutting power to the entire project?

The switch will obviously not cut the power to the motors, since they're powered separately. This is probably not a big problem because the motors won't consume much power unless they're being made to run by the microcontroller. The quiescent current of the integrated motor controller is negligible for your purpose, but would be a concern if this were a real-world project that would involve optimization of battery life.

Personally I'd ditch the 9V batter and use the AA battery pack for the Arduino. Simply route the + output from the pack to the "Vin" pin on the UNO.

There's a tiny error in your diagram that is probably (hopefully) not present in your real setup: on the breadboard, you've connected the black/minus rail at the top to the red/plus rail at the bottom.

Awesome, that was going to be my next question (about the switch not cutting power to the motors), so it makes sense to just use the 4AA batteries. I'll give this setup a try. Thanks for all your help!

You're welcome; I hope it all works out as planned and you get a good assessment on the project. Please post back on how it goes!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.