automotive electronics
Factory-Style Cargo Bed Lights
A small ATtiny85 controller that retrofits cargo bed lighting onto a truck that never shipped with it, built to match the factory look and feel as closely as possible.
Why it exists
My truck didn't come with the factory cargo bed lights. Not just the lamps: the button, the wiring harness, and even the ports and logic to control the lights were all missing, so adding the factory hardware alone wouldn't have brought the feature to life. If I wanted cargo lighting that looked and behaved like it came from the factory, I had to build the brains myself.
The controller the truck never had
The replacement brain is an ATtiny85 running a small Arduino sketch. A momentary push button, debounced in software, toggles the bed lights through a logic-level MOSFET that switches the 12V LED strips, and a status LED mirrors the light state so you can tell at a glance whether the bed is lit.
The details are what sell the factory feel. Instead of snapping on and off, the lights fade smoothly over a quarter second, and a ten-minute auto-timeout shuts them down if they're left on, so a forgotten button press can't drain the battery overnight.
Living in a truck bed
The install has to survive the real world: the controller lives in a weatherproofed enclosure, draws from a fused 12V accessory connection, and grounds to the chassis. The goal from the start was, as the README puts it, factory-quality cargo lighting control without factory pricing, but with factory-like (or better) function.