Switching 12VDC >30A to 5VDC <0.1A

Thread Starter


Joined Nov 12, 2022

I've recently started planning a self-made ECU project, and will need a way of powering a small microcontroller (Raspberry Pi Pico or ESP32) from a small motorcycle battery.

I want to know how I can set this up, and if there is a solution that will be compact enough to fit within a small enclosure of the ECU, or even be integrated into the PCB that I'm currently designing.

Many thanks,

Please don't be too harsh, I'm quite new to this stuff.

Mitch :)
Last edited by a moderator:

Thread Starter


Joined Nov 12, 2022
Ok so what voltage is the battery and what voltage do you need for the raspberry pi, any current requirements?
Here's the specs for both the battery and the microcontroller.

Screen Shot 2022-11-12 at 7.13.32 pm.png

Microcontroller [ESP32]:
- >=5VDC to <= 10VDC
- Consumes ~100mA to 200mA


Joined Aug 21, 2008
On second thought, we are only talking about 100 ma out, so as a practical matter you can just use a plain old 78M05 linear regulator without losing much, unless efficiency is at the top of your list of requirements.


Joined Jan 23, 2018
If you choose to use a linear regulator, which will be the smallest and simplest way, but not the most efficient way, be sure to add the two recommended capacitors. Those are 0.1 microfarad rated at least 10 volts. They need to be connected quite close to the regulator.
As part of your "quite new stuff" education, you should be able to find in line the application notes for the 78M05 regulator for an explanation about why this is important AND you will see what is meant by "close."
And Welcome to the AAC forum realm.


Joined Aug 21, 2008
In addition to @MisterBill2 's notable advice, be sure to check the data sheet from the manufacturer of the particular regulator you choose, if you chose to go the LM7805 route. Recommendations for bypassing vary slightly by manufacturer.


Joined Apr 5, 2008

If you still would go for a switching regulator, have a look at these RECOM ones.
The 78E series ( Low profile (L*W*H=11.6*8.5*10.4mm)) is smaller than the 78B series ( Low profile (L/W/H=11.5 x 8.5 x 17.5mm))
See the attached datasheets for more info.




Joined Sep 24, 2015
Others have it covered. Since you're "New" to electronics, here's a few things that sometimes people don't understand. If I'm covering something you already know - don't think I'm looking down on you. Just covering one base you might not fully understand.

Your battery is capable of producing 100 CCA (Cold Cranking Amps). For a motor cycle that's probably more than enough for a small battery to turn the engine over. A battery may be capable of many amps but the electronics hooked to it may only draw a few amps. Or even a few milli-amps. Just because the battery has a high capacity doesn't mean your electronics has to deal with all that power. It's just there for when needed.

Your micro controller draws 100 to 200 mA (milli-amps). That's a part of Ohm's Law. A circuit will draw as much power as needed. The supply needs to be capable of producing enough power to run that controller. Since your battery is capable of 30A your circuit will never draw more than the 200mA it may need. If we change the 30A into milli amps - that's 30,000mA. If your circuit is drawing 200ma that should last (in theory - more about theory in a moment) 150 hours continuously. It's like having a bank account. You may have a thousand dollars in there and you write a check for $20.00, you have plenty of cash in reserve.

Now: Theory: We tend to talk about how electronics work on a theoretical basis. As an example, 30 amp hour means you can draw 30 amps for one hour - OR you can draw 1 amp for 30 hours. That's the theoretical part of it. In the real world you won't get 30 hours out of your source. There are losses due to inefficiency. Some of that energy is turned to heat energy, or other forms of energy. There ARE losses. Often for smaller circuits such losses can be ignored. But not always.

Yes, I agree, either a linear regulator with smoothing capacitors, which if this is going on a vehicle is critical, or a buck converter, which is more efficient than a regulator. The regulator will waste some of your power as heat. Insignificant in this instance, but nevertheless, it's a factor in how long your battery can power a device. A buck converter works differently. It turns on and off very rapidly. Depending on the output voltage of the converter and the starting voltage, going from 12 volts to 5 volts, 5/12ths of the time the converter is ON and 7/12ths of the time the converter is OFF. Since it is switching very fast the end result is a regulated output with a lot of savings of energy. The old school in me would opt for the regulator. Should I overcome my reluctance to change, I'd go for the buck converter. But even a buck converter is not 100% efficient. Still, some power is consumed running the electronics that drive the converter. But it's more efficient than a regulator. That's why you're reading advice that says if power consumption is a critical factor then the buck converter is the recommended approach.

Space wise, the converter @DickCappels posted - you can see there is virtually no difference. And wiring is very easy to understand. Dick's converter has a 5V 1A output. That's more than enough power and head room for your project. Assuming you're not going to draw more than 1 amp total.

Good luck with your project.


Joined Jan 23, 2014
There's a billion (give or take) USB (and proprietary phone) car chargers that contain 5V buck converters, frequently the MC34063. And they are already engineered to survive an automotive electrical environment.


Joined Jan 23, 2018
Here is an easy analogy: That 30 amp-hour battery is like the 300 horsepower engine in the car. Normally you are only using the portion of the capability that is needed for the task at hand. But the capability is there, although not used.
Possibly the explanation is useful.


Joined Jan 15, 2015
Really in the best interest of keeping this as simple as possible and modular I would go with a Buck Converter like these on Amazon or from about any parts retailer. My reasoning here is two terminals IN and two terminals Out. Nothing to solder and nothing to add. Connect to your battery source and adjust for your desired out voltage. This assumes you have a voltmeter to adjust your desired output. I can appreciate you don't need a 10 pack but figure these things average under $2.00 USD each. Quick, simple and done. The linked also give you 3.0 amps out so more than enough for any uC load and then plenty more.