This project demonstrates the use of two LEDs along with two Push Buttons.
Objective
For one set of LED and the Push button, when button is pressed LED is set ON and when the button is released, LED will be set OFF. for the other set, its the opposite effect.
Introduction to Logic States
The Dual Button LED Controller is more than just a lighting project—it's an experiment in "Inverted Logic" and parallel sensing. By using two separate buttons to control two different LEDs in opposing ways, the user learns how to manipulate digital states—HIGH and LOW—to achieve different physical behaviors. This is the foundational logic used in manufacturing safety switches and interactive interfaces.
Hardware Infrastructure
- Arduino UNO: The central logic chip that monitors the inputs and drives the outputs simultaneously.
- LEDs (x2): These act as the visual indicators for the two different logic states.
- Push Buttons (x2): Momentary tactile switches that serve as the human inputs.
- Resistors (x4):
- Two resistors act as current-limiters for the LEDs.
- Two resistors act as "Pull-Down" or "Pull-Up" resistors for the buttons, ensuring the Arduino doesn't get "floating" signals when the buttons aren't pressed.
- Breadboard: Provides the structure needed to keep the two independent circuits organized.
Comparative Control Logic
The Arduino code runs two independent logic checks inside a high-speed loop:
- Direct Mode (LED 1):
- Action: Button 1 is pressed (
HIGH). - Result: LED 1 turns
ON. - Logic: Direct relationship (Output = Input).
- Action: Button 1 is pressed (
- Inverted Mode (LED 2):
- Action: Button 2 is pressed (
HIGH). - Result: LED 2 turns
OFF. - Logic: Inverse relationship (Output = NOT Input). If the button is not pressed, the LED remains on.
- Action: Button 2 is pressed (
Educational Value and Flexibility
This project is an excellent introduction to Boolean Operators (NOT, AND, OR). It teaches builders that code doesn't just copy a button's state; it can transform it. Once understood, this logic can be scaled to create "Safety Interlocks" (where an appliance only turns off when a button is hit) or toggle switches (where one press turns it on and a second press turns it off).