Receive all updates via Facebook. Just Click the Like Button Below...

Powered By EXEIdeas

Searching...

LED 7 segment display driver circuit

7 segment display.
Seven segment display is a device that can display decimal numbers and are widely used in electronic clocks, electronic meters, digital display panels and a hand full of  applications where numerical data is  is displayed. The idea of seven segment display is very old and they are in the scenario from early nineteenth century. Seven segment display have seven segments which can be individually controlled (ON/OFF) to display the desired number. Numbers from 0 to 9 can be displayed using  various combinations of the segments and in addition to this the hexadecimal letters A to F can be also displayed using a seven segment display. The seven elements (segments)  are arranged in the form of a square shaped “8″ which is slightly inclined to the right. The slight inclination to the right is given to improve the readability.Some seven segment displays have an additional dot element which can be used for indicating decimal points. The segments may be based on incandescent bulbs, fluorescent lamps, LCD or LED. Here in this article we give stress to the LED seven segment display.
In an LED 7 segment display, as the name indicates the 7 segments plus the dot segment are based on LEDs. When power is given to a particular segment, it glows and the desired digit can be displayed by powering the suitable combination of LEDs. LED seven segment displays are of two types, common cathode and common anode. In a common cathode display, the cathode of all LED segments are tied together as one common cathode pin and the anode terminals are left alone as input pins. In this scheme the common cathode is always connected to ground and the control signals (active high) are applied to the inputs (anode terminals) .In common anode type display, the anodes of LED segments are tied together as one common anode and the cathode terminals are left alone as input. In this configuration the common anode is always connected to a suitable positive voltage and the control signals (active low)  are applied to the inputs (cathode terminals). Pin out and image of a seven segment display is shown in the figure below.
Basic LED 7 segment display driver system.
The block diagram of a basic LED seven segment display system that can display a given input in numerical form is shown Above .
The decoder block converts the given input signal into an 8 line code corresponding to the ‘a’  to ‘g’  segments and the decimal point which controls the segments to display the desired number. For example if the line corresponding to ‘f ‘and ‘e’ are activated then segments f and e of the display glows indicating a “1″. If the input quantity is an analogue  signal then it must be converter into digital format using an ADC before applying to the decoder. If the input signal is digital then there is no need for the ADC and the decoder alone will convert the particular input code into the 8 line code compatible to  the seven segment LED display. The purpose of the driver stage is to provide the necessary current drive in order to drive the  LED seven segment display. If the decoder stage is powerful enough to drive the display, then the driver stage is not required.  A typical 7 segment display driver stage consists of an array (8 nos ) transistor or FET based switches. For example consider the line ‘a’ . The “a” output of the decoder is connected to the input terminal (base/gate) of the corresponding switching element inside the driver stage. The same line is buffered by the switching element and is available as output line ‘a’ of  the driver. This output is connected to the corresponding a’ element of the display. The driver can be arranged in sinking or sourcing mode.
Sinking and sourcing digital outputs.
A sinking digital output keeps the particular output low by using a transistor and thus makes a path for the load current to flow to the ground. Here the current flows from the load to the respective output terminal. In sourcing mode the the particular output is held high using a transistor the output line itself provides the necessary current for energizing the load. Here the current flows from the output terminal to the load.
In case of the sinking digital output the current comes from the external power supply V+ , passes through the load, and the internal transistor conducts it to the ground. For a sourcing digital output the current comes from the digital circuits own power supply V+, then conducted by the transistor , passes through the load and then to the external ground.
Seven segment decoder / driver.
Seven segment decoder / driver is a digital circuit that can decode a digital input to the seven segment format and simultaneously drive a 7 segment LED display using the decoded information. What that will be displayed on the 7 segment display is the numerical equivalent of the input data. For example a BCD to seven segment decoder driver can decode a 4 line BCD ( binary coded decimal) to 8 line seven segment format and can drive the display using this information. For example, if the input BCD code is 0001, the display output will be 1 , for 0010 the display output will be 2 and so on. The circuit diagram shown below is of a BCD to seven segment decoder / driver using 7446 IC.
7446 is a BCD to 7 segment display driver IC with active low outputs. The IC is stand alone and requires no external components other than the LED current limiting resistors. All output of the IC have complete ripple blanking and requires no external driver transistors. There is also a built in lamp test function which can be used to test the LED segments. Pin 5 of the IC is the ripple blanking input (RBI) and pin 4 is the ripple blanking output (RBO). Pin 3 is the lamp test (LT) input pin. When the RBI and RBO pins are held high and the lamp test (LT) input pin 3 is held low all LED segment output goes high. The display used here must be a common anode type because the IC has active low outputs.

Digital thermometer using 8051


Digital thermometer using 8051
Thermometer using 8051.
This article is about a simple 0-100°C digital thermometer with 1°C resolution using 8051. The circuit is based on LM35 analog temperature sensor, ADC0804 and AT89S51 microcontroller. LM35 is an analogue temperature sensor IC which can measure a temperature range of -55 to 150°C. Its output voltage varies 10mV per °C change in temperature.
For example, if the temperature is 32°C, the output voltage will be 32 x 10mV = 320mV. ADC 0804 is used to convert the analogue output voltage of the LM35  to a proportional 8 bit digital value suitable for the microcontroller. The microcontroller accepts the output of ADC, performs necessary manipulations on it and displays it numerically on a 2 digit seven segment LED display.
Out put of the LM35 is connected to the +Vin (pin 6) of the ADC0804. Resistor R13 and preset R14 is used to provide an external reference voltage of 1.28V to the Vref/2 pin  ( pin 9) of the ADC0804 and with this reference voltage, the step size of the ADC will be 10mV and span will be 0-1 V. This means that for a 10mV input the digital out of ADC will be 1 (1 in decimal also), for 20mV it will be 10 (2 in decimal), for 30mV it will be 11 (3 in decimal) and so on. The microcontroller accepts this data and puts it on the seven segment display.
Circuit diagram.
Digital out of the ADC (D0 to D7) are connected to P1 (P1.0 to P1.7) of the microcontroller. This is the line through which the microcontroller accepts data from the ADC. The control pins CS, RD, WR and  INTR are connected to P3.7, P3.6, P3.5 and P3.4 of the microcontroller. This is the data path through which the microcontroller sends chip select (CS), read (RD) write (WR) signals to the ADC and receives INTR signal from the ADC. Data lines (a to h) of the multiplexed seven segment display are interfaced to P0 (P0.0 to P0.7) of the microcontroller. Activation signals for the segment driver transistors Q1 and Q2 are available from P3.2 and P3.1 pins of the microcontroller.

Before attempting this circuit go through these articles Voltmeter using 8051  , Interfacing ADC to 8051 , Interfacing seven segment display to 8051.
Program.

ORG 00H
MOV P1,#11111111B   // initializes P1 as input port
MOV P0,#00000000B   // initializes P0 as output port
MOV P3,#00000000B   // initializes P3 as output port
MOV DPTR,#LABEL     // loads the address of "LABEL" to DPTR
MAIN: MOV R4,#250D  // loads register R4 with 250D
      CLR P3.7      // makes Cs=0
      SETB P3.6     // makes RD high
      CLR P3.5      // makes WR low
      SETB P3.5     // low to high pulse to WR for starting conversion
WAIT: JB P3.4,WAIT  // polls until INTR=0
      CLR P3.7      // ensures CS=0
      CLR P3.6      // high to low pulse to RD for reading the data from ADC
      MOV A,P1      // moves the digital output of ADC to accumulator A
      MOV B,#10D    // load B with 10D
      DIV AB        // divides the content of A with that in B
      MOV R6,A      // moves the quotient to R6
      MOV R7,B      // moves the remainder to R7
DLOOP:SETB P3.2     // sets P3.2 which activates LED segment 1
      MOV A,R6      // moves the quotient to A
      ACALL DISPLAY // calls DISPLAY subroutine
      MOV P0,A      // moves the content of A to P0
      ACALL DELAY   // calls the DELAY subroutine
      CLR A         // clears A
      MOV A,R7      // moves the remainder to A
      CLR P3.2      // deactivates LED segment 1
      SETB P3.1     // activates LED segment 2
      ACALL DISPLAY
      MOV P0,A
      ACALL DELAY
      CLR A
      CLR P3.1      // deactivates LED segment 2
      DJNZ R4,DLOOP // repeats the loop "DLOOP" until R4=0
      SJMP MAIN     // jumps back to the main loop
DELAY: MOV R3,#255D // produces around 0.8mS delay
LABEL1: DJNZ R3,LABEL1
        RET
DISPLAY: MOVC A,@A+DPTR // converts A's content to corresponding digit drive pattern
         RET
LABEL: DB 3FH       // LUT (look up table) starts here
       DB 06H
       DB 5BH
       DB 4FH
       DB 66H
       DB 6DH
       DB 7DH
       DB 07H
       DB 7FH
       DB 6FH
END