Friday, December 14, 2018

Random Notes from Semester

Arduino Notes
  • Early 2000s in Ivrea, Italy
    • Design school that wanted to encourage interdisciplinary practice between designers and engineers. 
  • Regent is root word for Arduino.
    • Arduino is open sourced. When the company went down the plans became open sourced.
    • You can still buy genuine Arduino boards.
  • Input (sensor) -> Programming/Computing/Processing -> Output (physical)
  • Anolog IN
    • On board bottom left: A0->A5 = Anolog
  • Power
    • VIN = Voltage in, unregulated voltage
    • RES = Reset
  • TX = transmit
  • RX = receive
  • Digital PWN
  • AREF = what voltage is coming in/ground state A Reference
  • Serial communication pins
  • Arduino Preferences:
    • Need to change root folder
      • Removable hard drive for root folder
      • Volumes on computer under Macintosh HD
        • Arduino->preferences->browse->mac->volumes->save location
      • Turn on Display Line numbers. Enable Code folding and use external editor are turned off
      • Square end is USB B, regular flat is USB A
      • Tools->Port
      • Tools->Arudiuno
  • Pseudocode: in english what you want to do with code
  • pinMode(address, INPUT/OUTPUT); was placed in setup
  • digitalWrite(address, HIGH/LOW); was placed in loop, turn on/off.
    • high/low is a "constant"
    • digitalWrite written in camel hump; the capitalizations

  • delay(number); measured in milliseconds
  • verify = compile
  • About 30 milliAmps is max from ports
  • pulse width modulation-pwm = ~
  • http://osoyoo.com/2017/07/24/arduino-lesson-obstacle-avoidance-sensor/ 
Cyborgs and Space Discussion 
  • Cybernetics-known as artificial intelligence; studies of systems and how they auto-regulate and make decisions.
  • Homeostasis; cybernetics developed out of attempts to create a better defense mechanism.
  • Cyborg-robot like problems set to take care of themselves so that humans can explore and do more.
  • Man become a slave to the machine when it has to continuously stop and attend to remedial tasks that technology should be able to take care of.
  • Implants and mergers of machines in our bodies.
  • cochlear implant-stimulate the auditory nerve
  • Signless magnitude change
  • Temperature IR readings
  • Test cold objects
  • Test different temperature conditions
  • The loop keeps repeating, so the initial beginning sensor reading would continue to change and not be reliable if the object stopped moving.
  • What can I do with a temperature IR sensor as far as a new project, and how would i program the lights and buzzer to this new idea
  • Setting a threshold value
  • proximity
  • ultrasonic

Week Fifteen Experience Documentation

Reflection
  • I then built the head piece for my project. I used:
    • 8 and 12 gauge wire.
    • hot glue
    • an adjustable face shield, but removed the shield
  • The order I made the project was:
    • I secured the sensors to the head piece.
    • I connected all of the power and ground wires from the sensors to one power and ground wire, which got glued underneath the head piece.
    • I forcefully bent the metal around the head piece in the shape I wanted, and then wrapped it around where the black piece for tightening meets the head piece. I then tightened the black pieces to secure the wire.
    • I soldered the capacitor and resistor to the LED strip.
    • I glued the LED strip to the 12 gauge metal.
    • I glued pieces of 8 gauge metal on the back of the arduino, and then looped a piece underneath.
    • I made a necklace shape, and then a simple hooking mechanism by bending the wire.
    • I placed the arduino loop onto the necklace shape, creating an arduino necklace.
    • I measure the lengths of all the wires to the arduino while wearing the head piece.
    • I braided and heat shrink wrap around the wires to the arduino.
    • I placed a battery on the back of the arduino.
  • Ta-dah. For more information, the method was described in detail in my instructables found in another blog post.
Overall, I learned a lot this semester. As a reflection, this semester was a struggle as far as making sure I had the right parts and objects, since most of what I wanted to use either had technicalities I didn't know how to overcome or simply didn't work as I was hoping. But overall, I persisted, and with the help of Thomas and my peers, as well as my own randomness and research, I managed to come up with a new idea for the parts I had available. While I probably could have started earlier on the actual building of some of my projects, I felt that I had a good schedule as far as how I handed the electronic portion of the class. If I ever came back to the Noise Project and this final project, now that I know how the electronics work, I would think more seriously about what interface I'd like to use. However, I'm glad that at the very least my electronics have continued to work as I needed them to this semester, and I enjoyed working with LEDs, since it provided a way for me to immediately see the effects of my program and soldering. 

Week Fourteen Experience Documentation

Reflection
Monday
  • On Monday, I created both a program and system that utilized four proximity sensors and four LEDs.
  • First, I wired one sensor to the board using the online example from: Arduino Lesson for sensor
    • I noticed that there was not a large distance range, and I tried tweaking the sensor with a small screw driver to make the range a little larger.
    • After getting the sensor to work, I initialized 3 other sensors so that I knew all three worked and all three were set to the same range.
  • Next, I wired a setup on the bread board that would allow me to test all four sensors for proximity distance, and i wired four LEDs on the board so that one LED would correlate to one sensor.
    • The sensors were wired from ports 2-5, named in the order yellow, green, purple, and brown, based off of the color of the output port on the sensor.
    • The LEDs were wired from ports 9-12, with 12 being yellow, down to 9 being brown.
    • All LEDs were wired from their specific ports, and all the ends of the LEDs led to the same ground port, which tied into the arduino.
    • All of the sensors shared the same vcc/power port, and the same ground. However, their output was plugged into specific ports on the arduino.
  • After this was completed, a test was run to see if I could use anolog readings to determine distance, but the range was so limited that it was not possible. I will be changing my design to react simply to something being in front of the sensor in relation to and LED rather than having varying reactions in accordance to the distance of an object from my sensor.
  • Someone told me about two good forums to look at if I had issues:
  • This is the tutorial I was looking over that Thomas suggested that talks about how to program LEDs: Neopixel Guide.
  • The programs for testing one sensor and testing four sensors can be found below.
  • The video for testing four sensors can be seen below the two programs in figure 1.
--------------------------------------------------------------------------------------------------------------------------
Code for testing one sensor:
int LED = 13; // Use the onboard Uno LED
int isObstaclePin = 2;  // This is our input pin
int isObstacle = HIGH;  // HIGH MEANS NO OBSTACLE

void setup() {
  pinMode(LED, OUTPUT);
  pinMode(isObstaclePin, INPUT);
  Serial.begin(9600);  
}

void loop() {
  isObstacle = digitalRead(isObstaclePin);
  if (isObstacle == LOW)
  {
    Serial.println("OBSTACLE!!, OBSTACLE!!");
    digitalWrite(LED, HIGH);
  }
  else
  {
    Serial.println("clear");
    digitalWrite(LED, LOW);
  }
  delay(200);
}

--------------------------------------------------------------------------------------------------------------------------

Code for testing four sensors:

int yLED = 12; // Use the onboard Uno LED
int gLED = 11; //LED
int pLED = 10; //led
int bLED = 9; //led

int yellowObst = 2;  // Sensor 1
int isYellow = HIGH; // HIGH MEANS NO OBSTACLE FOR SENSOR 1

int greenObst = 3; //sensor 2
int isGreen = HIGH; //HIGH MEANS NO OBSTACLE FOR SENSOR 2

int purpleObst = 4; //sensor 3
int isPurple = HIGH; //HIGH MEANS NO OBSTACLE FOR SENSOR 3

int brownObst = 5; //sensor 4
int isBrown = HIGH;  // HIGH MEANS NO OBSTACLE FOR SENSOR 4

void setup() {
  //led outputs
  pinMode(yLED, OUTPUT);
  pinMode(gLED, OUTPUT);
  pinMode(pLED, OUTPUT);
  pinMode(bLED, OUTPUT);
  //end led outputs
  
  //sensor inputs
  pinMode(isYellow, INPUT);
  pinMode(isGreen, INPUT);
  pinMode(isPurple, INPUT);
  pinMode(isBrown, INPUT);
  //end sensor outputs
  
  Serial.begin(9600);  
}

void loop() {

//DECLARE IF SENSOR 1 (YELLOW) IS ACTIVE
  isYellow = digitalRead(yellowObst);
  if (isYellow == LOW)
  {
    Serial.println("OBSTACLE!!, OBSTACLE!! on Sensor 1 (yellow)");
    digitalWrite(yLED, HIGH);
  }
    else
  {
    //Serial.println("clear");
    digitalWrite(yLED, LOW);
  }
  //delay(200);

//END SENSOR 1 READING

//DECLARE IF SENSOR 2 (GREEN) IS ACTIVE
  isGreen = digitalRead(greenObst);
  if (isGreen == LOW)
  {
    Serial.println("OBSTACLE!!, OBSTACLE!! on Sensor 2 (green)");
    digitalWrite(gLED, HIGH);
  }
    else
  {
    //Serial.println("clear");
    digitalWrite(gLED, LOW);
  }
  //delay(200);

//END SENSOR 2

//DECLARE IF SENSOR 3 (PURPLE) IS ACTIVE
  isPurple = digitalRead(purpleObst);
  if (isPurple == LOW)
  {
    Serial.println("OBSTACLE!!, OBSTACLE!! on Sensor 3 (purple)");
    digitalWrite(pLED, HIGH);
  }
    else
  {
    //Serial.println("clear");
    digitalWrite(pLED, LOW);
  }
  //delay(200);

//END SENSOR 3 READING

//DECLARE IF SENSOR 4 (BROWN) IS ACTIVE
  isBrown = digitalRead(brownObst);
  if (isBrown == LOW)
  {
    Serial.println("OBSTACLE!!, OBSTACLE!! on Sensor 4 (brown)");
    digitalWrite(bLED, HIGH);
  }
    else
  {
    //Serial.println("clear");
    digitalWrite(bLED, LOW);
  }
  //delay(200);

//END SENSOR 4 READING
  /*
  else
  {
    Serial.println("clear");
    digitalWrite(LED, LOW);
  }*/
  delay(200);
}

--------------------------------------------------------------------------------------------------------------------------

Figure 1. Test for sensors.


Wednesday
  • On Wednesday, Thomas and I tried to get the Neopixels that I ordered from Amazon working, but there seemed to be some sort of issue with the wiring that did not work well with any of the programs provided by Adafruit or otherwise. We tried a fastled library, as well as a Neopixel library.
    • While not useful for this project, the LEDs I ordered come with a sound sensor that allows me to have the lights change color automatically, although I don't know how to change them to fit my wants.
  • Thomas loaned me an LED strip, which we then tested with the Adafruit programs. It worked fine, proving that there was either an issue or some unclear formatting with the pixels I ordered. After running the initial coding and ensuring that the strip worked properly, I went through and edited the code to change according to the sensor input.
  • My sensors remained wired to pins 2-5, while the led strip was wired to pin 6. LEDs 0-2 were linked to sensor 1, LEDs 3-5 were linked to sensor 2, LEDs 6-8 were linked to sensor 3, and LEDs 9-11 were linked to sensor 4. 
    • The numbering used, 0-11, corresponds to the physical LED positions on the strip, 1-12.
  • So, while all remain green when clear, when the corresponding sensor is activated, the 3 sensors linked to a specific sensor turn red. 
  • The program for this can be found below.
  • The test for this can be seen below the code, in figure 2.
--------------------------------------------------------------------------------------------------------------------------
Code for testing LED strip:

// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library

//DECLARE SENSORS
int yellowObst = 2;  // Sensor 1
int isYellow = HIGH; // HIGH MEANS NO OBSTACLE FOR SENSOR 1

int greenObst = 3; //sensor 2
int isGreen = HIGH; //HIGH MEANS NO OBSTACLE FOR SENSOR 2

int purpleObst = 4; //sensor 3
int isPurple = HIGH; //HIGH MEANS NO OBSTACLE FOR SENSOR 3

int brownObst = 5; //sensor 4
int isBrown = HIGH;  // HIGH MEANS NO OBSTACLE FOR SENSOR 4
//END DECLARE SENSORS


#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
  #include <avr/power.h>
#endif

// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1
#define PIN            6

// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS      12

// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

int delayval = 5; // delay for half a second

void setup() {
  // This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (__AVR_ATtiny85__)
  if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
  // End of trinket special code

  pixels.begin(); // This initializes the NeoPixel library.

  //LED STRIP
  //pinMode(PIN, OUTPUT);
  //END LED STRIP
  
  //sensor inputs
  pinMode(isYellow, INPUT);
  pinMode(isGreen, INPUT);
  pinMode(isPurple, INPUT);
  pinMode(isBrown, INPUT);
  //end sensor outputs

  Serial.begin(9600); 
}

void loop() {

  // For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.

//DECLARE IF SENSOR 1 (YELLOW) IS ACTIVE
  isYellow = digitalRead(yellowObst);
  if (isYellow == LOW)
  {
    //Serial.println("OBSTACLE!!, OBSTACLE!! on Sensor 1 (yellow)");
    for(int i=0;i<3;i++){

    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor(i, pixels.Color(25,0,0)); // Moderately bright green color.

    pixels.show(); // This sends the updated pixel color to the hardware.

    delay(delayval); // Delay for a period of time (in milliseconds).
  }
    }
    else
  {
    //Serial.println("clear");
    for(int i=0;i<3;i++){
      // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor(i, pixels.Color(0,25,0)); // Moderately bright green color.

    pixels.show(); // This sends the updated pixel color to the hardware.

    delay(delayval); // Delay for a period of time (in milliseconds).
  }
  }
//END SENSOR 1 READING

//DECLARE IF SENSOR 2 (GREEN) IS ACTIVE
  isGreen = digitalRead(greenObst);
  if (isGreen == LOW)
  {
    //Serial.println("OBSTACLE!!, OBSTACLE!! on Sensor 1 (yellow)");
    for(int i=3;i<6;i++){

    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor(i, pixels.Color(25,0,0)); // Moderately bright green color.

    pixels.show(); // This sends the updated pixel color to the hardware.

    delay(delayval); // Delay for a period of time (in milliseconds).
  }
    }
    else
  {
    //Serial.println("clear");
    for(int i=3;i<6;i++){
      // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor(i, pixels.Color(0,25,0)); // Moderately bright green color.

    pixels.show(); // This sends the updated pixel color to the hardware.

    delay(delayval); // Delay for a period of time (in milliseconds).
  }
  }
//END SENSOR 2 READING

//DECLARE IF SENSOR 3 (PURPLE) IS ACTIVE
  isPurple = digitalRead(purpleObst);
  if (isPurple == LOW)
  {
    //Serial.println("OBSTACLE!!, OBSTACLE!! on Sensor 1 (yellow)");
    for(int i=6;i<9;i++){

    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor(i, pixels.Color(25,0,0)); // Moderately bright green color.

    pixels.show(); // This sends the updated pixel color to the hardware.

    delay(delayval); // Delay for a period of time (in milliseconds).
  }
    }
    else
  {
    //Serial.println("clear");
    for(int i=6;i<9;i++){
      // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor(i, pixels.Color(0,25,0)); // Moderately bright green color.

    pixels.show(); // This sends the updated pixel color to the hardware.

    delay(delayval); // Delay for a period of time (in milliseconds).
  }
  }
//END SENSOR 3 READING

 //DECLARE IF SENSOR 4 (BROWN) IS ACTIVE
  isBrown = digitalRead(brownObst);
  if (isBrown == LOW)
  {
    //Serial.println("OBSTACLE!!, OBSTACLE!! on Sensor 1 (yellow)");
    for(int i=9;i<=12;i++){

    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor(i, pixels.Color(25,0,0)); // Moderately bright green color.

    pixels.show(); // This sends the updated pixel color to the hardware.

    delay(delayval); // Delay for a period of time (in milliseconds).
  }
    }
    else
  {
    //Serial.println("clear");
    for(int i=9;i<=12;i++){
      // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
    pixels.setPixelColor(i, pixels.Color(0,25,0)); // Moderately bright green color.

    pixels.show(); // This sends the updated pixel color to the hardware.

    delay(delayval); // Delay for a period of time (in milliseconds).
  }
  }
//END SENSOR 4 READING

}

----------------------------------------------------------------------------------------------

Figure 2. Test for LED strip.



Week Thirteen Experience Documentation

Reflection

  • Class was optional on Monday, and class was cancelled on Wednesday for Thanksgiving.
  • Nothing really happened this week other than the proximity sensors I ordered being delivered. 

Week Twelve Experience Documentation

Reflection

Week Eleven Experience Documentation

Reflection
  • On Wednesday, our class had a critique where we looked at everyone's sensor prototype. The sensor merely needed to read a value, and we had to have some kind of system that illustrated an output dependent on the readings from the sensor.
  • My overall sensor, program, and system worked fine, but Thomas and I discussed that my sensor may not work very well for my project. More information on the prototype can be found in another post.
    • While I was programming it to work as a proximity sensor, he was saying that there was no definite link between ambient and relative temperature, and therefore may pose a problem in measure distance if the ambient temperature was extremely hot or cold and influenced the readings of the sensor. 
  • My partner and I created our bullet-list of information from chapters 7 and 8 of Natural Born Cyborgs.

Natural Born Cyborgs Chapters 7 and 8

Information was originally in a Google Docs file with my and my partner's notes: Link to Notes for Chapters 7 and 8

First Prototype Using an Infrared Sensor

I did not manage to take a picture of the setup, but the code for the sensor can be seen below. However, I ended up making another prototype that did the same thing using different infrared proximity sensors. More information can be found in a later post.

--------------------------------------------------------------------------------------------------------------------------
Code for testing four LEDs:

// int ledPin = 13;  example code

int ledBlue = 13;
int ledWhite = 12;
int ledGreen = 11;
int ledClear = 10;

void setup() {
//pinMode(ledPin, OUTPUT); example code
pinMode(ledBlue, OUTPUT);
pinMode(ledWhite, OUTPUT);
pinMode(ledGreen, OUTPUT);
pinMode(ledClear, OUTPUT);
}

void loop() {
digitalWrite(ledBlue, HIGH);
delay(1000);
digitalWrite(ledBlue, LOW);
delay(1000);

digitalWrite(ledWhite, LOW);
delay(1000);
digitalWrite(ledWhite, HIGH);
delay(1000);

digitalWrite(ledGreen, HIGH);
delay(1000);
digitalWrite(ledGreen, LOW);
delay(1000);

digitalWrite(ledClear, LOW);
delay(1000);
digitalWrite(ledClear, HIGH);
delay(1000);

}

--------------------------------------------------------------------------------------------------------------------------

Code for infrared prototype:

/*************************************************** 
  This is a library example for the MLX90614 Temp Sensor

  Designed specifically to work with the MLX90614 sensors in the
  adafruit shop
  ----> https://www.adafruit.com/products/1747 3V version
  ----> https://www.adafruit.com/products/1748 5V version

  These sensors use I2C to communicate, 2 pins are required to  
  interface
  Adafruit invests time and resources providing this open source code, 
  please support Adafruit and open-source hardware by purchasing 
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.  
  BSD license, all text above must be included in any redistribution
 ****************************************************/

#include <Wire.h>
#include <Adafruit_MLX90614.h>

Adafruit_MLX90614 mlx = Adafruit_MLX90614();

void setup() {
  Serial.begin(9600);

  Serial.println("Adafruit MLX90614 test");  

  mlx.begin();  
}

void loop() {
//Sensor reading and display of values.
  Serial.print("Ambient = "); 
  Serial.print(mlx.readAmbientTempC()); 
  Serial.print("*C\tObject = "); 
  Serial.print(mlx.readObjectTempC()); 
  Serial.println("*C");
  Serial.print("Ambient = "); 
  Serial.print(mlx.readAmbientTempF()); 
  Serial.print("*F\tObject = "); 
  Serial.print(mlx.readObjectTempF()); 
  Serial.println("*F");

  Serial.println();
//end Sensor reading and print 

//led variable declaration
  float ledBlue = mlx.readObjectTempF();
  float ledWhite = mlx.readObjectTempF();
  float ledBTwo = mlx.readObjectTempF();
  float ledWTwo = mlx.readObjectTempF();
//end led variable declaration

  
//ledBlue 1
  if (ledBlue >= 72 && ledBlue<= 72.7){  //ledBlue if someone is between 72 
                                   //and 72.7 distance, inital blue led.
    digitalWrite(13, HIGH);
  }
  else{
    digitalWrite(13, LOW);
  }                                
//end ledBlue

//ledWhite 2
  if (ledWhite >= 72.71 && ledWhite<= 73.17){  //ledWhite: if someone is between 72.71 
                                   //and 73.17 distance, first white led.
    digitalWrite(12, HIGH);
  }
  else{
    digitalWrite(12, LOW);
  }                                
//end ledWhite

//ledBTwo 3
  if (ledBTwo >= 73.18 && ledBTwo<= 74.21){  //ledBTwo: if someone is between 73.18
                                   //and 74.21 distance, second blue led.
    digitalWrite(11, HIGH);
  }
  else{
    digitalWrite(11, LOW);
  }         
//end ledBTwo

//ledWTwo 4
  if (ledWTwo >= 74.22){  //ledWTwo: if someone is over 74.22 
                                   //, second blue led.
    digitalWrite(10, HIGH);
  }
  else{
    digitalWrite(10, LOW);
  }         
//end ledWTwo
  
  delay(900);

}

Week Ten Experience Documentation

Reflection
  • I was not in class Monday because of a family issue, but the class may have discussed chapters 5 and 6 of Natural Born Cyborgs, more information on which can be found in another post.
  • On Wednesday we had a photocells workshop, where we messed around with a photocell and learned some new code terminology. More information on the lab can be found on another post.
  • The infrared sensors I ordered were delivered. The sensors I bought are these: Link to Infrared Sensors.
  • The buzzard I ordered also was delivered. The buzzard I ordered was this: Link to Buzzard

Photocells

Link to website with instructions: Adafruit Photocells

Notes from instructions:
The basic information
  • Photocells are sensors that detect light. They are often referred to as CdS cells, LDRs, and photoresistors.
    • They are referred to as CdS cells (Cadmium-Sulfide) because of the material they are made of.
    • LDRs are light-dependent resistors.
  • Depending on how much light is being received by the cell, its resistive value is changed in Ohms.
    • Every photocell will react differently, so you have to set your program and readings to your specific photocell.
    • Variations can be 50% or more.
  • A diagram of a photocells parts can be seen in figure 1.

Figure 1. Diagram from Adafruit website.

  • As the level of light increases, the resistance decreases.
  • Usually, photocells tend to sensitive to light between 700nm (red and 500nm (green) light.
  • Lux- the SI unit of illuminance, equal to one lumen per square meter.
    • Used to measure the amount of resistance at different levels of light. A table taken from the website is shown below:
Illuminance Example
0.002 lux Moonless clear night sky
0.2 lux Design minimum for emergency lighting (AS2293).
0.27 - 1 lux Full moon on a clear night
3.4 lux Dark limit of civil twilight under a clear sky
50 lux Family living room
80 lux Hallway/toilet
100 lux Very dark overcast day
300 - 500 lux Sunrise or sunset on a clear day. Well-lit office area.
1,000 lux Overcast day; typical TV studio lighting
10,000 - 25,000 lux Full daylight (not direct sun)
32,000 - 130,000 lux Direct sunlight

The workshop
  • Before programming the sensors, we used a multimeter to measure how resistance changed according to how much light the photocell was receiving.
    • Alligator clips were attached to the cell's legs, while the other end of the alligator clips attached to the tools from the multimeter.
  • As shown in figure 2, the the photocell was connected to the arduino using a resistor. Power is run through the positive leg of the cell, and ground is run through a resistor to the cathode leg. In the same row where the resistor connects to the cathode leg, a wire sends information to analog pin 0 on the arduino board. 
Figure 2. Image of how to set up the photocell.

  • If in a dark area, a 10k resistor should be used. If in a bright area, a 1k resistor should be used so that the photocell does not saturate, or become incapable of reading the amount of light coming through.
  • An equation showing that the "voltage is proportional to the inverse of the photocell resistance which is, in turn, inversely proportional to light levels is: Vo = Vcc ( R / (R + Photocell) )
  • After running a basic test to determine how our sensors were reading the amount of light, a simple program was made that changes the brightness of an LED depending on the amount of light being received. The results are shown in figure 3 and figure 4.
  • The program for the photocell is shown in figure 5.
Figure 3. The LED dimmed when I reduced the amount of light.

Figure 4. The LED brightened when the amount of light increased.


Figure 5. Code for photocell.



Week Nine Experience Documentation

Reflection

  • On Monday, each of use presented our project proposals and we critiqued each other. The information regarding my project proposal can be found in another post.
  • Notes from critique:
    • The idea of incorporating proximity sensors (that would sense a person approaching) with LEDs (that would change colors to illustrate the approaching person) was well received.
    • While the hoodie was a good idea, some issues such as the electronics being securely placed on the hoodie and the hoodie needing to be washed were brought up. It was suggested that I use a material that would not need to be washed, or find a way to have the electronics incorporated in a way that would make them easily removable.
    • It was suggested that the idea of changing colors in response to another person is reminiscent of animal protection mechanisms, and I will research a bit to figure out a better interface while keeping this idea in mind.
  • Class on Wednesday was cancelled early after a small discussion on chapters 3 and 4 of Natural Born Cyborgs, more information on which can be found in another post, because a lot of different things were occurring in the department.

Project Proposal

Inspiration:

  • I received a lot of inspiration from Instructables, specifically from the project Proximity Hat. In this design, the author used a proximity sensor to avoid hitting objects. I really liked the idea of layering two hats in order to keep the object wearable with a separation between the electronics.
  • I was also vaguely considering ideas from the Anti-Rape Lingerie design we were introduced to in the beginning of the class.
Figure 1. Image from Instructables Proximity Hat post.

Figure 2. Image from Instructables Proximity Hat post.

Design:

  • I decided to make a hoodie that utilizes proximity sensors to react when people get close to me.
  • When within distance, red and blue LEDs will alternate, reminiscent of police lights. Similarly, noise from a buzzer will be activated through speakers.
  • The original basis was that if an attacker got close, the hoodie would hopefully spook the attacker, or at least make enough noise to attract attention. However, the general idea can be expanded to spooking anyone that tries to get close when you're just not in the mood to be close to people.
Figure 3.Sketch of beginning design.

Figure 4.Sketch of beginning design.

Items to be Used:

Figure 5. Shirt that could be worn underneath hoodie.

Figure 6. Hoodie that could be used.
Figure 7. LEDs that could be used on hoodie.

Figure 8. Speaker that could be used to create louder noise.

Figure 9. Buzzard that could be used.

Figure 10. Possible proximity sensor.

Prices:

  • Undershirt: $12.33
  • Hoodie: $10.65
  • 2 Flexible LED Strips: $29.98
  • 2 Mini Speakers: $2.58
  • Buzzer: $5.76
  • 2 Proximity Sensors: $9.00
Current Total: $70.30