This is an interesting idea in which a message is displayed on an LCD screen whenever a sound is produced. The message remains on LCD for a short duration of time and then disappears. This topic demonstrates the interfacing of a sound operated circuit and LCD display with the 8051 microcontroller (AT89C51). The circuit can be used to display welcome message at entrance; or warning messages at public places. It can also be used to aid communication for deaf and dumb people.
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 AT89C51′s pin which is programmed to detect the pulses. Whenever a high pulse at microcontroller input is detected, a message ‘HELLO WORLD’ is sent to a 16×2 LCD. The message remains on the LCD display for a short duration after which it is cleared again. The message is repeated whenever a high pulse (due to clap sound) is received by the controller.
The data pins of the LCD are connected to port P2, 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 a single message on the sound of a clap #include<reg51.h> #define port P1 #define dataport P2 //Data port for LCD #define sec 1000 //CONTROL PINS sbit rs = port^0; 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) //Function to send command to LCD { dataport = item; rs= 0; rw=0; e=1; delay(1); e=0; return; } void lcd_data(unsigned char item) // Function 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) //Function to send string to LCD { int i=0; while(str[i]!='