Saturday, December 16, 2017

Final Project

Final Project

My project is designed to detect an approaching object or subject up to 20cm thanks to the Proximity IR detector provided by my 27 Egeloo sensor kit.
Here is a list of what you need: List of items: 
1. WS2812b Neo Pixel LED's 
2. Power supply ( I used a 9V battery to power my Matrix and Uno) and a 22,000mA solar power charger. 
3. 2 10k Resistor 
4.Arduino Uno R3
6. Code: ​https://github.com/adafruit/Adafruit_NeoPixel (go to GitHub and download the code, open using the Arduino IDE software)
7. Jumpers and small gauge wires of black(Ground), red(power), and blue(data). They only need to able to support your maximum output/input wattage.
8. A backpack 
9. Soldering Iron/ Solder
After you have tested your Arduino and downloaded the IDE software. (FYI, there are great examples such as Blinky to test your Arduino Uno with built in the downloadable IDE software provided by Arduino). Now its time to test your Neo Pixels. After the test comes back positive you can move on to building your proximity backpack.
You need to cut a piece of Worbla approximately, 4 1/2in W x 6 1/2in H. I choose Worbla because it is a very flexible material and this would come in handy being that my prop is a backpack.
The assembly of the matrix (use the 144/pixels) is pretty straightforward. All you need to do is cut 2" to 2 1/4 inch groupings of the data, power, and ground cables. you need a total of 24 of them because you will use them to connect each section of the strand in order. The 144/pixel will need to be in cut strands of 12 pixels or 2 1/4in long.
Now, the best practice while sodering your sections is to stop and check to see if they are working as you go. Trust me, this will save you a lot of time and heartache. Once your matrix is completed, it's time to test the code again to make sure it works. Success!
Time to build the rest. The 30/pixels are easier to deal with but you have 5 meters of these LED's so good luck. I did not want to trim off my LED's because I was afraid of creating too many broken connections. This is a problem if you do not soder your power, ground or data properly, so take your time and be careful. Check your code one more time to make sure all the connections work and move on to the next step.
I used brass wire to create a wired/electronic look to my backpack. I wanted it to look as much as a machine as possible. I believe that this was a successful approach, but I am considering sewing the 30/pixel LEDs onto the backpack for a clean look.
Time to splice our wires and clean-up our mess. I used a small box to hold my Arduino and 9V battery. I also used twist ties to gather my wires in groups from the front to the back of the backpack. Staying organized is very important when dealing with so many wires. I found myself mixing up wires often. The best practice is to unplug your Arduino and make sure that you are using the correct ports first before adding power.
Splitting a USB cable and pulling only the black and red cable, you can now connect your power cell to your WS2812b 30/pixels. I discovered that the additional ground to the Arduino is not needed when using this build. Only use one ground.
Time for the 144/pixels, so connect the ground, data, and power cable directly to the Arduino for the matrix. This method consumes the life of the 9V quickly, but it gave me the best results. I will try to connect it to the power cell next time.
The proximity IR detector worked successfully with my original code, but I wanted to have more cycles and a brighter experience. I discovered that I did not have enough power available to my LED's to pull this off, so I had to return to my original test code to wrap up this project. I feel that overall this was still a successful experiment and build. I hope much luck to anyone that wants to build there own and be mindful of power draws/requirements that was something that I did not discover to be a big issue until the end. I am posting my final video to show the backpacks full capability. The 9V battery does die during the video, but you will get to see the overall success of my proximity backpack. Thanks and Salute:-)

Friday, December 15, 2017

Testing the WS2812b LEDs

 Testing the WS2812b LEDs


I purchased Involt's WS2812b 144/pixels/1m and the 30/pixels/5m rolls. I was able to test the strips by modifying code provided by the author: 'Dr. D-Flo' https://youtu.be/bdIij70_VN0. Dr. D-Flo has a very informative YouTube Video that explains the entire testing process in detail. I will share a few troubleshooting notes as you continue reading. 

I will share the code used to make the magic happen here in a second. 
Let's start with a supply list.


List of items:

1. WS2812b Neo Pixel LED's
2. Power supply: 9V battery or computer USB port (note the 9V has a life of approximately 15mins)
3.10k Resistor
4.Arduino Uno R3
5. Arduino Uno IDE (download here:https://www.arduino.cc/en/Main/Software

Note: Very important to make your connections on the Arduino first before powering up the board. This will assure the LED's and the Arduino are both grounded and protected from electrical surges.


Next: Let's review the code that we are going to use to test our LED's. Again, thank you Dr. D-Lo.


int buttonpin=3; //define switch pin 
//I will be using a proximity board from Egeloo that will 
//allow me to detect an object by using Infared light reflected off the object that
//triggers the switch. Acting as a button, the proximity will cause the lights 
//to change their pattern or turn them off.
;int  val;//define digital variable val

#include <Adafruit_NeoPixel.h>  // I am using Involt WS2812b 144/pixels/1M and an Involt 30/pixels/5M //strands. This code was used with the Arduino Uno, a 22,000mA Power //Cell, a 9V battery. The maximum voltage for the Arduino and the //Neo Pixels is 5V. The code uses NEO_KHZ800 to regulate power that //worked great for my needs. You can adjust this number to suit your //needs          
#ifdef __AVR__
  #include <avr/power.h>
#endif

#define PIN 6

#define NUM_LEDS 294 //I added the numbers of pixels from both types; 1 meter of 144/pixels and 5                          //meters of 30/pixels.

#define BRIGHTNESS 50 //You can adjust this value as needed or change the color values below to control //the light intensity.

Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRBW + NEO_KHZ800); //Change //KHZ here.


byte neopix_gamma[] = {
    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  1,  1,
    1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  2,  2,  2,  2,  2,  2,
    2,  3,  3,  3,  3,  3,  3,  3,  4,  4,  4,  4,  4,  5,  5,  5,
    5,  6,  6,  6,  6,  7,  7,  7,  7,  8,  8,  8,  9,  9,  9, 10,
   10, 10, 11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16,
   17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 24, 24, 25,
   25, 26, 27, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36,
   37, 38, 39, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 50,
   51, 52, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68,
   69, 70, 72, 73, 74, 75, 77, 78, 79, 81, 82, 83, 85, 86, 87, 89,
   90, 92, 93, 95, 96, 98, 99,101,102,104,105,107,109,110,112,114,
  115,117,119,120,122,124,126,127,129,131,133,135,137,138,140,142,
  144,146,148,150,152,154,156,158,160,162,164,167,169,171,173,175,
  177,180,182,184,186,189,191,193,196,198,200,203,205,208,210,213,
  215,218,220,223,225,228,231,233,236,239,241,244,247,249,252,255 };

void  setup()
{
int(strip,OUTPUT);//define LED as a output port
int(buttonpin,INPUT);//define switch as a output port



  strip.setBrightness(BRIGHTNESS);
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}

void loop() {
  
  // Some example procedures showing how to display to the pixels:
  colorWipe(strip.Color(255, 0, 0), 50); // Red
  colorWipe(strip.Color(0, 255, 0), 50); // Green
  colorWipe(strip.Color(0, 0, 255), 50); // Blue
  colorWipe(strip.Color(0, 0, 0, 255), 50); // White

  whiteOverRainbow(20,75,5);  

  pulseWhite(5); 

  // fullWhite();
  // delay(2000);

  rainbowFade2White(3,3,1);


}

// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
  for(uint16_t i=0; i<strip.numPixels(); i++) {
    strip.setPixelColor(i, c);
    strip.show();
    delay(wait);
  }
}

void pulseWhite(uint8_t wait) {
  for(int j = 0; j < 256 ; j++){
      for(uint16_t i=0; i<strip.numPixels(); i++) {
          strip.setPixelColor(i, strip.Color(0,0,0, neopix_gamma[j] ) );
        }
        delay(wait);
        strip.show();
      }

  for(int j = 255; j >= 0 ; j--){
      for(uint16_t i=0; i<strip.numPixels(); i++) {
          strip.setPixelColor(i, strip.Color(0,0,0, neopix_gamma[j] ) );
        }
        delay(wait);
        strip.show();
      }
}


void rainbowFade2White(uint8_t wait, int rainbowLoops, int whiteLoops) {
  float fadeMax = 100.0;
  int fadeVal = 0;
  uint32_t wheelVal;
  int redVal, greenVal, blueVal;

  for(int k = 0 ; k < rainbowLoops ; k ++){
    
    for(int j=0; j<256; j++) { // 5 cycles of all colors on wheel

      for(int i=0; i< strip.numPixels(); i++) {

        wheelVal = Wheel(((i * 256 / strip.numPixels()) + j) & 255);

        redVal = red(wheelVal) * float(fadeVal/fadeMax);
        greenVal = green(wheelVal) * float(fadeVal/fadeMax);
        blueVal = blue(wheelVal) * float(fadeVal/fadeMax);

        strip.setPixelColor( i, strip.Color( redVal, greenVal, blueVal ) );

      }

      //First loop, fade in!
     if(val==HIGH)//when the switch sensor have signal, LED blink
    {
    

    }

        strip.show();
        delay(wait);
    }
  
  }



  delay(500);


  for(int k = 0 ; k < whiteLoops ; k ++){

    for(int j = 0; j < 256 ; j++){

        for(uint16_t i=0; i < strip.numPixels(); i++) {
            strip.setPixelColor(i, strip.Color(0,0,0, neopix_gamma[j] ) );
          }
          strip.show();
        }

        delay(2000);
    for(int j = 255; j >= 0 ; j--){

        for(uint16_t i=0; i < strip.numPixels(); i++) {
            strip.setPixelColor(i, strip.Color(0,0,0, neopix_gamma[j] ) );
          }
          strip.show();
        }
  }

  delay(500);


}

void whiteOverRainbow(uint8_t wait, uint8_t whiteSpeed, uint8_t whiteLength ) {
  
  if(whiteLength >= strip.numPixels()) whiteLength = strip.numPixels() - 1;

  int head = whiteLength - 1;
  int tail = 0;

  int loops = 3;
  int loopNum = 0;

  static unsigned long lastTime = 0;


  while(true){
    for(int j=0; j<256; j++) {
      for(uint16_t i=0; i<strip.numPixels(); i++) {
        if((i >= tail && i <= head) || (tail > head && i >= tail) || (tail > head && i <= head) ){
          strip.setPixelColor(i, strip.Color(0,0,0, 255 ) );
        }
        else{
          strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
        }
        
      }

      if(millis() - lastTime > whiteSpeed) {
        head++;
        tail++;
        if(head == strip.numPixels()){
          loopNum++;
        }
        lastTime = millis();
      }

      if(loopNum == loops) return;
    
      head%=strip.numPixels();
      tail%=strip.numPixels();
        strip.show();
        delay(wait);
    }
  }
  
}
void fullWhite() {
  
    for(uint16_t i=0; i<strip.numPixels(); i++) {
        strip.setPixelColor(i, strip.Color(0,0,0, 255 ) );
    }
      strip.show();
}


// Slightly different, this makes the rainbow equally distributed throughout
void rainbowCycle(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256 * 5; j++) { // 5 cycles of all colors on wheel
    for(i=0; i< strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

void rainbow(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256; j++) {
    for(i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel((i+j) & 255));
    }
    strip.show();
    delay(wait);
  }
}

// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
  WheelPos = 255 - WheelPos;
  if(WheelPos < 85) {
    return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3,0);
  }
  if(WheelPos < 170) {
    WheelPos -= 85;
    return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3,0);
  }
  WheelPos -= 170;
  return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0,0);
}

uint8_t red(uint32_t c) {
  return (c >> 16);
}
uint8_t green(uint32_t c) {
  return (c >> 8);
}
uint8_t blue(uint32_t c) {
  return (c);
}



You want to protect your Arduino as much as you can so make sure that you add your resistor between the Arduino and the LED's to help regulate voltage transfer through the data cable.


I was able to test both the 144/pixels and 30/pixels using the same code successfully. 



Thanks and enjoy.



Experimenting with Bluetooth

Proximity Back Pack Process

I wanted to try adding a HC-05 Bluetooth component to my piece in order to control my LEDs.


I was able to find an app called Arduino Bluetooth Controller.


I was able to get the HC-05 Bluetooth adapter to work with the Arduino using code from Instructables. https://www.instructables.com/id/AT-command-mode-of-HC-05-Bluetooth-module/


I used 8 jumpers, a breadboard, and a 1k and 2k resistor. 


After you plug in all your components. all you have to do next is plug your Arduino into your computer and upload the code provided from the Instructables. You can download the above app to interact with the HC-05.





Wednesday, November 8, 2017

AMP Hours and Voltage



AMP Hours and Voltage 
Things to Remember


I met with my instructor and discussed several very important topics to remember while I'm building

my project. First, I need to be aware of my voltage total such as the Arduino total Voltage is 5V and

a strip of Neopixel LEDs is 5V. This is very important because to much could fry my tech. Also, I

need to be mindful of AMP hours. I need a total of 20-25mA/hr to supply my devices/tech with x

number of v/watts for x number of hours. I want to be able to use my backpack over a period of 8

hours= 1 full business day.

Monday, November 6, 2017

Chapter 4-6 Natural Born Cyborg Lecture

Chapter 4-6 Natural Born Cyborg Lecture

Is Telepresence reality?

Psychological
Ethics

Platos cave:
In the allegory, Plato likens people untutored in the Theory of Forms to prisoners chained in a cave, unable to turn their heads. All they can see is the wall of the cave. Behind them burns a fire.  Between the fire and the prisoners there is a parapet, along which puppeteers can walk. The puppeteers, who are behind the prisoners, hold up puppets that cast shadows on the wall of the cave. The prisoners are unable to see these puppets, the real objects, that pass behind them. What the prisoners see and hear are shadows and echoes cast by objects that they do not see. Here is an illustration of Plato’s Cave:
From Great Dialogues of Plato (Warmington and Rouse, eds.) New York, Signet Classics: 1999. p. 316.
The 'Allegory Of The Cave' is a theory put forward by Plato, concerning human perception. Plato claimed that knowledge gained through the senses is no more than opinion and that, in order to have real knowledge, we must gain it through philosophical reasoning...

Teleporting oneself and destroying the copy every time. Are you yourself or just a copy of the original?

Advanced Telerobotics

Telerobotics
Teledildonics

Haptiks:
╦łhaptik/
adjective
technical
  1. relating to the sense of touch, in particular relating to the perception and manipulation of objects using the senses of touch and proprioception.
  2. Proprioception:
In the limbs, the proprioceptors are sensors that provide information about joint angle, muscle length, and muscle tension, which is integrated to give information about the position of the limb in space. The muscle spindle is one type o proprioceptor that provides information about changes in muscle length.

Prosthetic Limb...Is it a part of us? I believe yes. The limb is artificial but it is an artificial body part that you own and wear as a limb.

Self-ownership (or sovereignty of the individual, individual sovereignty or individual autonomy) is the concept of property in one's own person, expressed as the moral or natural right of a person to have bodily integrity, and be the exclusive controller of one's own body and life.

Our Words, Ourselves
Nero pathways…
Plastic: we are elastic and pliable

Sacades:
A saccade is a quick, simultaneous movement of both eyes between two or more phases of fixation in the same direction. The phenomenon can be associated with a shift in frequency of an emitted signal or a movement of a body part or device.

Wednesday, November 1, 2017

Arduino Flicker Tutorial

Arduino Flicker Tutorial

PWM= Pulse Width Modulation
PulseWidthModulation.png
PWM (1)with Duty.png
Here’s the Code:

int ledPin = 10; //led is attached to PWM pin 10
int ledPin2 = 9;
int ledPin3 = 8;
byte flicker[] = {180, 30, 255, 200, 10, 90, 150, 60};//eight values for my flicker
byte flicker2[] = {30, 200, 255, 180, 10, 90, 150, 60};
byte flicker3[] = {255, 180, 10, 90, 150, 60};

void setup() {
pinMode(ledPin, OUTPUT);  //THIS IS THE LED

}

void loop() {
 for(int i =0; i<7; i++){
   analogWrite(ledPin, flicker[i]);
   delay(200);
 }
   for(int j=0; j<7; j++){
   analogWrite(ledPin2, flicker2[j]);
   delay(200);
 }
   for(int k=0; k<7; k++){
   analogWrite(ledPin3, flicker3[k]);
   delay(200);
 }
}

ArduinoFlicker2.jpg

ArduinoFlickerZoom.jpg

ArdunioFlickerCode.jpg

ArdunioFlickerCompleted.jpg








Homework: Create a Relay that turns a powered device on and off…

Use a 5 pin Relay:
Simple 5 Pin Relay Wiring Diagram.jpg

Monday, October 30, 2017

Natural Born Cyborg Concept

MIT - Neri Oxman




BACTERIAL bodices and digestive dacks? It’s life, but not as we know it.
A designer’s quest to build a better space suit has inspired a new line of bacterial spacewear: Second skins intended to shock, impress — and survive.
Massachusetts Institute of Technology Professor Neri Oxman, who specialises in design, technology and biology, sparked the thought experiment through her quest to find ways to make the ultimate recyclable clothing for space travellers living out of less than a suitcase. https://goo.gl/7kg8W3

My idea expands upon coexisting or a leach effect in order to sustain necessary life sustaining functionality.
A living suit that cycles oxygen and water to us....