Build it step by step
0 of 7 doneNumber the drawers
LED 1 for the first drawer, and so on.
Fit the strip
One LED behind each label.
Light a drawer
Test each LED in turn.
Write the list
Part name and LED number.
Serve the search page
Open it on your phone.
Light the match
Green LED on the drawer.
Add stock counts
Show how many are left.
How do you build a parts drawer finder?
Search for a part on your phone and an LED lights the drawer it is in. You need ESP32 DevKit V1, WS2812B strip 5 m (30 LEDs/m), 5 V 2 A USB adapter, Resistor 330 Ω and Electrolytic capacitor 1000 µF. It takes 7 steps and about 180 minutes.
- Level
- Intermediate
- Time
- About 180 min
- Parts
- 5
Parts list
- Development BoardsBuyESP32 DevKit V1 × 1
- OptoelectronicsBuy
- PowerBuy
- PassivesBuyResistor 330 Ω × 1
- PassivesBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| 5 V adapter plus and minus | LED strip 5V and GND | LED power |
| 1000 µF capacitor | Across the strip 5V and GND | Absorbs switching spikes |
| ESP32 GPIO5 | 330 Ω resistor to strip DIN | Data |
| ESP32 GND | Strip GND | Common ground |
| ESP32 VIN | 5 V adapter plus | Power the board |
Code
Stick one LED of a strip behind each drawer label, and keep a list that maps each part to an LED number; searching matches any part whose name contains your text and lights those LEDs in green, so searching resistor lights every resistor drawer at once. Enter your own Wi-Fi name and password in the placeholders and never share the sketch with them filled in. Only a few LEDs light at once and at low brightness, so a 5 V 2 A adapter is plenty for the whole strip; keep the power capacitor and the 330 Ω data resistor in place. The page has no password, so keep it on your home network only. Later you can add stock counts and a page for adding parts, and store the list in a file instead of the sketch.
Runs on a virtual ESP32 Dev Module in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
// Parts drawer finder: type a part name, the drawer's LED lights. Library: FastLED. Board: ESP32 Dev Module.
#include <WiFi.h>
#include <WebServer.h>
#include <FastLED.h>
const char* SSID = "YOUR_WIFI_NAME";
const char* PASS = "YOUR_WIFI_PASSWORD";
#define NUM_LEDS 40
CRGB leds[NUM_LEDS];
WebServer server(80);
struct Part { const char* name; int led; };
Part parts[] = {
{"resistor 10k", 0}, {"resistor 1k", 1}, {"capacitor 100nF", 2}, {"led red", 3},
{"nano", 4}, {"esp32", 5}, {"relay module", 6}, {"servo sg90", 7}
};
const int N = sizeof(parts) / sizeof(parts[0]);
String page(String msg) {
return "<html><body style='font-family:sans-serif'><h2>Find a part</h2>"
"<form action='/find'><input name='q' autofocus> <input type='submit' value='Light it'></form>"
"<p>" + msg + "</p></body></html>";
}
void handleFind() {
String q = server.arg("q"); q.toLowerCase();
FastLED.clear();
String found = "";
for (int i = 0; i < N; i++) {
if (String(parts[i].name).indexOf(q) >= 0 && q.length() > 0) {
leds[parts[i].led] = CRGB(0, 80, 0);
found += String(parts[i].name) + " (drawer " + String(parts[i].led + 1) + ")<br>";
}
}
FastLED.show();
server.send(200, "text/html", page(found == "" ? "Nothing found" : found));
}
void setup() {
FastLED.addLeds<WS2812B, 5, GRB>(leds, NUM_LEDS);
FastLED.setBrightness(60);
FastLED.clear(); FastLED.show();
WiFi.begin(SSID, PASS);
while (WiFi.status() != WL_CONNECTED) delay(300);
server.on("/", []() { server.send(200, "text/html", page("")); });
server.on("/find", handleFind);
server.begin();
}
void loop() { server.handleClient(); }Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Search resistor | All resistor drawers light |
| Search esp32 | Only that drawer lights |
| Nothing found | All LEDs off |
| Page | Opens on a phone on your Wi-Fi |
If it does not work
Page will not load
Check the Wi-Fi details and the IP address.
Wrong drawer lights
Check the strip direction and the numbering.
Flicker
Add the capacitor and the data resistor.
Colours wrong
Change GRB to RGB in the sketch.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the parts drawer finder?
ESP32 DevKit V1, WS2812B strip 5 m (30 LEDs/m), 5 V 2 A USB adapter, Resistor 330 Ω and Electrolytic capacitor 1000 µF.
How long does the parts drawer finder take to build?
About 180 minutes for a intermediate maker, in 7 steps.
How do I know the parts drawer finder works?
Search resistor: All resistor drawers light. Search esp32: Only that drawer lights. Nothing found: All LEDs off.
Page will not load: what should I check?
Check the Wi-Fi details and the IP address.
Wrong drawer lights: what should I check?
Check the strip direction and the numbering.
Flicker: what should I check?
Add the capacitor and the data resistor.
Colours wrong: what should I check?
Change GRB to RGB in the sketch.
