Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

User input based seven segment display using 8051 microcontroller (AT89C51)- (Part 3/45)

By Himanshu Choudhary

This article is a simple application built around the seven segment display. The circuit has ten inputs corresponding to digits zero to nine. Whenever an input is pressed the corresponding digit is displayed on the seven segment.The microcontroller used is AT89C51 which belongs to the 8051 series of microcontroller.

 


 

 

The circuit can be divided into two units: the controller unit and the display unit. The controller unit consists of a microcontroller circuit. The microcontroller used here is AT89C51 . The display unit consists of a seven segment circuit which is interfaced to the microcontroller. The circuit is similar to the seven segment circuit

 

with the only difference that here we have ten input pins. Each input pin corresponds to one of the digits to be displayed on the seven segment. Here the pin 0 to pin 7 of port P3, pin 6 and pin 7 of port P 1 are made the input pins. The output is sent to the seven segment through Port 2 of the microcontroller.

 

 

 

Project Source Code

###

// Program to display number by taking input from the user

#include <reg51.h>

sbit in1=P1^0;        //input pins
sbit in2=P1^1;
sbit in3=P1^2;
sbit in4=P1^3;
sbit in5=P1^4;
sbit in6=P1^5;
sbit in7=P1^6;
sbit in8=P3^1;
sbit in9=P3^2;
sbit ina=P3^3;

sbit ou1=P2^0;        // output pins
sbit ou2=P2^1;
sbit ou3=P2^2;
sbit ou4=P2^3;
sbit ou5=P2^4;
sbit ou6=P2^5;
sbit ou7=P2^6;

void main()
{
    in1 = in2 = in3 = in4 = in5 = in6 = in7 = in8 = in9 = ina = 1;        // Initialize the input pin
    ou1 = ou2 = ou3 = ou4 = ou5 = ou6 = ou7 = 1;
    while(1)
    {
        while (in1==0)
        {
        ou2 = ou3 = 0;
        ou1 = ou4 = ou5 = ou6 = ou7 = 1;
        }

        while (in2==0)
        {
        ou1 = ou2 = ou4 = ou5 = ou7 = 0;
        ou3 = ou6 = 1;
        }
        
        while (in3==0)
        {
        ou1 = ou2 = ou4 = ou3 = ou7 = 0;
        ou5 = ou6 = 1;
        }

        while (in4==0)
        {
        ou3 = ou2 = ou6 = ou7 = 0;
        ou1 = ou4 = ou5 = 1;
        }

        while (in5==0)
        {
        ou1 = ou3 = ou4 = ou6 = ou7 = 0;
        ou2 = ou5 = 1;
        }

        while (in6==0)
        {
        ou1 = ou5 = ou3 = ou4 = ou6 = ou7 = 0;
        ou2 = 1;
        }

        while (in7==0)
        {
        ou1 = ou3 = ou2 = 0;
        ou4 = ou5 = ou6 = ou7 = 1;
        }

        while (in8==0)
        {
        ou1 = ou2 = ou5 = ou3 = ou4 = ou6 = ou7 = 0;
        }

        while (in9==0)
        {
        ou1 = ou2 = ou3 = ou4 = ou6 = ou7 = 0;
        ou5 = 1;
        }

        while (ina==0)
        {
        ou1 = ou3 = ou4 = ou6 = ou2 = ou5 = 0;
        ou7 = 1;
        }
    }
}

###

 


Circuit Diagrams

Circuit-Diagram-of-User-input-based-seven-segment-display-using-8051-microcontroller-AT89C51

Project Components

  • AT89C51 Microcontroller
  • LED
  • Seven Segment Display

Project Video


Filed Under: 8051 Microcontroller
Tagged With: 8051, display, microcontroller, seven segment
 

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


Featured Tutorials

  • PS2 Keyboard To Store Text In SD Card Using Arduino Circuit Setup On Breadboard
    How To Use PS2 Keyboard To Store Text In SD Card Using Arduino- (Part 42/49)
  • Wireless Path Tracking System Using Mouse, XBee And Arduino Circuit Setup On Breadboard
    How To Make A Wireless Path Tracking System Using Mouse, XBee And Arduino- (Part 43/49)
  • How to Make a Wireless Keyboard Using Xbee with Arduino- (Part 44/49)
  • Making Phone Call From GSM Module Using Arduino Circuit Setup On Breadboard
    How to Make Phonecall From GSM Module Using Arduino- (Part 45/49)
  • How to Make a Call using Keyboard, GSM Module and Arduino
    How To Make A Call Using Keyboard, GSM Module And Arduino- (Part 46/49)
  • Receiving SMS Using GSM Module With Arduino Prototype
    How to Receive SMS Using GSM Module with Arduino- (Part 47/49)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • Renesas delivers intelligent sensor solutions for IoT applications
  • Microchip Technology releases AVR-IoT Cellular Mini Development Board
  • Qualcomm acquires Cellwize to accelerate 5G adoption and spur infrastructure innovation
  • MediaTek’s chipset offers high-performance option for 5G smartphones
  • Nexperia’s new level translators support legacy and future mobile SIM cards

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • SRF04 module measure distance
  • Adaptive filters fundamental
  • Using LTspice to check Current sense transformer reset?
  • Thermal pad construction on pcb
  • lna+mixer noise figure problem

RSS Electro-Tech-Online.com Discussions

  • Are Cross-wind compensation and Road crown compensation functions inputs to LKA function?
  • Interfacing ZMOD4410 with Arduino UNO
  • Help diagnosing a coffee maker PCB
  • Capacitor to eliminate speaker hum
  • Identify a circuit.
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering