14 Apr 2012

Arduino Music Visualizer

Music is food for the soul...I love listening to music and also love electronics. So I thought why not make an Arduino based LED music visualizer! With some cool lights synced with some music, you could create a great effect and a great ambiance! 
That is what I tried in my first Arduino project: an Arduino music visualizer. You can call it what you like: musical lights, dancing lights, etc. With slight modifications in the amateur sketch given below and by replacing the LEDs with more exotic lights, you can create a sensational light show!

Here is the code: 
Arduino LED Music Visualizer (code)

Materials Required:
  • Arduino Uno
  • 8 x 8 LED matrix
  • mp3 male jack
  • wires
Tools Required:
  • Soldering Iron
  • Wire Stripper

Wiring for the Arduino and the LED matrix 
Step by Step Guide:
  • Solder one wire to each column and row of LEDs (that makes 16 wires)
  • Insert the row wires in the Arduino pins A5, A4, A3, A2, 3, 4, 5, 6 in their respective order
  • Insert the column wires in the Arduino digital pins 7, 8, 9, 10, 11, 12, 13 in their respective order
  • Insert the negative wire of the mp3 jack into a ground pin
  • Insert the positive wire into the analog pin A0
  • Write the sketch on your Arduino verify the code and the wiring
This is what the music visualizer I made looked like:

Instead of an LED matrix, you could make an LED cube in this way. Below is the fascinating YouTube Video that inspired me to make my first Arduino project:

With this project, enhance your music listening experience and create a rocking ambiance. 

11 Apr 2012

How to Make a People Counter

This is a very useful circuit and has unimaginable applications. You could use this counter to know how many people enter a mall daily, or use it with a conveyor to count the number of objects made, or with a powerful LASER you could even count the number of vehicles passing at a certain point! Moreover, by replacing the calculator by a stop watch, you could make an accurate automatic stop watch.

Materials Required:
  • An ordinary calculator
  • A powerful LASER
  • 9v Battery
  • 9v Battery Connector
  • PCB
  • 5v DC Relay 
  • LDR (photocell)
  • NPN Transistor
  • 100K Variable Resistor
  • Diode
  • 2 Push Button Switches
  • 2 Toggle Switch
  • Box to keep the circuit compact
People Counter Circuit Diagram
Step by Step Guide:
  • Firstly, solder all the components on a circuit board as indicated in the circuit diagram above
  • Open up the calculator and identify the points for the 'on', '+', '1' buttons 
  • Solder push button switches to the 2 points of the '+' and '1' buttons and a toggle switch to the 'on' button  such that they can be easily accessed
  • Identify the '=' button and solder the relay output to it
  • Cut out openings in the box for the 4 switches coming from the calculator, the toggle switch that switches on and off the entire circuit, the calculator's LCD display, and, most importantly, the LDR
  • Fix the PCB, the calculator and the switches into the box
  • As you want the LDR to be sensitive to the LASER's light and not be affected by ambient light, you need to block all ambient light coming to the LDR and let only the LASER beam to hit the LDR. For this you can fix an opaque tube (e.g. the body of a pen) to the LDR

      Now that the receiver component is complete, you just have set up the system in the desired place. So if you want to know the number of people that enter somewhere, place this receiver box at the trunk level of a person on one side of the door and the LASER on the other side exactly at the same level. It is preferable that the LASER be powered by the mains power rather than a battery as a weak beam of light would not be efficient. 

      Once you have placed the transmitter and the receiver, switch on the circuit and the LASER, press the '+' switch, then the '1' switch. Cut the beam a couple of times and see if the counter detects it. If it doesn't, increase the resistance of the potentiometer until the calculator adds a '1' at the slightest rupture of the LASER beam. Great! you have made your LASER pleople counter, but how does it function?

Let's go through electrical the process:
  • While the LASER beam is falling on the LDR, the latter's resistance remains negligible and the 'base' and the 'emitter' pins of the transmitter are shorted. Thus the relay does not get power
  • While the beam is cut, the LDR's resistance shoots up and the 'base' gets power. The relay goes on.
  • As the coil is charged, it shorts its two output pins emulating that the '=' button gets pressed and a '+1' is added on the display
  • Everytime someone or something breaks the LASER beam, a '1' keeps getting added to your total and you have your DIY LASER People Counter!
This is a simple weekend project that has applications in every field. Use your imagination, finds undiscovered applications for this counter and do write them to me!