Brello Umbrella Lights

Made by Qin Bian, kanikak, Dani Quan, Benjamin Hecht, nsridhar and Matthew M

The user can press a button to light up other brello umbrellas in the vicinity to cheer up their friends or even strangers in a gloomy day.

Created: May 1st, 2018

0

Problem Statement

In rainy days, people often feel depressed. Isolated by their own umbrellas, they also feel lacking connections with others. How might we cheer up people in a fun way and help them connect in the gloomy days? 

Brello umbrella allows its user to press a button and light up another person's umbrella in the vicinity. The other person can then "wink" back by pressing the button on his/her own umbrella. The playful, non-intrusive light effects will surprises and delight people. It will also help people connect with their friends or even strangers without stepping out of their ways in rainy days.

0

Goal

User distant social interaction to alleviate the mood of another individual during the gloomy rainy days. 

0

Process

1. Get each particle to subscribe to an event created by the other particle

0

2. Press a button and send an event to the other particle

0


3. Coding a neo-pixel ring to work with a particle photon

0


4. Solder the independent led

0


5. Test led sting on the umbrella in different variations

0


6. Add button to umbrella


0

Overview 


To alleviate the depression or rather bring a smile on someones face, a user has the ability to light up someone else's umbrella. Brello umbrella allows its user to press a button and light up another person's umbrella in the vicinity. The other person can then "wink" back by pressing the button on his/her own umbrella. The playful, non-intrusive light effects will surprises and delight people and give them a sense of connection. Beacon technology is used to light up all the umbrellas in the vicinity.

0
// This #include statement was automatically added by the Particle IDE.
#include <neopixel.h>

// This #include statement was automatically added by the Particle IDE.
#include <neopixel.h>

// IMPORTANT: Set pixel COUNT, PIN and TYPE
#define PIXEL_COUNT 18
#define PIXEL_PIN D6
#define PIXEL_TYPE WS2812

int red = 128;
int blue = 128;
int green = 0;

#define DELAY_TIME (2000)
unsigned long startTime;

#define PEACH 200,50,5
#define CYAN 10,150,70
#define PURPLE 180,3,180
#define BLUE 5,5,190
#define WHITE 150,150,150
#define GREEN 10,180,10

Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);

int waitTime = 25;
int i;
void spin(int R, int G, int B);


// This value will store the last time we published an event
long lastPublishedAt = 0;
// this is the time delay before we should publish a new event
// from this device
int publishAfter = 1000;
int led = D0;
int buttonPin = D1;
int previousState = 0;
int buttonState = 0;


void setup() {
    
    pinMode(buttonPin, INPUT_PULLUP);
    pinMode(led, OUTPUT);
    Particle.subscribe("diot/2018/paired/" , handleSharedEvent);

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

void loop() {
    
    buttonState = digitalRead (buttonPin);
    if (buttonState == 0){
      publishMyEvent();
      delay(2500);
    }
    previousState = buttonState;
  // spin forever rotating through colors!

}

void spin(int R, int G, int B) {
    for(i=0; i < PIXEL_COUNT; i++) {
        strip.setPixelColor(i, R,G,B);
        strip.show();
        delay(waitTime);
    }
}

void publishMyEvent()
{
  // Remember that a device can publish at rate of about 1 event/sec,
  // with bursts of up to 4 allowed in 1 second.
  // Back to back burst of 4 messages will take 4 seconds to recover.
  // So we want to limit the amount of publish events that happen.
  // check that it's been 10 secondds since our last publish
  if( lastPublishedAt + publishAfter < millis() )
  {
      // Remember our subscribe is matching  "db2018/paired/"
      // We'll append the device id to get more specific
      // about where the event came from
      // System.deviceID() provides an easy way to extract the device
      // ID of your device. It returns a String object of the device ID,
      // which is used to identify your device.
      Serial.println("publish");

      String eventName = "diot/2018/paired/" + System.deviceID();
      // now we have something like "db2018/paired/0123456789abcdef"
      // and that corresponds to this devices info
      // then we share it out
      Particle.publish( eventName, "hello world from Qin");
      // And this will get shared out to all devices using this code
      // we just pubished so capture this.
      lastPublishedAt = millis();
  }
}


// Our event handlde requires two bits of information
// This gives us:
// A character array that consists of the event name
// A character array that contains the data published in the event we're responding to.
void handleSharedEvent(const char *event, const char *data)
{
    // Now we're getting ALL events published using "db2018/paired/"
    // This includes events from this device.
    // So we need to ignore any events that we sent.
    // Let's check the event name
    String eventName = String( event ); // convert to a string object
    // This gives us access to a bunch of built in methods
    // Like indexOf()
    // Locates a character or String within another String.
    // By default, searches from the beginning of the String,
    // but can also start from a given index,
    // allowing for the locating of all instances of the character or String.
    // It Returns: The index of val within the String, or -1 if not found.
    // We can use this to check if our event name contains the
    // id of this device
    String deviceID = System.deviceID();
    //if deviceID is inside eventName
    if( eventName.indexOf( deviceID ) != -1 ){
      // if we get anything other than -1
      // the event came from this device.
      // so stop doing stuff
      return;   //return call kicks us out of this function
    }
    
    Particle.publish(event, data);
    // otherwise do your stuff to respond to
    // the paired device here
    //if we don't get kicked out of the function, go ahead and blink 5 times;
    // for (int j = 0; j < 5; j ++){
    //     for (int i = 0; i < PIXEL_COUNT; i++) {
    //         strip.setPixelColor(i, red, i*4, blue );
    //     }
            
    //     strip.setBrightness(60 - j*10);
    //     delay(200);
    // }
      
    //*****
     
      for(int i = 0; i < 2; i++){
      strip.setBrightness(10);
       spin (PEACH);
  
       spin (BLUE);
     
       spin (CYAN);
      
       spin (PURPLE);
      
       spin (GREEN);
      
      }
    //****
    // for (int color=0; color<255; color++) {
    //   for (int i=0; i<strip.numPixels(); i++) {
    //     strip.setPixelColor(i, Wheel(color));
    //   }
    //     strip.show();
    //     delay(10);
    // }
    
    for (i=0; i < PIXEL_COUNT; i++) {
        strip.setPixelColor(i, 0, 0, 0);
        strip.show();
    }
      
    
    strip.setBrightness(0);
    
    Serial.println(event);
    Serial.println(data);   
    
}
Click to Expand
0

Materials:

2 umbrellas purchased through Amazon

1 Mini Breadboard 

12 NeoPixel LEDs

1 USB Micro B Cable

1 Particle Photon

Jumper wires

1 Mini Pushbutton

0

Reflection

Overall the umbrellas were a lot of fun. However the leds were extremely temperamental. With the exact same code we got them to work sometimes and not others. So really a lot of our time was troubleshooting which leds were working and which weren't. We soldered each individual led and then used cables to connect them and tape to hide them in the umbrella. 

One thing we would work on moving forward is being able to create a pulsing colour like that one of the breathing cyan of the photon.  


x
Share this Project

Courses

49313 Designing for the Internet of Things (Undergrad)

· 22 members

A hands-on introductory course exploring the Internet of Things and connected product experiences.


About

The user can press a button to light up other brello umbrellas in the vicinity to cheer up their friends or even strangers in a gloomy day.