Magic Lights

by avijitdasxp in Circuits > Arduino

201 Views, 0 Favorites, 0 Comments

Magic Lights

MAGIC LIGHTS
MagiC.jpg

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 6 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.

Supplies

  1. Arduino Uno
  2. Condenser Mic
  3. 10k Resistor
  4. 6x LEDs

Inspiration

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. Abracadabra... we do clap clap clap, and lights off! So with this in mind, we started building our project. ;)

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 6 LEDs. These LEDs displays the sequence running.

Circuit Diagram and Code

magic_Schematic.jpg

Here is the Schematic and you can find the Arduino Code here.

Troubleshooting

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.

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.

It's Not Only Me !

Kudos to to Deblina Chattopadhyay for creating this project with me.