This guide builds a protected automotive lighting controller using an ESP32 to drive dual front WS2815 LED strips with real-time responsiveness to vehicle inputs. The design includes galvanic isolation via optocouplers for six protected inputs (brake, turn signals, hazard, and more), a relay driver for switched power management, and a level-shifted data bus to ensure reliable communication with the addressable LEDs.
The project provides a complete wiring diagram, parts list, and modular firmware architecture covering vehicle input handling, power management, animation sequencing, and diagnostics. Assembly steps guide you through safe construction practices, including keeping the vehicle supply disconnected during wiring, verifying power rails before installing the ESP32, and performing a first-light test to confirm all systems are operational.
Wiring diagram

Gather all the parts
Assemble it in 6 steps
1. Keep the vehicle supply disconnected while wiring
Build and test the controller on a fused 12-volt bench supply first. Do not connect the PCB to the car battery while fitting parts or checking continuity.
- Set the bench-supply current limit low for the first power-up, then increase it only after checking that the 5-volt and regulated 12-volt rails are correct.
- A vehicle battery can supply enough current to melt a misplaced wire or damage the board.
2. Wire the two front LED strips
Connect the left strip +12V to the fused regulated 12-volt front-light output (power), its GND to the common ground return (ground), and its DIN to buffer output 1 through the planned 330-ohm series resistor (data). Connect the right strip +12V to its own fused regulated 12-volt output (power), its GND to the common ground return (ground), and its DIN to buffer output 2 through its 330-ohm resistor (data).
- Run each DATA wire beside a ground wire, and put the 1000-microfarad capacitor physically close to the power entry of each strip.
- Do not swap +12V and GND on a strip — reversed power can permanently damage the LEDs.
3. Wire the data buffer and relay driver
Connect the 74AHCT125 VCC to 5V (power) and GND to GND (ground). Connect GPIO18 to 1A (left data signal), GPIO19 to 2A (right data signal), and tie 1OE and 2OE to GND so those outputs are enabled. Connect GPIO23 through the planned 220-ohm resistor to the AO3400A gate (signal), its source to GND (ground), and its drain to the relay coil negative terminal (switching return). Connect the other relay-coil terminal to 5V (power).
- Fit the 100-kilohm resistor between the AO3400A gate and GND so the relay stays off while the ESP32 starts.
- Fit the flyback diode across the relay coil with its striped end on +5V; reversing it creates a short when the relay turns on.
4. Wire the six protected vehicle inputs
For each PC817 input, route the named vehicle signal through its protection parts and resistor chain to the optocoupler LED anode: ACC to pc_acc, left turn to pc_left, right turn to pc_right, lock to pc_lock, unlock to pc_unlock, and hazard to pc_hazard. Join each optocoupler emitter to GND (ground), then connect collectors to GPIO25, GPIO26, GPIO27, GPIO32, GPIO33, and GPIO34 respectively (signals). Fit a 10-kilohm pull-up from every collector to ESP32 3V3; GPIO34 especially needs this external pull-up because it has none inside the ESP32.
- Check each car wire with a meter before connecting it: this Rev.1 input circuit is for a signal that becomes positive, not a signal that is switched to ground.
- Do not connect a negative-switched LOCK, UNLOCK, or lighting wire to this positive-input circuit without changing that input stage.
5. Check rails before fitting the ESP32
With the ESP32 unplugged, verify 5V at the DevKit supply point (power), verify the LED converter is off while ACC is inactive, then apply ACC and confirm the relay closes and the LED converter output is a stable 12V (power).
- Only install the DevKit after the measured voltages are correct.
- More than 5V at the DevKit 5V input can damage the board.
6. Install the ESP32 and perform the first light test
Insert the ESP32 with its USB-C connector accessible. With ACC inactive, both strips should remain dark. Apply ACC: after about a quarter of a second the relay turns on and both lamps enter the daytime-running-light scene. Trigger LEFT, RIGHT, HAZARD, LOCK, and UNLOCK one at a time to test their scenes.
- Use the USB Serial output to see the input states, relay state, active mode, frame rate, free memory, and reset reason.
- Keep the first test at the built-in 85% brightness limit and watch the strips, wiring, relay, and converter for unusual heat.
Review all connections
1. Connections between "data_buffer" and "ESP32"
2. Connections between "front_relay_driver" and "ESP32"
3. Connections between "front_relay" and "ESP32"
4. Connections between "front_led_dcdc" and "ESP32"
5. Connections between "front_left_ws2815" and "ESP32"
6. Connections between "front_right_ws2815" and "ESP32"
7. Connections between "pc_acc" and "ESP32"
8. Connections between "pc_left" and "ESP32"
9. Connections between "pc_right" and "ESP32"
10. Connections between "pc_lock" and "ESP32"
11. Connections between "pc_unlock" and "ESP32"
12. Connections between "pc_hazard" and "ESP32"
Deploy the firmware
#include <Arduino.h>
#include "VehicleInputs.h"
#include "PowerManager.h"
#include "LightingController.h"
#include "AnimationManager.h"
#include "Renderer.h"
#include "Diagnostics.h"
#include "Settings.h"
VehicleInputs inputs;
PowerManager power;
AnimationManager animations;
Renderer renderer;
LightingController lighting;
Diagnostics diagnostics;
Settings settings;
void setup() {
inputs.begin();
power.begin();
animations.begin();
renderer.begin();
lighting.begin();
settings.begin();
diagnostics.begin();
}
void loop() {
const uint32_t now = millis();
inputs.update(now);
power.update(now, inputs);
animations.update(now);
lighting.update(now, inputs, power, animations, renderer);
diagnostics.update(now, inputs, power, lighting);
}Remix this project
Make it yours in one click
Open a full copy of this project in your own Schematik workspace, diagram, code, parts, and assembly steps included. Swap the sensor, add features, or redesign the whole thing with AI. The author's original stays untouched.




