Description: For those who prefer convenience, it is possible to turn the bedroom light on or off without leaving the bed simply by clapping hands. This concept inspired the design of a clap-activated light control system. Various clap switch projects can be found online, most of which do not utilize a microcontroller. However, a microcontroller was chosen for this design to allow for future enhancements, such as turning on or off the light with two claps, the TV with three claps, the DVD player with four, and so forth. Another potential enhancement is to implement a timer to automatically turn off the device. The hardware design is straightforward, consisting of a microcontroller, an electret microphone, a relay, and several discrete components. An ATmega8 microcontroller serves as the central processing unit for this project. The microphone captures sound, which is then amplified by a BC548 transistor. This amplified signal passes through a low-pass filter to eliminate high frequencies before reaching the ADC of the ATmega8. To maintain simplicity, only one transistor is used for signal amplification. Two buttons are provided to adjust the sensitivity of the system. The complete schematic is available below, with optional components indicated by a dotted line. The software was developed in C using AVR Studio and the WinAVR library. The ADC is continuously monitored, and the returned value is compared to a user-defined variable. This variable can be altered by pressing buttons S1 or S2, enabling the user to increase or decrease the required signal intensity to activate the circuit. If the ADC value is below the variable, no action is taken; if it exceeds the variable, Timer0 is activated and begins counting. During each timer overflow, a variable named 'timer' is compared against three constants: burst_time, ready_time, and time_out. When the timer equals burst_time, a global variable 'burst' is set to 1. When the timer equals ready_time, 'burst' is reset to 0 and another variable 'ready' is set to 1. If the timer reaches time_out, all variables are reset to 0. Upon detecting another clap, if 'burst' equals 1, the microcontroller resets all variables and restarts the loop. If 'burst' equals 0 and 'ready' equals 1, the output state is toggled.
The clap-activated light control system is designed to enhance user convenience by allowing for hands-free operation of lighting and other electrical devices through simple auditory commands. The system operates based on sound recognition, where the microphone captures the sound of claps and processes the signal using a microcontroller. The ATmega8 is selected for its adequate processing power and availability, making it suitable for this application.
The electret microphone serves as the primary input device, converting acoustic energy from claps into an electrical signal. The BC548 transistor amplifies this signal, ensuring that it is strong enough for processing. The low-pass filter is crucial in this design, as it removes unwanted high-frequency noise that could lead to false triggering of the system.
The adjustable sensitivity feature, controlled by buttons S1 and S2, allows users to calibrate the system according to their environment, making it versatile for different settings. The software logic implemented in the microcontroller ensures that the system is responsive and can handle multiple claps without misinterpretation.
The timer functionality adds an additional layer of control, allowing for automated device management. This feature can be particularly useful for energy conservation, as users can program the system to turn off devices after a specified period of inactivity.
Overall, this clap switch project exemplifies a practical application of microcontrollers in creating user-friendly electronic solutions, demonstrating both simplicity in hardware design and sophistication in software logic.For those who are lazy like me, turn on or off the bedroom light without getting out of bed, simple clap your hands is amazing. Thinking about it I projected one for me. Several projects of clappers can be found on the Internet, and most of them do not use microcontroller.
I chose to use a micro planning future updates, such as turn on or off the light with 2 claps, the TV with 3 claps, DVD player with 4 and so on. Another update can be a time to turn off the device automatically. The hardware is very simple, just a microcontroller, a electret mic, a relay and some discrete components. The microcontroller is the brain of the project, I used a atmega8 because it was the only I had available.
The signal is captured by the mic and amplified by the transistor (BC548), this signal run through a lowpass filter that remove the high frequencies and go to mega8 ADC. To keep the circuit simple, only one transistor is used on signal amplification. Two buttons are used to up or down the sensibility of the signal. You can see the complete schematic below. The components on dotted line are optional. The software was written in C using AVR Studio and WinAVR library. The ADC is read constantly, and the returned value is compared with a variable. This variable can be changed if the user press the button S1 or S2. So, the user can increase or decrease the intensity of the signal necessary to trigger the circuit. If the value of the ADC is less than the variable, nothing happens, otherwise the timer0 is activated and begins counting.
At each timer overflow, a variable called The value of variable timer is compared with three constants, burst_time, ready_time and time_out. If the value of the variable is equal to the constant burst_time the value of global variable burst become 1.
If the value of timer is equal the constant ready_time the value of variable burst becomes 0 and variable ready becomes 1. If value of timer is equal time_out all the variables become equal to 0. When another clap is detected, if burst = 1 then the microcontroller clear all variables and start the loop again.
The two optical sensors will provide a count of individuals to the microcontroller, which will relay this value to MCU-II. The microcontroller will detect the entrance of any person through high-to-low pulse transitions on input pins A3 and A4.
The circuit...
A project is underway to control the speed of an electric fan (220Vac, 60W, 5A max.) automatically using a microcontroller based on certain parameters.
The circuit design for controlling the speed of an electric fan involves several key components to ensure...
The filter consisting of resistors R1, R2, and capacitor C1 integrates the PWM waveform. The purpose of the operational amplifier appears to be that of a non-inverting amplifier, with the gain determined by resistors R6 and R7. However, the need...
Upon entering the password, the application, in this case "LED," will illuminate. In this digital locking system project, the interfacing of a keypad and a 16x2 LCD with a microcontroller will be explored, along with the accompanying code. This project...
The clap sensor is a straightforward circuit that consists of a PC microphone, a microcontroller, and an output. The circuit design features the ATtiny84 microcontroller, chosen for familiarity with the AVR architecture and accessibility to necessary tools. The ATtiny84 is...
This schematic illustrates the placement of a decoupling capacitor on the right side, which should be positioned as close as possible to the power pins of the microcontroller. It includes a crystal oscillator, which is optional; an internal RC oscillator...
Function generators are essential in the design, testing, and operation of encoders, modulators, demodulators, and measurement instruments. This document presents an economical method to construct a bus-controlled sinewave oscillator that exhibits exceptionally low distortion. The circuit produces a sinusoidal output...
Twenty-five musical keys and 25 LEDs are provided to denote F to F" with half notes in between. Memory can store a played tune. There are ten preprogrammed tunes (each has an average of 55 notes) masked in the chip....
The SP6691 circuit is designed to provide a high output voltage using a lower voltage boost regulator by incorporating a charge pump circuit. This configuration can convert a standard 30V boost regulator into a 60V boost regulator if necessary. Testing...
We use cookies to enhance your experience, analyze traffic, and (if you allow) serve personalized ads.
By clicking Accept All, you agree to our use of cookies.
Learn more