A 3S LiPo to 5 V with an MP1584
A three-cell LiPo into an MP1584 buck module set to 5 V lights a 6 V lamp, and the output holds 5 V as the pack runs down. There is no microcontroller in it: the simulator solves the 3 parts as a circuit, so it runs the moment you press Run, and nothing needs compiling.
Teaching? Assign it to your class in one click.
Beginner About 10 minutes to build and run. Runs in your browser. Free, and no account needed.
The parts retail for about $3.50. On Mokxi they're free.
What you'll learn
- Analog
- Using the Battery: AA
- Using the MP1584 mini buck converter
- Using the Filament lamp
- Difficulty: Beginner
- Time: About 10 minutes
- Parts: 3
How it works
A three-cell LiPo into an MP1584 buck module set to 5 V lights a 6 V lamp, and the output holds 5 V as the pack runs down.
There is no code. The simulator solves Battery: AA, coin cell, LiPo, MP1584 mini buck converter, Filament lamp as it is wired, so change a value in the editor and watch the result.
Parts list
3 parts, plus the jumper wires. They retail for about $3.50; on Mokxi they're free.
Wiring table
Every connection, pin by pin, read from the circuit itself. Each row joins the pin on the left to the pin on the right, by a jumper wire or a breadboard strip.
| Part and pin | Connects to |
|---|---|
| MP1584 mini buck converter pin IN+ | Battery: AA, coin cell, LiPo pin V+ |
| MP1584 mini buck converter pin IN- | Battery: AA, coin cell, LiPo pin V- |
| Filament lamp pin 1 | MP1584 mini buck converter pin OUT+ |
| Filament lamp pin 2 | MP1584 mini buck converter pin OUT- |
The notes that come with it
There is no microcontroller in this one, so nothing is compiled: the simulator solves the circuit itself. The file in the editor is the notes that come with it.
// A 3S LiPo down to 5 V with an MP1584 buck converter.
//
// There is no microcontroller here. Press Run and the simulator solves the
// circuit.
//
// WHAT IT IS. A three-cell LiPo, 12.6 V when full and 11.1 V nominal, the
// pack a drone or an RC car runs on, into the MP1584: the tiny 22 x 17 mm
// step-down module that fits where an LM2596 board does not. Its trimmer (the
// volts property) is set to 5 V, and a 6 V, 0.3 A lamp is the load.
//
// THE NUMBERS. The module's readout says 5.0 V whatever the pack's charge,
// and the lamp glows at about half its rated brightness.
// A buck converter trades volts for amps: the pack gives a little under half
// the current the lamp takes, plus the converter's losses.
//
// THINGS TO TRY. Set the pack's charge to 10 percent: it is down to about
// 9.4 V, and the output stays at 5 V. Set the module to 6 V and the lamp reaches full brightness. Set it to
// 15 V, above the pack: a buck converter cannot step up, so the output only
// follows the input, a little under it.
//
// ON THE BENCH. Set the trimmer with a meter on OUT+ before anything is on
// the output: a module set to 12 V kills a 5 V board.
Troubleshooting
The usual mistakes with this circuit, and the fix for each.
- The battery is wired backwards, or the voltage is too low or too high for the circuit. A fresh AA is about 1.5 V, a LiPo is 3.7 V nominal and 4.2 V full. Battery: AA
Match the plus and minus marks. Check the voltage your parts need. Two AAs make 3 V, four make 6 V. Never feed a LiPo to a 3.3 V chip directly at 4.2 V. - The circuit resets or browns out when a motor or servo starts. A battery has internal resistance, so the voltage sags under load. Battery: AA
Use a fresh pack with enough current rating. Add a 100 uF or larger capacitor near the load. Power motors from their own pack and join the grounds. - The lamp is dim or does not light when driven from a board pin. Filament lamp
A lamp needs far more current than a pin gives (a pin is limited to about 20 mA). Switch it with a transistor or MOSFET from its own supply that matches the lamp's voltage rating. - The lamp's brightness lags or it burns out the switch when it first turns on. Filament lamp
A cold filament draws several times its running current at first. Size the switch for that surge, not just the steady current.
Change it and keep it
Open it in the editor, change the circuit or the code, and keep your version in a free account.