Building a Simple USB Flashlight
Overview
This tutorial will walk you through building a simple USB flashlight using tscircuit. The circuit takes 5V from a USB-C connector, routes it through a pushbutton, and lights an LED through a current-limiting resistor.
What You Will Build
The finished board has four parts:
- a USB-C connector for power input
- a normally-open pushbutton for user control
- a resistor to limit LED current
- a red 0603 LED as the light source
Circuit Requirements
This small flashlight needs to:
- connect USB VBUS to the button input
- connect the button output to the LED through a resistor
- return the LED cathode to USB ground
- keep the board narrow enough to behave like a small USB accessory
Building the Circuit Step by Step
Step 1: Add the USB-C Power Input
Start with a small board and place the USB-C connector near one end. The VBUS pins provide the 5V rail and the GND pins provide the return path.
Step 2: Add the Pushbutton
The pushbutton sits between USB VBUS and the resistor. Pressing it completes the positive side of the LED circuit.
Step 3: Add the LED and Current-Limiting Resistor
The resistor protects the LED by limiting current. A 1k resistor is a safe,
conservative value for a small indicator-style USB flashlight.
Final Notes
Use the 3D preview to check that the connector, button, resistor, and LED are spaced comfortably on the board. For a brighter flashlight, lower the resistor value after checking the LED's current rating and the available USB power.