Build a battery-powered LED lantern
ActivitiesProjects
Wire a low-voltage light and switch into a portable enclosure and test that it stays lit on battery power.
Building a battery-powered LED lantern starts with pairing a portable power source, light-emitting diodes, and a protective housing. At its simplest, that takes a battery pack, an LED, and a current-limiting resistor wired in a loop. For a more involved build, a 2022 programmable lantern design combines a 3D-printed frame, a clear plastic lens, soldered electronics, and a small microcontroller that fades six flexible LED filaments independently.
From a single LED loop to six programmable filaments
The underlying electrical circuit is a series loop linking a battery, an LED, and a resistor. Orientation matters for the diode—its longer positive leg connects toward the battery's positive side—while a resistor has no polarity and can sit on either side of the LED. Because the resistor limits current to protect the diode, its value must be matched to both the LED type and the battery. When wiring multiple LEDs in this kind of circuit, each diode needs its own matched resistor rather than sharing one.
The programmable six-filament lantern scales that foundation into a rechargeable lamp with a hinged handle and a latching illuminated pushbutton. It centers on a QT Py RP2040 microcontroller, a LiIon/LiPoly Charger BFF add-on, a Perma-Proto board, M3 hardware, and a cylindrical rechargeable battery. Instead of a fixed on-off beam, the microcontroller drives each of the six flexible LED "noodles" using pulse-width modulation (PWM), allowing the filaments to fade smoothly on and off. That specific parts list is one concrete way to complete the project rather than a mandatory blueprint for every battery-powered lantern.
Printing the frame and orienting the filaments
Although the six-filament build is aimed at beginners, it requires soldering tools and access to an FDM 3D printer with at least a 90 × 90 × 50 mm build volume. Downloadable CAD and STL files provide the case, top and bottom mounting plates and couplers, covers, Perma-Proto mount, battery clip, handle, and curved noodle holders, all intended to print without supports.
Before soldering, thread each flexible filament through its holder's openings and press it into the channel along the bend. Checking polarity at this stage prevents wiring mistakes later: on these filaments, the positive anode end has a hole and the negative cathode (ground) end does not. Mark each ground end, check the color arrangement you want, and fit all six holders between the top and bottom mounting plates with matching ends aligned.
Soldering, loading code, and testing before closing the shell
Board assembly involves soldering male header strips to the QT Py RP2040, soldering stacking header pins to the Perma-Proto board, placing and soldering the charger BFF directly onto the board, and adding six 10-ohm current-limiting resistors on the ground side. That 10-ohm value is specific to these filaments and this circuit; a different LED and battery pairing calls for a resistor matched to those parts. From there, you solder ground and anode leads from each filament—plus the pushbutton and its illuminated ring—to the controller's pins and ground following the circuit diagram. Wear eye protection while trimming header pins.
Once the electronics are soldered, install CircuitPython on the QT Py RP2040, connect it with a USB data-and-power cable, and copy `code.py` from the project bundle onto the `CIRCUITPY` drive. The code sets up six PWM outputs and a switch input. Powering the lantern for its first test before sealing the enclosure should make all six filaments slowly fade on and off; if they do not light up, check that the charger BFF's built-in switch is turned on.
Wrapping the lens and routing the battery
The outer diffuser wall is a sheet of transparent plastic film or PET cut to 114 × 200 mm and no more than 1 mm thick. Use eye protection when cutting the sheet with a hobby knife, and have an adult assist younger makers. Wrap the clear film around the top and bottom plates and hold the seam closed with transparent tape. Slide the cylindrical battery into the printed clip, route the anode and button wires through the openings on the side of the clip, install the covers, and run a final circuit test. An accessible USB port feeds the charger add-on for recharging; Adafruit estimates the battery lasts several hours on a charge.
