Watchful Eye – Final

DSC_0033

For my final I designed a Watchful Eye. Taking inspiration from Evil Eyes that protect you from harm, this device is designed with the intent of helping friends and loved ones look-out for on another. It uses the Adafruit io and IFTTT platforms to active the device from your phone so that it can be looking for your safe return. Once you get home it will send a text to your friend that you have made it safely.

Please see my instructable below for more information:

https://www.instructables.com/id/Watchful-Eye/

IMG_0976IMG_0941IMG_0906Acrylic layout


#define LED_PIN 13
#define MOTION_PIN 23

//Including NeoPixel Library
#include

#define PIXELS_PIN 13
#define NUM_LEDS 16
#define BRIGHTNESS 50
#define PIXEL_TYPE NEO_GRB + NEO_KHZ800 // Type of the NeoPixels
Adafruit_NeoPixel strip = Adafruit_NeoPixel (NUM_LEDS, LED_PIN, NEO_GRB + NEO_KHZ800);

//Including WIFI configuration
#define WIFI_SSID “Wifi name”
#define WIFI_PASS “Wifi_password”
#define IO_USERNAME “IO_username”
#define IO_KEY “IO_key”

#include “AdafruitIO_WiFi.h”
#include
#include

AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS);
#include
#include

// Variables for sensor, arming, feed
int current = 0;
int last = 0;
int armedSensor = 0;
int message = 0;

//Color variables
uint32_t low = strip.Color(0, 0, 0);
uint32_t high = strip.Color(41,196,204);
uint32_t armed = strip.Color(20,20,20);

// set up the ‘Watchful’ feed
AdafruitIO_Feed *Watchful = io.feed(“Watchful”);

//Wifi and IO set up code
void setup() {
//set up LEDs
strip.setBrightness(BRIGHTNESS);
for( int i = 0; i<NUM_LEDS; i++){
strip.setPixelColor(i, low);
}
strip.begin();
strip.show(); //Initialize all the pixels to “off”

//Set up sensor for reading
pinMode(MOTION_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);

// start the serial connection
Serial.begin(9600);

//connect to Wifi
WiFi.begin(WIFI_SSID, WIFI_PASS);
while (WiFi.status() != WL_CONNECTED){
delay(500);
Serial.println(“Connecting to WiFi..”);
}

Serial.println(“Connected to the Wifi network”);
Serial.println(WiFi.localIP());
delay(500);
// connect to io.adafruit.com
Serial.print(“Connecting to Adafruit IO”);
io.connect();

// wait for a connection
while(io.status() < AIO_CONNECTED) { Serial.print(“.”); delay(500); } // we are connected Serial.println(); Serial.println(io.statusText()); } //Main functions void loop() { // io.run(); is required for all sketches. // it should always be present at the top of your loop // function. it keeps the client connected to // io.adafruit.com, and processes any incoming data. io.run(); // set up a message handler for the feed. // the handleMessage function (defined below) // will be called whenever a message is // received from adafruit io. Watchful->onMessage(handleMessage);

//Tells you device is on standby and pixels off
if(message == 0 && armedSensor == 0){
Serial.println(“Unarmed – Standby”);
for( int i = 0; i<NUM_LEDS; i++){
strip.setPixelColor(i, low);
//strip.show();
}
strip.show();
delay(10000);
}

//Arms sensor when widget button is pressed
if(message == 1 && armedSensor == 0){
Serial.println(“Arming sensor”);
for( int i = 0; i<NUM_LEDS; i++){
strip.setPixelColor(i, armed);
//strip.show();
}
strip.show();
armedSensor = 1;
delay(2000);
}

//If armed and senses motion, turn on LEDs
if(message == 1 && armedSensor == 1){
// grab the current state of the button.
if(digitalRead(MOTION_PIN) == HIGH){
current = 1;
Serial.println(“Motion detected!”);
for( int i = 0; i<NUM_LEDS; i++){
strip.setPixelColor(i, high);
//strip.show();
}
strip.show();
delay(5000);
Serial.println(“Disarming sensor”);
armedSensor = 0; //disarms
message = 0; //resets IO feed
for( int i = 0; i<NUM_LEDS; i++){ strip.setPixelColor(i, low); //strip.show(); } strip.show(); } delay(1000); armedSensor == 0; //Serial.println(“Unarmed”); } } // this function is called whenever a ‘Watchful’ message // is received from Adafruit IO. it was attached to // the Watchful feed in the setup() function above. void handleMessage(AdafruitIO_Data *data) { message = data->toInt();

//if (Watchful == 0){ //light up the LED
Serial.print(“received <- “);
Serial.println(message);
//}

}

Week 11 homework – The Evidence.

Hi Everyone,

Below is my second blog post for this week… just showing pieces of evidence that I completed Lessons 4, 5, and 6 for this week. Things seemed to go pretty smoothly although my precipitation feed doesn’t seem to be populating although I am receiving text messages everytime the weather changes. Something to look into I guess.

Thanks to Catherine and Felix for letting me hop on to their shared circuit. All three bread boards connected to the same button! woo!

 

Breadboard pressed

speaking to ioadafruitweather email

weather email

 

IMG_0686 from Stephanie Gamble on Vimeo.

IMG_0702 from Stephanie Gamble on Vimeo.

 

BOM for Final – Stephanie

Hi guys!

So I landed on the Owl idea that uses the motion sensor.

The narrative around this is derived from my personal life and the problem of my sisters and friends never remembering to text me that they made it home safe from a night out.  More times then not the conversations goes, “Text me when you get home so I know you made it safe!” and then they get home and forget and I stay up wondering if something has happened to them.

I’m evolving the Night owl plush nightlight into a “lookout device.” The owl will have a motion sensor device that will trigger a text message when someone walks in the door (alerting whomever that their friend made it home safe). I would love (if possible ) to include a “set on” or “look out” function where as my friends and I separate I or my friend can turn on the the sensor, and glowing LED light, so that it is only searching for a specific time frame that turns off when the person gets home.

Below is my Bill of materials:

Circuit:

**Does this need a breadboard or can I solder the circuit? having a hard time figuring out how to connect the powers and grounds with this feather Huzzah board but below is my initial thought.

IMG_0753

Owl figure:

TBD…. not sure if i want to evolve it to more of a “hard object” home good or keep it a soft good. Based slightly on whether or not I need a bread board to make this possible.

THanks!

Stephanie

 

Sample circuit wit Resistor.

Screen Shot 2018-11-17 at 6.06.43 PM

Project brainstorm and blinking light.

Hi Guys!

Apologies for the late blog entry.

Below are my three proposals for my ioT/smart object project.

IMG_0660IMG_0661IMG_0662

Below is evidence that my Arduino HUZZAH is speaking with the internet although when I tried to add my own website… I can’t tell if it actually worked…? I was concerned by the wording “connection failed. TBD I suppose.

IMG_0658 from Stephanie Gamble on Vimeo.

“>

IMG_0655 from Stephanie Gamble on Vimeo.

“>

 

Crypt Cat – Halloween Final

P2290597 2_edited_1920

Hi guys!

I think we can all call Halloween a success this year! Despite some mid-project set backs, I was able to pull together a satisfying compromise to my original Light up costume plan. Chc

Materials:

  • 6 RGB Neopixel LEDs
  • 1 Gemma Sewable Microcontroller
  • 1 AAA 3-battery pack
  • Styrofoam
  • Black mesh
  • Black Felt
  • Black “Satin” Fabric
  • Two Tone Sequin Fabric

Initial proposal:

My initial proposal for the light up, LED component of my halloween costume was to solder two identical circuits, that would display simultaneous code, and place them glowing from the shaped hears on the cat hood.

However, the soldering of the Neopixels was a very intricate task and harder then I had expected. With time limitation on my weekend I decided to adjust my end plans for a single 6 LED’s circuit and create a spooky glowing neck pendant for the Crypt Cat.

IMG_0599_1920

I cut a shape to curve around my neck out of black poly satin and then shaped a piece of styrofoam into a triangular, gem shape. I covered the styrofoam in two layer of black mesh to help in the diffusion process, for overall color and to help attached the foam to the main black piecing. I then sewed the circuit to the back of the styrofoam piece as a means of diffusing the light and creating an overall glow.

I stitch a pocket to the back solder piece that the battery pack and Gemma would sit in. As I was working on it the soldering snapped so I ended up also reinforcing the integrity of the circuit by sewing the wires to the main fabric.

IMG_0552_1920IMG_0562

I really wanted to play around with coding the sequence of LED’s for this project as I feel a bit unsure about code/writing code still and thought it would be good practice. I wanted to have the pendant glow, like a heartbeat, and transition colors as it pulsed in and out. For this, assigned specific RGB values to integers and then created a function using, set.brightness, that I could pull into the main loop and insert the RGB value into.

The other component I wanted to include is what I’m calling “Snake,” where the LED’s light up one at a time in succession. This was way more complicated for me and with some help, I learned in theory how it works although this one is still a bit of a comprehension challenge for me.

Either way, it’s be a fun a challenging project for me! Below you can find my code, and a video and more pics.

IMG_0601_1920IMG_0484_edited_1920


#include

#define PIN 1

#define NUM_LEDS 6

#define BRIGHTNESS 50

// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_RGB Pixels are wired for RGB bitstream
// NEO_GRB Pixels are wired for GRB bitstream, correct if colors are swapped upon testing
// NEO_RGBW Pixels are wired for RGBW bitstream
// NEO_KHZ400 400 KHz bitstream (e.g. FLORA pixels)
// NEO_KHZ800 800 KHz bitstream (e.g. High Density LED strip), correct for neopixel stick
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);

uint32_t Gold = strip.Color(255,206,0);
uint32_t Turq = strip.Color(41,196,204);
uint32_t Green = strip.Color(22,142,42);
uint32_t White = strip.Color(75,75,75);
uint32_t Blank = strip.Color(0,0,0);
uint8_t count;

void setup() {
strip.begin();
strip.show(); // initialize all pixels to “off”
}

//Main program box
void loop() {
Fade(Gold);
delay(200);
Fade(Turq);
delay(200);
Fade(Green);
delay(200);

for (count = 0; count < 5; count++) {
Snake(White);
}
delay(200);
}

// Brightness Function
void Fade(uint32_t color) {
uint16_t i, j;

//Increase brightness sub-loop
for (j = 0; j < 75; j++) {
for (i = 0; i < strip.numPixels(); i++) { strip.setPixelColor(i, color); strip.setBrightness(j); } strip.show(); delay(50); } // Decrease brightness sub-loop for (j = 75; j > 0; j–) {
for (i = 0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, color);
strip.setBrightness(j);
}
strip.show();
delay(50);
}

}

// Snake Function
void Snake(uint32_t color) {
uint16_t i;

for (i = 0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, Blank); //Clears pixel memory to start Snake
strip.show();
delay(25);
}
strip.setBrightness(50); //Resets brightness after Fade
//Snake loop
for (i = 0; i < strip.numPixels(); i++) {
if(i<1){
strip.setPixelColor(i, color);
strip.show();
delay(100);
}
strip.setPixelColor(i, Blank);
strip.setPixelColor(i+1, color);
strip.show();
delay(100);

}
}

In progress Halloween – PART 2

Hi Guys!

Here is a little insight into how my Halloween costume is going.

The soldering of the Neopixels was harder then I had expected and, with having to leave town this weekend for family needs, I needed to adjust my end plans and make my LED circuit into a glowing neck pendant. I also ran into some issues with uploading code from my computer to the Gemma board (apparently the new macs need a new cord to be compatible).

Despite all of this, things were going well and I was finishing up the construction and trying to learn/understand code when… my soldering snapped.  😦

#include

#define PIN 6

#define NUM_LEDS 6

#define BRIGHTNESS 50

// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_RGB Pixels are wired for RGB bitstream
// NEO_GRB Pixels are wired for GRB bitstream, correct if colors are swapped upon testing
// NEO_RGBW Pixels are wired for RGBW bitstream
// NEO_KHZ400 400 KHz bitstream (e.g. FLORA pixels)
// NEO_KHZ800 800 KHz bitstream (e.g. High Density LED strip), correct for neopixel stick
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRB + NEO_KHZ800);

uint32_t Gold = strip.Color(255,206,0);
uint32_t Turq = strip.Color(41,196,204);
uint32_t Green = strip.Color(22,142,42);
uint32_t White = strip.Color(75,75,75);
uint32_t Blank = strip.Color(0,0,0);
uint8_t count;

void setup() {
strip.begin();
strip.show(); // initialize all pixels to “off”
}

//Main program box
void loop() {
Fade(Gold);
delay(200);
Fade(Turq);
delay(200);
Fade(Green);
delay(200);

for (count = 0; count < 5; count++) {
Snake(White);
}
delay(200);
}

// Brightness Function
void Fade(uint32_t color) {
uint16_t i, j;

//Increase brightness sub-loop
for (j = 0; j < 75; j++) {
for (i = 0; i < strip.numPixels(); i++) { strip.setPixelColor(i, color); strip.setBrightness(j); } strip.show(); delay(50); } // Decrease brightness sub-loop for (j = 75; j > 0; j–) {
for (i = 0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, color);
strip.setBrightness(j);
}
strip.show();
delay(50);
}

}

// Snake Function
void Snake(uint32_t color) {
uint16_t i;

for (i = 0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, Blank); //Clears pixel memory to start Snake
strip.show();
delay(25);
}
strip.setBrightness(50); //Resets brightness after Fade
//Snake loop
for (i = 0; i < strip.numPixels(); i++) {
if(i<1){
strip.setPixelColor(i, color);
strip.show();
delay(100);
}
strip.setPixelColor(i, Blank);
strip.setPixelColor(i+1, color);
strip.show();
delay(100);

}
}
I’ve included my code below to share with you all and hope that tomorrow I can fix the soldering and show you in person!

IMG_0552IMG_0555IMG_0561IMG_0562

Halloween in Progress

Hi guys!

Here’s the progress on my Crypt Cat costume so far. I started with the physical construction of the hood as I will be out of town this weekend for family matters. I figured it would be good to start of the stuff I can’t really travel with. 🙂 I have my LEDs and My Gemma board and Battery pack so all that’s left is:

  • Solder LEDs and circuits.
  • Finish soft hood construction (i.e. ears)
  • Mount LEDs on structure inside the ears and marry the circuit with the hood construction.
  • CODE WORK! I am aiming to have the LED’s on a pattern loop so I need to figure out the timings and colors and all that jazz.

IMG_0484

 

Thanks!

Stephanie