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 16x2 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.