Light Stair Button with Arduino

Introduction

Imagine a world where the mere press of a button breathes life into a staircase, painting its steps with a captivating luminance. This article takes you on a journey into the enchanting realm of the ‘Light Stair Button with Arduino,’ where an Arduino Nano, a relay, push buttons, and a collection of other components collaborate to create a functional yet poetic ambiance.

Hardware Required

Components#Buy From Amazon
Arduino Nano1Buy Now
Relay1Buy Link
Push Button2Buy Now
Light Bulb1Buy Link
Resistors 1K1Buy Link
9v DC Adapter (Optional)1Buy Link
Jumper WiresFewBuy Link
Breadboard1Buy Link

What is Relay?

A relay is an electrically operated switch that consists of a coil and one or more sets of contacts. When a current flows through the coil, it creates a magnetic field that causes the contacts to move and make or break a connection between two circuits. The contacts of a relay are often referred to as poles, and the state of the contacts is either normally open or normally closed.

Pinout of Relay

KY-019-Relay-Module-Pinout-Diagram

The Normally Open (NO) contact is a type of contact that is open (not making contact) when the relay is not energized. When the relay is energized, the NO contact is closed, and current can flow through the circuit. The NO contact is used in applications where you want to interrupt the circuit when the relay is activated.

The Normally Closed (NC) contact is a type of contact that is closed (making contact) when the relay is not energized. When the relay is energized, the NC contact is opened, and the circuit is interrupted. The NC contact is used in applications where you want to maintain a connection between the circuits when the relay is not activated.

Pin Configuration

Pin NamePin Type
SSignal Pin
(+) MiddlePower Pin
( – )Ground Pin
NONormally Open
COMCommon
NCNormally Closed

Circuit Diagram

The following circuit shows you the connection of the Light Stair Button with Arduino, Please make the connection carefully

Light-Stair-Button-with-Arduino-Circuit

Working

The heart of this creation lies in the Arduino code, a language that orchestrates the interaction between components. It’s a symphony where the push of a button becomes the conductor’s baton, directing the relay to either complete or disrupt the flow of electricity. This dynamic unfolds through the LED pins, casting light upon the stairs.

The push buttons act as the intermediaries between the human touch and the digital realm. As a button is pressed, it communicates with the Arduino Nano, unveiling the artistry of electrical currents and circuits. The result is a mesmerizing interplay of light and shadow, akin to a poetic stanza in the realm of technology.

Installing Arduino IDE Software

First, you will require to Download the updated version of Arduino IDE Software and Install it on your PC or laptop. if you Learn How to install the Arduino step-by-step guide then click on how to install Arduino Button given Blow

Code

//For more Projects: www.arduinocircuit.com

const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 10; // the number of the LED pin

// variables will change:
int buttonState = 0; // variable for reading the pushbutton status

void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
}
int on = 0;
unsigned long last = millis();
void loop(){
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
if (millis() – last > 250) {
on = !on;
digitalWrite(ledPin, on ? HIGH : LOW);
}
last = millis();
}
}

Applications

  1. Home Staircases: Illuminate indoor staircases, enhancing safety and providing an elegant ambiance with the touch of a button.
  2. Outdoor Pathways: Light up outdoor pathways and walkways, guiding individuals through gardens or dimly lit areas, offering both safety and aesthetics.
  3. Public Spaces: Implement in public spaces like libraries or theaters, offering a subtle yet guiding light for visitors navigating various levels or sections.
  4. Workplace Safety: Enhance safety in workplaces by installing these systems on emergency staircases or dimly lit corridors.
  5. Art Installations: Utilize creatively in art installations, where light plays an integral role, adding an interactive and visually captivating element to the exhibit.

Conclusion

It’s not just about illuminating steps; it’s about illuminating imaginations, inviting progress, and guiding with a gentle touch. This enchanting creation is a reminder that in the realm of electrons and light, we find the magic of transformation—a touch that turns the mundane into the extraordinary.

Leave a Comment


error: