We often wish that how cool it can be to control any device with little gestures. So we thought of making a clap detecting sequence circuit by which we can control or secure many devices. Just like the secrets of a particular magic trick is known only by the magician who creates or performs the trick. Similarly, we wanted to build a project with a sequence that will only be known to us unless we reveal it. Our project was heavily inspired by the 'magic theme', and it got us thinking-- Abracadabra... we do clap clap clap, and lights off! So with this in mind, we started building our project. ;)

What it does

The circuit is a sequence detector that detects a series of claps and performs a task. Here we are lighting series of LEDs that will refer to those tasks. Here are 8 LEDs that dances in different sequences. For example, if you clap once, all the LEDs lights on. If you clap twice, all the LEDs goes off. Apart from these, if you make a sequence, let's say two claps with a little break and then two more claps, the LEDs goes to a dancing mode. Many more to discover in the video. :D

How we built it

As we are saying, it is detecting the claps by electronics circuit, so we needed a transducer that can convert sound energy to electrical energy. For that, we used a condenser mic with a resistor to bias it for operations. As the clap occurs, it creates a spike, and we detected the spikes by reading the analog voltage using an Arduino's AtoD converter. We smoothed out the ADC readings using some filters. And with some code performing some timing calculations, we detected the sequence. For the output, we used 8 LEDs. These LEDs displays the sequence running.

Challenges we ran into

The pre-amplification stage and biasing the microphone was a bit tough. By tweaking the values of resistors, we found the operating point. The analog values that the ADC of Arduino reads were very noisy and a little tough to work with. We have passed the values through low pass digital filters in order to smooth and make the signal work worthy. And finally the most challenging part was calibrating the timing sequence that can react only to your claps. Again calibrating the threshold value with debouncing the outputs for a stable count of claps.

Accomplishments that we're proud of

Smoothing and filtering out the noise from the ADC without an external passive component was indeed an accomplishment. Calculating and figuring the timing sequence that corresponds to the clap sequence and syncing them gave us a sigh. And finally, making the LEDs to run the desired sequence was very pleasing to see. +_+

What we learned

We learned about the condenser microphone, which we previously studied in our colleges as a theory, here we got to implement it. Learned the difference between sensors and transducers. Here the condenser mic is a transducer since it has a built-in MOSFET inside it. We learned about biasing a transistor correctly to find a suitable operating point. Learned about digital filters that filter out the noise from a signal.

What's next for Magic Lights

We are thinking of adding some relays to control our room appliances like LED or the Fan. Like it would be very cool if we can turn the lights of our room on by clapping at a given sequence. That could give you the feel of Royalty. Even using the processed sound data, only after running some algorithms we can build a security system by making a particular sound sequence and then only it can unlock.

Built With

Share this project: