0% found this document useful (0 votes)
11 views6 pages

VIAssignment Manick

The document outlines an assignment for interfacing an Arduino UNO with a seven-segment display to create a countdown timer from 30 to 0. It includes a list of required apparatus, safety precautions, and detailed procedures for assembling the circuit, uploading the code, and observing the output. The successful result confirms the effective integration of the components to achieve the desired functionality.

Uploaded by

manickvel60
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views6 pages

VIAssignment Manick

The document outlines an assignment for interfacing an Arduino UNO with a seven-segment display to create a countdown timer from 30 to 0. It includes a list of required apparatus, safety precautions, and detailed procedures for assembling the circuit, uploading the code, and observing the output. The successful result confirms the effective integration of the components to achieve the desired functionality.

Uploaded by

manickvel60
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

DEPARTMENT OF INSTRUMENTATION AND

CONTROL ENGINEERING

SUBJECT: VIRTUAL INSTRUMENTATION

ASSIGNMENT -2

NAME OF THE STUDENT: MANICKVEL T

REGISTER NUMBER: 22UIC022

YEAR: III SEMESTER:VI SECTION: A


ARDUINO USING TIMER IN 7 SEGMENT DISPLAY

AIM:

To interface a Arduino with seven segment display for timer.

APPARATUS REQUIRED:
 Arduino UNO R3 Board
 Breadboard
 7 Segment Display
 Connecting wires
 USB Cable for Arduino
 Computer with Arduino IDE
 Online simulation tool (Tinkercad)
PRECAUTION:

 Ensure correct wiring to avoid short circuits.


 Test the system before deploying it in a real environment.

PROCEDURE:
1. Assemble the Circuit
 Connect the 14 Digital pin to the two 7segment display
 Connect the two display source to the 5v source with 330(ohm) resistor to avoid
short circuit

2. Upload the Code

 Open the Arduino IDE and write the following code:

CODE:

#define led1_1 0

#define led1_2 1

#define led1_3 2

#define led1_4 3

#define led1_5 4

#define led1_6 5
#define led1_7 6

void setup()

pinMode(led1_1, OUTPUT);

pinMode(led1_2, OUTPUT);

pinMode(led1_3, OUTPUT);

pinMode(led1_4, OUTPUT);

pinMode(led1_5, OUTPUT);

pinMode(led1_6, OUTPUT);

pinMode(led1_7, OUTPUT);

void loop()

for (int i = 30; i >= 0; i--) {

int quot=i/10;

int rem=i%10;

displayNumber(quot,rem);

delay(1000);

void displayNumber(int m,int s){

if(m==0){

digitalWrite(led2_1,HIGH);

digitalWrite(led2_2,HIGH);

digitalWrite(led2_3,HIGH);

digitalWrite(led2_4,HIGH);
digitalWrite(led2_5,HIGH);

digitalWrite(led2_6,HIGH);

if(s==0){

digitalWrite(led1_1,HIGH);

digitalWrite(led1_2,HIGH);

digitalWrite(led1_3,HIGH);

digitalWrite(led1_4,HIGH);

digitalWrite(led1_5,HIGH);

digitalWrite(led1_6,HIGH);

if(s==9){

digitalWrite(led1_5,LOW);

digitalWrite(led1_7,HIGH);

if(s==8){

digitalWrite(led1_1,HIGH);

digitalWrite(led1_2,HIGH);

digitalWrite(led1_3,HIGH);

digitalWrite(led1_4,HIGH);

digitalWrite(led1_5,HIGH);

digitalWrite(led1_6,HIGH);

digitalWrite(led1_7,HIGH);

}
if(s==7){

digitalWrite(led1_4,LOW);

digitalWrite(led1_5,LOW);

digitalWrite(led1_7,LOW);

if(s==6){

digitalWrite(led1_2,LOW);

digitalWrite(led1_4,HIGH);

digitalWrite(led1_7,HIGH);

digitalWrite(led1_5,HIGH);

if(s==5){

digitalWrite(led1_5,LOW);

digitalWrite(led1_1,HIGH);

}
3. Upload and Run the Code

 Connect the Arduino to the computer via USB.


 Select the correct COM Port and Board (Arduino Uno) in the Arduino IDE.
 Click Upload to send the code to the Arduino.

4. Observe the Output

• When Program Get run Successful it will set a timer 30


• Timer will get decreased until it achieve to 0
WORKING DIAGRAM:

RESULT:

The 7 Segment Display is successfully interface with the Arduino UNO to


develop a timer from 30 to 0.

You might also like