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

Dual message display on LCD using 8051 microcontroller (AT89C51)

By Himanshu Choudhary

 

This article presents an interesting approach for sound activated display system. This system displays two different messages for odd and even number of sounds. When the sound is produced for the first time the first message is displayed on the LCD. At the second sound, a second message is displayed. The first message reappears at the third sound. Thus alternate messages are displayed every time a sound, say clap, is detected by the system. The project is build around the 8051 microcontroller (AT89C51) along with LCD and a condenser microphone.

 

 


 

The circuit consists of four major modules, namely, a sound sensor, an amplifying circuit, a control circuit and a display module. A switching circuit is also employed after the amplifier. 

Any sound, say clap, is detected by a microphone (condenser mic) which acts as the sound sensor. This mic is connected to a two stage transistor amplifier. The mic output is thus amplified to a suitable level so that it can be detected at the TTL logic.

The output of the amplifier is coupled with a transistor switch. Whenever a high voltage output is received from the amplifier, it generates a pulse. The transistor switching circuit also ensures that a high TTL logic is not received at the microcontroller due to noise signals.

The pulses, from the switching circuit, are fed to the microcontroller’s pin which is programmed to detect the pulses. Whenever a high pulse is generated, it is received at the input pin of the microcontroller and is counted. The first message, ‘HELLO WORLD’, is sent to a 16×2 LCD on odd counts of the input. The second message, ‘WELCOME TO EARTH’ is displayed for even counts. Thus the messages are repeated whenever a high pulse (due to clap sound) is received by the microcontroller.

The data pins of the LCD are connected to port P2 of microcontroller AT89C51 while the control pins (RS, R/W & EN) are connected to pins 1-3 of port P1, respectively. The microcontroller receives sound pulses through the first pin of port P0.

 

 

Project Source Code

###

// Program to display two consequtive messages one after the other with the sound of a clap

#include<reg51.h>
#define port P1
#define dataport P2        //Data port for LCD
#define sec 1000

sbit rs = port^0;    //Control pins for LCD
sbit rw = port^1;
sbit e = port^2;
sbit sensor_input=P0^0;

void delay(unsigned int msec)    // Time delay function
{
    int i,j ;
    for(i=0;i<msec;i++)
        for(j=0;j<1275;j++);
}

void lcd_cmd(unsigned char item)    //Program to send command to LCD
{
    dataport = item;
    rs= 0;
    rw=0;
    e=1;
    delay(1);
    e=0;
    return;
}

void lcd_data(unsigned char item)    // Program to send data to LCD
{
    dataport = item;
    rs= 1;
    rw=0;
    e=1;
    delay(1);
    e=0;
    return;
}

void lcd_data_string(unsigned char *str) // Program to send string to LCD
{
    int i=0;
    while(str[i]!='')
    {
        lcd_data(str[i]);
        i++;
        delay(10);
    }
    return;
}

void main()
{
    int count=1;
    unsigned char str1[] ="HELLO";
    unsigned char str2[] ="WORLD";
    unsigned char str3[] ="WELCOME";
    unsigned char str4[] ="TO EARTH";
    sensor_input=1;
    sensor_input=0;
    lcd_cmd(0x38);
    lcd_cmd(0x0e);
    lcd_cmd(0x01);
    while(1)
        {
            count=1    ;
            sensor_input=0;
            while(count<=2)
            {
                while(sensor_input==0);
                if(sensor_input==1)
                {
                    lcd_cmd(0x01);
                    lcd_cmd(0x82);
                    lcd_data_string(str1);
                    lcd_cmd(0xc6);
                    lcd_data_string(str2);
                    count++;
                }
                while(sensor_input==0);
                if(sensor_input==1)
                {
                    lcd_cmd(0x01);
                    lcd_cmd(0x82);
                    lcd_data_string(str3);
                    lcd_cmd(0xc6);
                    lcd_data_string(str4);
                    count++;
                }
                }
        }
}

###

 


Circuit Diagrams

Circuit-Diagram-LCD-Based-Dual-Message-Display-Using-8051-Microcontroller-AT89C51

Project Components

  • AT89C51 Microcontroller
  • Condenser Microphone
  • LCD
  • Preset
  • Transistor BC547
  • Transistor BC548


Filed Under: 8051 Microcontroller
Tagged With: 8051, display, lcd, message display, microcontroller
 

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

  • Introduction to Brain Waves & its Types (Part 1/13)
  • Understanding NeuroSky EEG Chip in Detail (Part 2/13)
  • Performing Experiments with Brainwaves (Part 3/13)
  • Amplification of EEG Signal and Interfacing with Arduino (Part 4/13)
  • Controlling Led brightness using Meditation and attention level (Part 5/13)
  • Control Motor’s Speed using Meditation and Attention Level of Brain (Part 6/13)

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

  • What are the battery-selection criteria for low-power design?
  • Key factors to optimize power consumption in an embedded device
  • EdgeLock A5000 Secure Authenticator
  • How to interface a DS18B20 temperature sensor with MicroPython’s Onewire driver
  • Introduction to Brain Waves & its Types (Part 1/13)

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

  • Vco cadencd
  • Thyristor Gate Drive
  • Variable Phase shift control circuit for PWM circuit
  • Passive Harmonics Filter
  • Constraining a combo path (Synopsys DC)

RSS Electro-Tech-Online.com Discussions

  • HV Diodes
  • Disabled son needs advice please
  • Question about ultrasonic mist maker
  • RF modules which can handle high number of bytes per second
  • DIY bluetooth speaker
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