This pinout was incredibly handy to have printed out and referenced constantly. The atmega168 and 328 are identical in terms of pinouts so i used this.

______________________________________________________________________________________________________

before I get into specifics. If you plan to interface with a device(arduino or electonics) make sure you have a digital pin specified in the program code that handles your communication and interaction. Remember that digital pins are not the same as the pinouts. This is key to making sure you don't *** up. for instance, digital pin 8 is actually physical pin 14 on the chip. So be crystal clear which digital pins are hooked up to what.



I wont go into details on how to interface with electronics, The device is set up to send commands on the available 8+ I/O pins. So It's up to you to attach whatever devices you want to it. The sky's the limit.



I had connected VCC, AVCC togeather first. (pins 7,21,20)



Connected AREF to a voltage divider to force it to 1V (this makes the analog data very sensitive)http://www.electronics2000.co.uk/calc/potential-divider-calculator.php that is a helper for the voltage divider if you plan to use batteries or a different input other than 5

^^scratch that^^

you can internally set the AREF voltage by putting "analogReference(INTERNAL);" on an atmega328

just don't connect AREF to anything.



then I connected the grounds (pins 8, 22)



The reset pin needs to be held high in order to not reset itself randomly during operation, It also needs to be able to go low when uploading a new firmware so you need to use a pull up to hold high. I connected pin 1(reset) with a 10k resistor to high (pin 7)



I then connected the leds( my eyes measures 6cm from one eye to the other but after experimenting with the round shape of the mask I spaced them 7cm apart.



I then hooked up the resistors to the leds and connected all the negative leads togeather and then to pin 8(ground)



the output pins for the leds are going left to right (pins, 5,11,12,15,,16,17) leds 4,5,6 are on the same board as the micro controller so I attached those next to (pins 15,16,17)



I made 3 long wires from (pins 5,11,12) cross over to the left board and left them for now.



I then made wires for the analog sensor, the main button, and positive and negative to cross over to the left board I connected the positive wire to (pin 7) the negative wire to (pin 8) and the analog signal pin to (pin28)



I finished up the right board by attaching the wires for the button pad, one pad gets ground(pin 8) and the other pad gets attached to (pin 4) and a pull up resistor going from (pin 4) to (pin 7) this pullup resistor keeps the pad always high, so that no noise alters the signal and activates it by accident. ( it can be pulled down or pulled high It shouldn't matter, In this case keeping it High is better I believe as electromagnetic interference hitting the aluminum may pull it high by accident even if it is pulled down.



I lined up all the wires from the right board [ analog(pin28), power( pin 7), ground (pin 8), led 1(pin 5), led 2(pin 11), led3 ( pin 12),

and hot glued them to the board in an orderly fashion. This helped with making sure the wires were aligned when soldering on the other board. and also making sure that the wires didn't pull the boards together at an angle making the leds become misaligned

(*hint* make sure the board works so far as you'll have to rip up that hot glue like i did if somethings off -.-)



On the left board I positioned the switch, the button and soldered them in around the top of the board, they can go anywhere you like as long as it's accessible under the fabirc when you sew it up.



I attached the wallplug (5V at 500mA) to the board with the positive on the switch terminal, and the negative connected on the board seperatly with the (pin8 wire) connecting to it as well



I then connected the leds and resistors, and connected the negative leads together and connected that to the ground wire contact on the board. then connected the resistors to the led wires acordingly



I then connected the resistor to the main button to pull it down, (pin 4 wire) to one terminal on the button, and that was also connected to the resistor and that resistor was connected to ground. the other terminal of the button was connected to positive.



I then connected the neighboring positive terminal on the switch to the positive wire(pin 7)



As for the analog sensor, follow the attached drawing (do not solder the sensor, It will destroy it) so i had to make metal clamps out of female jumpers i had lying around) the other lead on the sensor needs to go to ground, but there needs to be a resistor in parallel so connect a 1000k ohm resistor between the two leads of the sensor to bring the voltage down to your usable 5V.. or else you will damage your components. The sensor actually creates large voltages when compressed and stretched.. far more than a MC can handle.

















