Built-in project · no microcontroller

USB to 12 V for an LED strip

A USB-C charger’s 5 V into an XL6009 boost module set to 12 V lights a white 12 V LED strip that stays dark on 5 V alone. 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 $4. On Mokxi they're free.

USB to 12 V for an LED striplive0.000 s 0.00x
Click to open it in the editor
The circuit itself, running here on the simulator. Press what can be pressed; click anything else to open it in the editor.

What you'll learn

  • Analog
  • Lights
  • Using the USB power
  • Using the XL6009 boost converter module
  • Difficulty: Beginner
  • Time: About 10 minutes
  • Parts: 3

How it works

A USB-C charger’s 5 V into an XL6009 boost module set to 12 V lights a white 12 V LED strip that stays dark on 5 V alone.

There is no code. The simulator solves USB power, XL6009 boost converter module, LED strip, 12 V single color 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 $4; 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 pinConnects to
XL6009 boost converter module pin IN+USB power pin VBUS
USB power pin GNDGround
XL6009 boost converter module pin IN-Ground
LED strip, 12 V single color pin +12VXL6009 boost converter module pin OUT+
XL6009 boost converter module pin OUT-Ground
LED strip, 12 V single color pin GNDGround

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.

sketch.ino
// USB 5 V up to 12 V for an LED strip, with an XL6009 boost converter.
//
// There is no microcontroller here. Press Run and the simulator solves the
// circuit.
//
// WHAT IT IS. A USB-C charger's 5 V into the XL6009 step-up module, its
// trimmer (the volts property) set to 12 V, and 15 cm of white 12 V LED strip
// on the output: three segments of three LEDs and a resistor.
//
// THE NUMBERS. The module's readout says 12.0 V and the strip is lit. Three
// LEDs in series need about 9 V before any current flows, so a 12 V strip
// stays dark on 5 V; the boost converter is what lets a USB supply run it.
//
// THINGS TO TRY. Set the module to 9 V: the strip falls to a faint glow,
// about a fifth of its brightness. Set it to 3 V, under the input: a boost
// converter cannot step down, so the output stays at about the 5 V input
// (the inductor and diode join the two), and the strip is dark.
//
// ON THE BENCH. A module comes set to whatever the factory left it at. Turn
// the trimmer with a meter on OUT+ before the strip is connected.

Troubleshooting

The usual mistakes with this circuit, and the fix for each.

  • The voltage is not what you expect. A plain USB breakout gives 5 V only, and a PD trigger asks the charger for a set voltage like 9, 12 or 20 V. USB power
    Set the trigger to the voltage your circuit needs, and check it with a meter before connecting parts. A 5 V part on 12 V will burn.
  • The board resets or the charger shuts off when the load is heavy. USB power is limited to about 500 mA to 3 A, and cheap cables drop voltage. USB power
    Use a good cable and a charger rated for the current. Add a 100 uF capacitor on the supply. Join the grounds of every board you power.

Change it and keep it

Open it in the editor, change the circuit or the code, and keep your version in a free account.