Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

NAAN MUDHALVAN

FACULTY DEVELOPMENT PROGRAM


INDUSTRY 4.O
A report
SEQUENTIAL AND SYNCHRONIZED LED BLINKING

Submitted by

SANTHOSH KUMAR G
LECTURER
382, ADHIYAMAAN POLYTECHNIC COLLEGE,
HOSUR, KRISHNAGIRI
22 JUNE 2024
Project Title: Sequential and Synchronized LED Blinking on
Arduino Uno
Objective:

The objective of this project is to create a sequence where 10 LEDs connected


to an Arduino Uno board light up one by one for 10 seconds interval, followed
by all LEDs blinking simultaneously for 20 seconds.

Components Used:
 Arduino Uno board
 10 LEDs
 Resistors (appropriate values for current limiting)
 Breadboard and connecting wires

BLOCK DIAGRAM

Explanation of Block Diagram:

1. Start: Represents the beginning of the program execution.


2. Initialize LEDs and Pins: Initializes the Arduino's digital output pins
connected to the LEDs.
3. Sequential LED Blinking (One by One): Sequentially turns each LED
on and off in a loop.
4. All LEDs Blink Simultaneously: Turns on all LEDs together and then
off.
5. Delay 20 seconds: Introduces a delay before restarting the sequence.
6. Loop back to Sequential LED Blinking: After the delay, the program
loops back to sequentially blink the LEDs again.

Circuit Diagram:
 Connect each LED's anode (positive leg) to digital pins 2 through 11 on
the Arduino Uno.
 Connect each LED's cathode (negative leg) to ground through a current-
limiting resistor (typically 220 ohms to 1k ohm, depending on your
LEDs).

Program Logic:
Initialization:
 Define an array of integers to hold the pin numbers of the LEDs.
 Initialize each pin in the setup function as an output pin.
 Sequential LED Blinking:
 Loop through each LED pin in the defined array.
 Turn each LED on for 1 second and then off for 9 seconds sequentially.
 Simultaneous LED Blinking:
 After sequential blinking, turn all LEDs on simultaneously for 2 seconds.
 Then turn all LEDs off for 2 seconds.
 Repeat this on-off cycle for a total of 10 seconds.
 Delay:
 After completing the entire sequence (sequential and simultaneous
blinking), introduce a longer delay of 20 seconds before starting the
sequence again.

Arduino Program Code

// Pin numbers for the LEDs

const int ledPins[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11};

const int numLeds = 10;

void setup() {

// Initialize all LED pins as outputs

for (int i = 0; i < numLeds; i++) {

pinMode(ledPins[i], OUTPUT);

void loop() {

// Sequentially light up each LED for 1 second

for (int i = 0; i < numLeds; i++) {

digitalWrite(ledPins[i], HIGH); // Turn on LED


delay(1000); // Wait for 1000 milliseconds (1 second)

digitalWrite(ledPins[i], LOW); // Turn off LED

delay(9000); // Wait for 9000 milliseconds (9 seconds)

// All LEDs blink together for 10 seconds

for (int i = 0; i < 10; i++) { // Blink for 10 cycles (10 seconds)

// Turn all LEDs on

for (int j = 0; j < numLeds; j++) {

digitalWrite(ledPins[j], HIGH);

delay(1000); // Keep LEDs on for 1000 milliseconds (1 second)

// Turn all LEDs off

for (int j = 0; j < numLeds; j++) {

digitalWrite(ledPins[j], LOW);

delay(1000); // Keep LEDs off for 1000 milliseconds (1 second)

// Delay before starting the sequence again

delay(20000); // 20 seconds delay before starting the sequence again

Explanation of the Program Code:

 Initialization (setup() function):


o Initializes each pin in the ledPins[] array as an output pin to control
the LEDs.

 Loop (loop() function):


o Sequential LED Blinking: Iterates through each LED pin, turning
it on for 1 second and then off for 9 seconds.
o Simultaneous LED Blinking: After sequential blinking, all LEDs
are turned on for 1 second and then off for 1 second, repeated 10
times.

 Delay:
o After completing both the sequential and simultaneous blinking
sequences, the program delays for 20 seconds before restarting the
loop.

This code is designed to be uploaded to an Arduino Uno using the Arduino IDE.
It will operate as described in the project report, demonstrating both sequential
and synchronized blinking effects with 10 LEDs. Adjust the delay() values as
needed to achieve desired timing and effects.

Conclusion:
This project demonstrates basic control of multiple LEDs using an Arduino Uno
microcontroller. It combines sequential and simultaneous blinking effects,
showcasing fundamental programming concepts such as loops, digital output
control, and timing using delay functions.

You might also like