Project Colaboration

 Hello, my name is Hilal Bintang. Today I would like to explain my recent project. It's called "Running LED Lamp with Arduino". This project using one of automation's concept that we used to see in every tool with a button.


Before proceeding to the next discussion, allow me to explain in advance how to make this circuit.


1. Prepare all the required components.

2. Connect the VCC on the breadboard with the VCC (5v) pin on the Arduino using a male to male jumper cable.

3. Connect the ground on the breadboard with the ground pin on the Arduino.

4. Connect the push button terminal 1 to pin eight (8) on Arduino and connect it to terminal 1 resistor.

5. Connect the resistor 2 terminal to the breadboard ground.

6. Connect the push button 2 terminal to the VCC breadboard.

7. Connection of led lamp 1 (anode section) with pin 7.

8. Connection of led lamp 2 (anode part) with pin 6.

9  Connection of led lamp 3 (anode section) with pin 5.

10. Connection of led light 4 (anode section) with pin 4.

11. Connection of led lamp 5 (anode part) with pin 3.

12. Connect all the LEDs (ground) to the ground on the breadboard.


After ensuring all the circuit is neatly and correctly, we move on to writing the command. You could see the syntax script below:


const int pushbutton = 8;        //deklarasi push button

const int led1 = 7;            //deklarasi lampu led 1

const int led2 = 6;            //deklarasi lampu led 2

const int led3 = 5;            //deklarasi lampu led 3

const int led4 = 4;            //deklarasi lampu led 4

const int led5 = 3;            //deklarasi lampu led 5

int button = 0; //deklarasi variabel button


void setup()

{

  pinMode(pushbutton, INPUT); //inisialisasi push button

  pinMode(led1, OUTPUT); //inisialisasi led 1

  pinMode(led2, OUTPUT); //inisialisasi led 2

  pinMode(led3, OUTPUT); //inisialisasi led 3

  pinMode(led4, OUTPUT); //inisialisasi led 4

  pinMode(led5, OUTPUT); //inisialisasi led 5

}


void loop()

{

  button=digitalRead(pushbutton); //Membaca pushbutton

  

  if(button == HIGH){ //jika push button ditekan

  digitalWrite(led1, HIGH);        //Menyalakan lampu led 1

  digitalWrite(led5, HIGH);        //Menyalakan lampu led 5

  delay(1000);                //jeda waktu 1 detik

    digitalWrite(led2, HIGH); //Menyalakan lampu led 2

    digitalWrite(led4, HIGH); //Menyalakan lampu led 4

    delay(1000);            //jeda waktu 1 detik

    digitalWrite(led3, HIGH); //Menyalakan lampu led 3

    delay(2000);            //jeda waktu 2 detik

    digitalWrite(led3, LOW);        //Mematikan lampu led 3

    delay(1000);            //jeda waktu 1 detik

    digitalWrite(led2, LOW);        //Mematikan lampu led 2

    digitalWrite(led4, LOW); //Mematikan lampu led 4

    delay(1000);            //jeda waktu 1 detik

    digitalWrite(led1, LOW); //Mematikan lampu led 1

    digitalWrite(led5, LOW); //Mematikan lampu led 5

    delay(2000); //jeda waktu 2 detik

  }else if(button == LOW){ //Jika push button dilepas

    digitalWrite(led1, HIGH);        //Menyalakan lampu led 1

    digitalWrite(led2, HIGH); //Menyalakan lampu led 2

    digitalWrite(led3, HIGH); //Menyalakan lampu led 3

    digitalWrite(led4, HIGH); //Menyalakan lampu led 4

    digitalWrite(led5, HIGH); //Menyalakan lampu led 5

    delay(100);                //jeda waktu 0,1 detik

    digitalWrite(led1, LOW);        //Mematikan lampu led 1

    digitalWrite(led2, LOW);        //Mematikan lampu led 2

    digitalWrite(led3, LOW);        //Mematikan lampu led 3

    digitalWrite(led4, LOW);        //Mematikan lampu led 4

    digitalWrite(led5,LOW);        //Mematikan lampu led 5

    delay(100);                //jeda waktu 0,1 detik

 }

}


If there aren't any mistakes, the circuit is ready to be used.


Push-button function as an input to differentiate each command. We must create two conditions. There is the first condition when the push-button is on, and the second one when push-button is off. When the push-button is on, the LED lamp will begin to lights up from the left side. Otherwise, when the push-button is off the LED lamp will start to lights up from the right side. In this project, fortunately, we didn't see any deficiency in how it works. The excellence of this programme already does the task automatically.


In the end, we as technology activists must understand the basics of automation and digitization. In the future, we'll be looking out for advances in the technology industry that always want the latest innovations. This running LED lamp is one of the basic concepts of automation. By learning the basic, we could improving our skill and be ready to create an innovation.

Komentar