A simple Arduino project that controls 3 LEDs using 3 push buttons with toggle functionality.
- Independent Control: Each button controls its own LED
- Toggle Function: Press once to turn ON, press again to turn OFF
- Debouncing: Prevents multiple triggers from button bounce
- Clean Code: Array-based structure for easy modification
- 1x Arduino Uno
- 3x LEDs
- 3x Push Buttons
- 3x 220Ω Resistors (for LEDs)
- 3x 10kΩ Resistors (for buttons)
- Breadboard
- Jumper wires
LED | Arduino Pin | Resistor | Connection |
---|---|---|---|
LED 1 | Pin 13 | 220Ω | Pin 13 → LED+ → LED- → 220Ω → GND |
LED 2 | Pin 12 | 220Ω | Pin 12 → LED+ → LED- → 220Ω → GND |
LED 3 | Pin 11 | 220Ω | Pin 11 → LED+ → LED- → 220Ω → GND |
Button | Arduino Pin | Pull-down Resistor |
---|---|---|
Button 1 | Pin 2 | 10kΩ to GND |
Button 2 | Pin 3 | 10kΩ to GND |
Button 3 | Pin 4 | 10kΩ to GND |
Button Wiring: 5V → Button → Arduino Pin + 10kΩ resistor to GND
- Press Button 1 → LED 1 toggles ON/OFF
- Press Button 2 → LED 2 toggles ON/OFF
- Press Button 3 → LED 3 toggles ON/OFF
- Each LED operates independently
- Multiple LEDs can be ON simultaneously
led_button_controller.ino
- Main Arduino codecircuit_diagram.png
- Wiring diagramdemo_video.mp4
- Working demonstration
- Wire the circuit according to the diagram
- Upload the code to your Arduino
- Press buttons to control LEDs
- Enjoy your LED controller!
Click to watch the working demonstration
- Debouncing algorithm prevents button bounce
- Array-based design for easy scaling
- Toggle functionality with state memory
- Clean, commented code for learning
- Digital I/O control
- Button debouncing techniques
- State management
- Array usage in Arduino
- Circuit design basics
Open source - feel free to use and modify