Vous êtes sur la page 1sur 11

DEPARTMENT

OF
ELECTRONICS AND COMMUNICATION ENGINEERING

Assignment-3
for
UTA013 Engineering Design Project-I
(02/02/2018)

Name: Hardeep Singh


LAB Teacher: DR Rishikesh Pandey
Roll No: 401758001
Group: - C-3
BCD (binary coded decimal) to 7 Segment Display

The decoder (CD4543) is a combinational digital circuit that decodes an 4-bit binary
input in the range 0000-1001 (BCD) in to its corresponding decimal level. Example for the
binary value 0101 we need to display 5. Hence the decoder will output a HIGH on
segments (a,c,d,f and g) with output a LOW on segments (b and e). The latch signal is
normally connected to 5V via 10Kohm resistor as per the circuit diagram.
This allows the decoder to decode the present binary input (the latch is said to be in a
transparent state). When the latch is connected to 0V via the jumper provided its logic
state changes to a LOW and the decoder will decode the binary input prior to the latch
going low (i.e. the display is frozen when the latch is LOW).

Pinout of CD4543 IC

Function Table for the CD4543B IC


ASSIGNMENT - 2
Study to display the digits on seven segment display
Exercise 1 – Write an Arduino program to make an integer up counter i.e. 0 to 9 & repeat it
infinitely. Display the digits using BCD code on the 7-segment display kit.
Hardware Required

 Seven Segment Display Kit



  Arduino Board
 Single core connecting wires

Theory : BCD (binary coded decimal) to 7 Segment Display


The decoder (CD4543) is a combinational digital circuit that decodes an 4-bit binary
input in the range 0000-1001 (BCD) in to its corresponding decimal level. Example for the
binary value 0101 we need to display 5. Hence the decoder will output a HIGH on
segments (a,c,d,f and g) with output a LOW on segments (b and e). The latch signal is
normally connected to 5V via 10Kohm resistor as per the circuit diagram.

Pinout of CD4543 IC
This allows the decoder to decode the present binary input (the latch is said to be in a
transparent state). When the latch is connected to 0V via the jumper provided its logic
state changes to a LOW and the decoder will decode the binary input prior to the latch
going low (i.e. the display is frozen when the latch is LOW).

Function Table for the CD4543B IC:


Code:
void setup()
{
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
}
void loop()
{
digitalWrite(3,LOW);
digitalWrite(4,LOW);
digitalWrite(5,HIGH);
int i, a,b,c,d;
for(i=0;i<=9;i++)
{
a=i%2;
b=(i/2)%2;
c=(i/4)%2;
d=(i/8)%2;
digitalWrite(9,a);
digitalWrite(8,b);
digitalWrite(7,c);
digitalWrite(6,d);
delay(1000);
}
}
Schematic

Reflections

Here I was able to understand how 7-segment LED display works by programming the
circuit using Arduino board by displaying the numbers from 0 to 9 after making necessary
connections with the Arduino board where we basically applied the knowledge and logic of
converting integers to binary coded decimal which was our previous assignment task.
ASSIGNMENT - 3
Study to display the digits on seven segment display

Exercise 2 – Redesign the Exercise 1 from 00 to 99.


Hardware
 Digital Trainer Kit

  Arduino Board
 Single core connecting wires

Code
void setup()
{
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
}
void loop()
{
digitalWrite(3,LOW);
int i,j,a,b,c,d,e,f,g,h;
for(i=0;i<=9;i++)
{
a=i%2;
b=(i/2)%2;
c=(i/4)%2;
d=(i/8)%2;
digitalWrite(9,a);
digitalWrite(8,b);
digitalWrite(7,c);
digitalWrite(6,d);
digitalWrite(4,HIGH);
digitalWrite(4,LOW);
for(j=0;j<=9;j++)
{
e=j%2;
f=(j/2)%2;
g=(j/4)%2;
h=(j/8)%2;
digitalWrite(9,e);
digitalWrite(8,f);
digitalWrite(7,g);
digitalWrite(6,h);
digitalWrite(5,HIGH);
digitalWrite(5,LOW);
delay(1000);
}
}
}
Schematic

Reflections

Here I was able to understand how 7-segment LED display works by programming the
circuit using Arduino board by displaying the numbers from 0 to 99 after making
necessary connections with the Arduino board where we basically applied the knowledge
and logic of converting integers to binary coded decimal which was our previous
assignment task. Here I also learnt the function of latches which are used as temporary
storage devices and about the decoder IC CD4543 which decodes our converted data from
BCD to integer which we had originally converted to BCD from integer by programming
the Arduino board.
Assignment Tasks:
 Given a microsecond time which is a 5-digit integer. Displayed the equivalent time in
millisecond using Arduino on seven segment display.

Hardware Required: - Seven Segment Display, Arduino Board,


Jumper Wires

Code

void setup()
{ // to initialize the code
for( int i=2;i<9;i++)
pinMode(i,OUTPUT); // input pin as output
}
void loop()
{ // initializing the loop
int w,x,y,z,a,b,c,d; // declaring variable
x=12345;
x=x/100;
z=x%10;
x=z%2;
b=(z/2)%2;
c=(z/4)%2;
d=(z/8)%2;
digitalWrite (6,HIGH); // Enable is turned High/ON
digitalWrite (2,a); // pin-2 for first bit of BCD
digitalWrite (3,b); // pin-3 for second bit of BCD
digitalWrite (4,c); // pin-4 for third bit of BCD
digitalWrite (5,d); // pin-5 for fout bit of BCD
digitalWrite (6,LOW); // Enable is turned LOW/OFF
x=x/10;
y=x%10;
a=y%2;
b=(y/2)%2;
c=(y/4)%2;
d=(y/8)%2;
digitalWrite (7,HIGH); // Enable is turned High/ON
digitalWrite (2,a); // pin-2 for first bit of BCD
digitalWrite (3,b); // pin-3 for second bit of BCD
digitalWrite (4,c); // pin-4 for third bit of BCD
digitalWrite (5,d); // pin-5 for fout bit of BCD
digitalWrite (7,LOW); // Enable is turned LOW/OFF
x=x/10;
a=x%2;
b=(x/2)%2;
c=(x/4)%2;
d=(x/8)%2;
digitalWrite (8,HIGH); // Enable is turned High/ON
digitalWrite (2,a); // pin-2 for first bit of BCD
digitalWrite (3,b); // pin-3 for second bit of BCD
digitalWrite (4,c); // pin-4 for third bit of BCD
digitalWrite (5,d); // pin-5 for fout bit of BCD
digitalWrite (8,LOW); // Enable is turned LOW/OFF
}
Self-Effort Hours Tasks:
 Learn the programming of Arduino Board.
 How to design the two pair sensors circuit and combine the two sensors signal into one signal.
 How to convert the two sensors output into one long pulse.


Vous aimerez peut-être aussi