This project uses an ATtiny microcontroller to control a NeoPixel LED connected to pin 12. A potentiometer is used as an analog input to adjust the LED brightness or color value, while a push button is used to switch between different lighting modes. A 1µF capacitor is added across the NeoPixel power line for protection and stable operation. The ATtiny reads the potentiometer, changes the NeoPixel color accordingly, and moves to the next effect whenever the button is pressed. This setup creates a compact LED controller using very few components.
Basic Circuit Connections:
1. NeoPixel (WS2812)
NeoPixel Pin ATtiny / Power
5V 5V supply
GND GND
DIN ATtiny Pin 12
1µF capacitor Between 5V and GND near NeoPixel
2. Potentiometer (10k)
Pot Pin Connect To
Left pin 5V
Right pin GND
Middle pin ATtiny analog pin (A1)
3. Push Button
Button Pin Connect To
One side ATtiny digital pin (e.g., pin 2)
Other side GND
Pull-up Use internal pull-up in code
Logic
Potentiometer → controls brightness or color
Button → switches modes
NeoPixel → displays selected lighting effects