Power from buck converter to Arduino Uno and Raspberry Pi 4

Hi electronics brains trust! Hope you can help me out.

I’m currently working on this project: 3D Printed WALL·E | chillibasket All the 3D parts are printed and assembled, but I am struggling a bit with the electronics. Still on a very steep learning curve!

I have connected everything up as per this diagram:


and have used one of these buck converters https://core-electronics.com.au/20w-adjustable-dc-dc-buck-converter-with-digital-display.html

As per the text above the diagram, I’d prefer to power a raspberry pi (for extra features) from the same battery by connecting it to the buck converter. Can I simply chop up an old usb cable and connect it somehow to the buck converter? Is there too much risk of frying my rasp pi 4? If I were to solder it to the buck converter, where do I do that so I can still use the standard connector for the Arduino?

3 Likes

Hi Melissa,

That’d be an interesting project! That should provide enough power for your Pi, I would suggest hooking it up in parallel immediately off the terminals of your battery on a separate circuit to the servo controller and your Uno, just to ensure that there’s no way that current gets routed through the ground of the Pi causing the board to fry itself.

Instead of powering your Pi by USB, in this case I would use the GPIO (see mode 2 from the tutorial below)

Before applying power to your Pi, you’ll want to be certain that you’re getting a stable 5V out from your buck converter, although at a current rating of max 3A at up to 20W you should have plenty of power available for your Pi at the ~5V mark. (I’d recommend maybe looking at a fixed 5V converter instead to ensure that there’s no way the converter accidentally gets adjusted through use as over the GPIO it’d almost be certain to damage the Pi, something like the regulator below is the first board that comes to mind, and can also take care of any voltage spikes which tend to be quite frequent when using motors and batteries in the same circuit)

Make sure to let us know if you have any questions regarding setting this up. I’d recommend sending through a picture here before you power it up for the first time so we can ensure that there’s nothing that can be seen that may cause an issue with the setup. All the best with your project!

3 Likes

Thanks for your advice Bryce - makes sense. So would I just need to splice the power wires to the GPIO with those that are coming out of the output from the buck converter? I’m not quite clear on the physical connection at the buck converter end.

2 Likes

Yes that’d likely be easiest, should look like this in the same way that the 12V Buck and Motor Shield are also in parallel, just lowers the risk of accidentally grounding through a pin on the Pi and frying it, if it’s regulated you ‘should’ be able to run it off the 5V passed into the servo controller, but I wouldn’t recommend it :slightly_smiling_face::

2 Likes

Oh - I think I missed a step reading through your earlier post sorry. Just to be clear, you are suggesting a second buck converter between the battery and the pi?

3 Likes

Hi Melissa,

Yes, that’s exactly what I’m suggesting, just to avoid accidentally drawing excess current either across the existing 12-5V converter, or accidentally shorting back through the servo controller, although it’s up to you.

You should still be able to run it in parallel off the 5V rail in the top centre of your Fritzing diagram, but you’ll want to be sure of how much current can run across that connection and converter, and that there’s no way excess power can cross the GPIO on your Pi depending on what you’re connecting it to.

2 Likes

Brilliant! Thanks so much for your help. I’ll give that a go and let you know what happens…

3 Likes

Excellent! It seems like the safest option to just use a separate converter for your Pi to avoid a few potential issues, although as long as those pins don’t get exposed to more than 5V it should be fine.

2 Likes

Hi Bryce - I had a go at this on the weekend, but got a bit stuck. I’ve drawn a diagram (attached) to show you where I’m at.

I understand the new connection to the pi (via the 2nd buck converter) links in to the battery after the switch. There will be a parallel connection there with half going off to the 2nd buck converter and the other to the existing XT60 double adapter I have (see photo attached) installed to connect through to the other buck converter (and servo controller) and the Arduino.

What’s the best way to make the physical connection I’ve highlighted in green on my diagram? That is - the parallel connection to the second buck. I’ve used an XT60 double adapter for the other, which is probably a bit weird but works. Do I just solder in a “t-junction” in the wires?

I have the switch there to turn off the whole system and preserve battery when not in use. The software also lets me remotely shut down the pi before turning the power off.


2 Likes

Hi Melissa,

Perhaps something like this cold splicer will work? Just check if your wires are in the gauge range it supports:

Solder joints tend to get a little messy in cases like this, but they’d likely do the job if they’re all you’ve got and the wire won’t be moving around too much.

Keen to see if anyone has different suggestions…
-James

1 Like

Hi Guys - I’m baaaaackk.

I had a buck converter in my kitbag here so used that to connect as suggested above, but the buck I had had a usb output so I connected it straight to the USB port of the pi. Problem I have now is the battery is draining really fast and so the pi loses power. I think the buck may be faulty?? The red light comes on on the buck when battery is initially connected and I got nearly 5V out of it the light off and no-one’s home.

I have ruined one of my Lipo batteries as it over drained and so is too low to recharge now. On that, I’m going off lipos altogether really. They are just too temperamental. I’m thinking maybe a separate power supply for the pi and the arduino/servos might be best?

Have you got any clever suggestions for an alternative to lipos? I don’t really want to spend a fortune on the pi-juice things I’ve seen for the pi. Not sure what I’d need if I used lithium ion or AA/9V batteries? Or how long they would last in this circuit?

I’m feeling a bit defeated by this project at the moment, so really appreciate your help.

1 Like

Hi Melissa.
The buck converter out of your kitbag with a USB output surely would have been female would it not??? How did you manage to plug it into the Pi. You haven’t by any chance connected it backwards have you ? Just a thought. Don’t know and haven’t looked into it (as your buck converter is unknown) but could this have anything with battery failure.
Cheers Bob

Hi Robert
This is the buck converter I’ve used. Then used a usb-a to usb-c cable to the pi.Hope I’ve done it right??


I’m also running out of room inside the model to put all this electronic stuff! So far I have the pi, the Arduino Uno & shield with all the plugs sticking out, the servo board, a mini speaker and 2 buck converters - let alone all the connecting cables!! I would have liked to only have one buck converter but couldn’t figure out how to get power from this usb one to the Arduino.
-M

1 Like

Hi Melissa

That implied to me that you plugged your buck converter directly into your Pi.
I now see you used a cable. That explains how you did it.
I thought that would be the case. But I thought I would raise the point to emphasise how important it is to the people trying to help for the information provide to be accurate. The people on the end of a help item can’t see what you have done.
Don’t know much about Pi or this converter so sorry I am unable to assist. Disregarding my lack of Pi knowledge I don’t see why this would not work. The only hitch would be if something was drawing too much current for the buck converter(s) to cope. You are using 2 as per your sketch aren’t you?
Cheers Bob

More Info:
I have found a usb battery pack at home with the following specs:


Is there a way I could use that to power the pi and/or rest of the circuit? It has 2 x USB ports to supply power.

1 Like

Hi Melissa,

USB battery banks are designed to be phone chargers, not power supplies so while most applications work ok with a battery bank as a power supply every now and then you will find one that behaves strangely. There are two main reasons why you might get problems:

  1. The load on the battery bank is small enough that the battery bank assumes it is a fully charged battery and cuts off the power supply.

  2. The voltage output from the battery bank may feature a lot of high frequency noise and switching artefacts. 95% of the time devices are pretty resilient and work just fine, but some devices are a bit more sensitive and can have strange errors.

Ultimately you can try it and see if it works, if you get strange errors, it may be due to one of the above issues.

1 Like