Experiment 5

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

Experiment No 5

Title: Interfacing seven segment display with Arduino Board Session Date: 16/07/2022

Submission Due: End of laboratory class, submit the lab reports at least 10 minutes before the
end of laboratory class.
Total Marks = 10 marks
Marks will be given only to students who attend and participate during 2-hour laboratory class.
Submission on Google classroom is mandatory as an evidence of participation.

Marking Criteria:

Task Details Submission Requirements Marks


Task: Source Code: Copy the 5
Interface seven segment source code in the word file
displays to Arduino board Program Output: Copy the 5
and simulate the results in output in the same world file
Tinkercad.

Student Name ID

Course Code: ELE303 Prepared By : Dr.Rafe & K.Haritha


AIM:
 Create a circuit to interface seven segment displays with Arduino board.
 Simulate the program using tinkercad and find the results.

COMPONENTS :

 Arduino Uno board


 Seven Segment display
 Resistors

THEORY
The Arduino Uno is an open-source microcontroller board based on the
Microchip ATmega328P microcontroller and developed by Arduino.cc. It has 14 digital
input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz
ceramic resonator, a USB connection, a power jack, an ICSP header, and a reset button.
It contains everything needed to support the microcontroller; simply connect it to a
computer with a USB cable or power it with an AC-to-DC adapter or battery to get
started.

Seven-Segment Display:

A Seven-Segment Display (SSD) is a widely used electronic display device for displaying


decimal numbers from 0 to 9. They are most commonly used in electronic devices like
digital clocks, timers and calculators to display numeric information.
The 7-segment display, also written as “seven segment display”, consists of seven LEDs
(hence its name-A, B, C, D, E, F, G) arranged in a rectangular fashion as shown. Each of
the seven LEDs is called a segment because when represented the segment forms part
of a numerical digit (both Decimal and Hex) to be displayed. An additional 8th LED is
sometimes used within the same package thus allowing the indication of a decimal

Course Code: ELE303 Prepared By : Dr.Rafe & K.Haritha


point, (DP) when two or more 7-segment displays are connected together to display
numbers greater than ten.

CONNECTION DETAILS

Course Code: ELE303 Prepared By : Dr.Rafe & K.Haritha


PROGRAM:
byte pins[8] = {2,3,4,6,7,8,9}; // The digital pins that we are using
int duration = 1000; // The delay between the number changes

byte num0 = 0x3F;


byte num1 = 0x0C;
byte num2 = 0x5B;
byte num3 = 0x5E;
byte num4 = 0x6C;
byte num5 = 0x76;
byte num6 = 0x77;
byte num7 = 0x1C;
byte num8 = 0x7F;
byte num9 = 0x7E;

void printN(byte _digit) { // The function that prints the numbers


for (int i = 0; i < 9; i++) {
digitalWrite(pins[i], bitRead(_digit, i ));
//Serial.println(pins[i] + ' w ' + bitRead(_digit, i ));
}
}

void setup() {
Serial.begin(9600);
for(int i = 0; i <= 9; i++) {
pinMode(pins[i], OUTPUT);
//Serial.println(pins[i]);
}
}

Course Code: ELE303 Prepared By : Dr.Rafe & K.Haritha


void loop() {
printN(num0); delay(duration);
printN(num1); delay(duration);
printN(num2); delay(duration);
printN(num3); delay(duration);
printN(num4); delay(duration);
printN(num5); delay(duration);
printN(num6); delay(duration);
printN(num7); delay(duration);
printN(num8); delay(duration);
printN(num9); delay(duration);
}
 PROCEDURE:
1. Start Tinkercad
2. Pick the following components from library
a. Arduino UNO board
b. Seven segment display
c. resistors 220 ohm
3. Make circuit as per the circuit diagram. Save the design.
4. Write the code in tinkercard text editor.
5. Click the simulator button after verifying the circuit.
6. Observe the results and attach it in the given area of your manual.

Course Code: ELE303 Prepared By : Dr.Rafe & K.Haritha


RESULT

Attach Tinkercad simulation result:

Course Code: ELE303 Prepared By : Dr.Rafe & K.Haritha


CONCLUSION:
Interfaced seven segment displays with Arduino board.

Course Code: ELE303 Prepared By : Dr.Rafe & K.Haritha

You might also like