Introduction: Bright Cap
The wearable we are going to make today is a motion-responsive glowing hat. A simple accessory that will let you stand out in almost any situation. The end goal is a hat that reacts when someone passes in front of it. The parts we will need are as follows:
- A PIR sensor
- Eight basic LEDs
- Eight resistors (roughly 350 Ohms)
- An Arduino micro computer
- Wire
- Soldering equipment (soldering iron, solder)
- Electrical tape
- Two hats
- A transparent fabric
- Sewing tools (sewing machine, thread, needle, seam ripper)
- Nine volt battery
Step 1: Creating the Circuit
The first step is the internal circuitry. First step is attach the PIR sensor to the Arduino. It has 3 inputs. Using the picture provided: the left pin is the power (5volt) input, the middle pin is the signal output, and the right is the ground wire. The Arduino has labeled ports for the ground and 5 volt. Simply attach those. The output we have chosen is the digital 3 on the Arduino. Next, adjust the orange dials on the sensor to counter clockwise. One dial sets the distance that the sensor can detect movement. The other sets the repeatable reaction time. These can be readjusted later to fit your needs. LEDs have two sides that can be discerned most easily by the length of the legs. The longest leg is for the power input, it is the positive side. Conversely the short leg is the negative side. Now find the positive sides of your LEDs and solder a piece of wire to connect a resistor. The resistance will help with stability of the circuit and help to not blow out the LED. Solder the negative side to a long wire that we will connect to ground. I have decided to connect all of my ground wires to the same master wire that will hopefully make things cleaner and save room. Use your electrical tape to cover all exposed wiring as we go along. Now solder a length of wire to the positive side. I used jumper cables to make it easier to connect to the Arduino, but any wires will do. Connect the positive wires to the Arduino's digital power outs 7 through 13 and the ground wire to the ground.
Step 2: The Arduino
What the Arduino is, is a small computer that allows for simple repeatable functions. What we are doing here is programing the Arduino to recognize the sensor, and activate the LEDs. I put in a delay into the code to help the sensory discern between inputs. So that the circuit will read motion, activate, then not read any input again for a period of time. The LEDs will trigger as high (on) when the sensor detects movement. They read low (off) when there is either no movement or the when the sensor is in that delay. Here is the code that I used.
int sensorState = 0;
float reading; void setup() {pinMode(3, INPUT);
pinMode( 7, OUTPUT);
pinMode( 8, OUTPUT);
pinMode( 9, OUTPUT);
pinMode( 10, OUTPUT);
pinMode( 11, OUTPUT);
pinMode( 12, OUTPUT);
pinMode( 13, OUTPUT);
Serial.begin(9600); } void loop() {
// read the state of the sensor/digital input sensorState = digitalRead(2);
reading =digitalRead(2);
// check if sensor pin is HIGH. if it is, set the // LED on. if (sensorState == HIGH) {
digitalWrite ( 7, HIGH);
digitalWrite ( 8, HIGH);
digitalWrite ( 9, HIGH);
digitalWrite( 10, HIGH);
digitalWrite( 11, HIGH);
digitalWrite( 12, HIGH);
digitalWrite( 13, HIGH);
Serial.println("Sensor activated!"); Serial.println (reading); } else {
digitalWrite ( 7, LOW);
digitalWrite ( 8, LOW);
digitalWrite ( 9, LOW);
digitalWrite( 10, LOW);
digitalWrite( 11, LOW);
digitalWrite( 12, LOW);
digitalWrite( 13, LOW);
} delay(1000); // Delay a little bit to improve simulation performance }
Step 3: The Hat
What I did here was to purchase two nearly identical hats. one slightly larger than the other. Using the seam ripper. I carefully split the front down the middle where the seams connected. Also removing and discarding the brim. Turning our attention to what will be the inner hat, we begin attaching the circuit. The Arduino and the sensor have holes that make this part easier. The LEDs you must take care to arrange them to were the are evenly spread. I used three different colors, so I also make certain that they were arranged so that the colors were adequately dispersed. Next you will want to put the top hat over the bottom. size up haw much room you will need to attach the top. I used the edge of the brim as a guide, with the open front of the top meant to attach at the edges of the brim. Then I measured, cut, and sewed the transparent fabric to the opening. Next cut a hole for the sensor to poke through, and sewed the sensor into place so that it wouldn't move. now you simply fit the top onto the bottom and sew the two halves together.