49-713 Designing for the Internet of Things
· 26 members
A hands-on introductory course exploring the Internet of Things and connected product experiences.
An ambient device to inform you that your girlfriend's period is coming.
Premenstrual syndrome (PMS) describes a group of symptoms, such as mood swings, cramps, and headache, etc., a woman have before her menstrual cycle. During these days, women are oversensitivity and exaggerated mood swings, and they need more love and understanding from their girlfriends. Therefore, our team designed an ambient device using light and vibration to inform males that their girlfriends' period is coming. The emotion behind the context is not just about girl's anxious but also about boy's caring. This device is used to inform males that during the special period they also need to understand or pay more attention to female.
PMS notification is taking into calendar to calculate when the girlfriend's period is coming and send a signal to her boyfriend. The signal consist of two part, firstly, the NeoPixel, which acts as a progress bar, can gradually fill the ring based on the calendar. When all the lights are on, NeoPixel changes to red with the toy shaking because of servo. With the progress bar, user can anticipate the time and have a preparation for it. The red light and the shaking toy act as signals.
Material
Particle Photon 1
Breadboard 1
Neo-Pixel 1
Servo 1
Wires 5
Toy 1
Design process
The team decided to use NeoPixel and servo to show the signal.
First is to set up the NeoPixel:
1. Solder the circuit on the NeoPixel and install it as the following picture on the bread board.
2. Coding and setting up the NeoPixel to work as what we want.
void loop(){
uint16_t i;
for(i=0; i<strip.numPixels(); i++) {
uint32_t white = strip.Color(255, 255, 255);
strip.setPixelColor(i, white);
strip.show();
delay(500);
if (i == strip.numPixels() -1 ){
all_red();
}
}
}
void all_red(){
uint32_t red = strip.Color(255, 0, 0);
for(j=0; j<strip.numPixels(); j++){
strip.setPixelColor(j, red);
}
strip.show();
Click to Expand
void shake(){
for(k = 0; k < 10; k++){
for(Pos = 0; Pos < 45; Pos += 5) // servo goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myServo.write(Pos); // tell servo to go to position in
// variable 'pos'
delay(15); // waits 15ms for the servo to reach
// the position
}
for(Pos = 45; Pos>=1; Pos-=5) // goes from 180 degrees to 0 degrees
{
myServo.write(Pos); // tell servo to go to position in
// variable 'pos'
delay(15); // waits 15ms for the servo to reach
// the position
}
}
}
Click to Expand
#include "neopixel.h"
#include <math.h>
// IMPORTANT: Set pixel COUNT, PIN and TYPE
#define PIXEL_PIN D0
#define PIXEL_COUNT 16
#define PIXEL_TYPE WS2812
int pixel_position = 0;
int i = 0;
int j = 0;
int k = 0;
int servoPin = A5;
Servo myServo; //create servo object
int Pos = 0;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);
void setup(){
Serial.begin( 9600 );
myServo.attach(A5);
strip.begin();
strip.setBrightness(5);
strip.show(); // Initialize all pixels to 'off'
}
void loop(){
uint16_t i;
for(i=0; i<strip.numPixels(); i++) {
uint32_t white = strip.Color(255, 255, 255);
strip.setPixelColor(i, white);
strip.show();
delay(500);
if (i == strip.numPixels() -1 ){
all_red();
}
}
}
void all_red(){
uint32_t red = strip.Color(255, 0, 0);
for(j=0; j<strip.numPixels(); j++){
strip.setPixelColor(j, red);
}
strip.show();
shake();
strip.clear();
}
void shake(){
for(k = 0; k < 10; k++){
for(Pos = 0; Pos < 45; Pos += 5) // servo goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myServo.write(Pos); // tell servo to go to position in
// variable 'pos'
delay(15); // waits 15ms for the servo to reach
// the position
}
for(Pos = 45; Pos>=1; Pos-=5) // goes from 180 degrees to 0 degrees
{
myServo.write(Pos); // tell servo to go to position in
// variable 'pos'
delay(15); // waits 15ms for the servo to reach
// the position
}
}
}
Click to Expand
A hands-on introductory course exploring the Internet of Things and connected product experiences.
An ambient device to inform you that your girlfriend's period is coming.
February 5th, 2017