Introduction: Arduino -- Analog Reading Box
I made this box for my music project to our school. This is only tutorial for the box, no for playing melody. It´s based on serial connected switches.
You will need:
1x 330 ohm resistor
5x 2000 ohm resistor (etc.)
1x 10 000 ohm resistor
1x plastic box
small piece of prototyping board
Step 1: Making a Wire
First you need to prepare the connecting wire. Take three wires, three pins and a piece of prototyping board with prepared lines of conductive material. I chose this type: the middle pin is analog value and others are VCC and GND.
Step 2: Prepare the Box
Take the front side of box and make five holes (i use my soldering iron for it :) ) Put the switches to the holes.
Then take a top part of the box. Make there two holes. One for placing ON/OFF switch and one for LED (power indicator) .
Step 3: Connecting Switche and Resistors
As I said in step before it´s based on cascade of switches. To middle pin of first switch is connected the VCC power source. Left pin is connected to resistor, which goes to middle pin of next switch. The right pin is connected to wire, which is common for all switches (you can see on schematic). The resistor on last switch is connected to common wire.
Step 4: Connecting to Power Wires
Now connect the VCC wire to middle pin of ON/OFF switch. Then connect 330 ohm resistor and a piece of red wire to the left pin of switch. This piece of wire is connected to middle pin of first switch of cascade . On the last resistor is connected a piece of yellow wire. Connect 10k ohm resistor and analog reading wire(yellow in my photos) on last resistor. On the free pin of 10k ohm resistor connect GND wire.
Step 5: Connect a LED
Now connect a anode of LED to 330 ohm resistor. The cathode of led connect to GND.
Step 6: Testing
The last step is connect your device to Arduino. Put pins of box to breadbord and connect GND - GND, VCC - VCC, analog value - A0( = arduino pins). You can use analog reading code from examples.
I modificate LCD and analog reading examples to see the value. In first row is value on pin A0 and in following row is time in miliseconds.
I hope you will be sucesfull.