#MuslimBan

Made by Melissa Powel, Brandon Zepeda and ssakhalk

Found in Ambient Affect

Our ambient device is a symbolic representation of panic in response to messages around banning people from the United States based on their religion and country of origin.

0

Intention

This is a 3 part ambient device that symbolically represents a caged bird trying to fly. The device responds to tweets with the hashtag #muslimban.

0

About the Product

Choosing our components

We started by selecting the components we would use. From a box of various motors and sensors we picked up a fan, 2 servo motors and a DC motor. We also grabbed a space blanket, which makes a pleasant crinkly noise.

Choosing our emotion

While exploring the movement of the various motors we recognized a certain anthropomorphism of the two servo motors moving in tandem as they closely resemble either arms or wings. This movement embodies a lot of emotion, either happy or panic. 

Choosing our trigger

We wanted to make our device socially relevant and the topic that elicits the most emotion from us is new legislation banning muslims from the U.S..

0

Materials

Panicked Audio

  • 6V DC Motor
  • 1N4001 diode
  • TIP120 Transistor
  • 330 Ω Resistor
  • Tupperware (may container of choice to suspend the motor)
  • Legos (my structure of choice to hold my contraption)
  • Cardboard box (Adds a bit of polished finish)

Flapping Wings

  •  Male-male jumper wires
  •  Male-female jumper wires
  •  2 Mini servos
  •  Batter holder- 4xAA
  •  Feathers
  •  Cage- Could be made with foam core

Simulated Wind

Controls

  • photon
  • 12V Power Supply
  • 12V Computer Fan
  • 1N4001 diode
  • 1K resistor
  • TIP120 Transistor
  • wires

Housing and Effects

  • Space blankets
  • Foamcore
  • Hot glue
  • Masking Tape

0

Code & Breadboard

Panicked Audio 

The key to the code, was making sure it was in sync with the other photons. We did that by subscribing all motors to the same ifttt.com event and adjusting the delays or "wing flaps" on all of the codes such that they would finish at the same time.

Two things to note about the breadboard:

  1. Be careful about how you wire the transistor.
  2. The white stripe on the diode must be facing toward the power source.

See the Arduino source code & breadboard instructions for more details.

0
int motorPin = D1;


void setup()
{
  pinMode(motorPin, OUTPUT);
  Particle.subscribe("muslimban", myHandler);
}

int i = 0;

void myHandler(const char *event, const char *data)
{
  analogWrite(motorPin, 50);
  delay(1000);
  analogWrite(motorPin, 100);
  delay(1000);
  analogWrite(motorPin, 150);
  delay(1000);
  analogWrite(motorPin, 200);
  delay(2000);
  analogWrite(motorPin, 255);
  delay(3000);
  analogWrite(motorPin, 0);
}
Click to Expand
0

Code & Breadboard

Flapping Wings

There was some tuning involved changing the wing height and speed.  The variable for such changes were parameterized for such adjustments.

0
int servoPin1 = A4;
int servoPin2 = A5;
Servo myServo1;
Servo myServo2;
int servoPos1 = 0;
int servoPos2 = 180;
int angle = 0;   
int wing_speed_up = 7;
int wing_speed_down = 3;
int wing_up = 120;
int wing_down = 70;
int fly_permission = 0;

void setup() {

 
  myServo1.attach( A4 );
  myServo2.attach( A5 );
 
  Particle.function("myServo1", servoControl1);
  Particle.function("myServo2", servoControl2);
  Particle.subscribe("melikey", event_driven);

  Particle.variable(  "servoPos1" , &servoPos1 , INT );
  Particle.variable(  "servoPos2" , &servoPos2 , INT );
 
}

void loop() {

  if(fly_permission == 1)
  {
    delay(3000);
    for (int i=1; i < 12; i++)
    {
  
  for(angle = wing_down; angle < wing_up; angle++)
  {
    myServo1.write(angle);
    myServo2.write(180 - angle);
    delay(wing_speed_up);
  }
  
  for(angle = wing_up; angle > wing_down; angle--)
  {
    myServo1.write(angle);
    myServo2.write(180 - angle);
    delay(wing_speed_down);
  }
  
}

int servoControl1(String command)
{
 
   int newPos1 = command.toInt();
   
   servoPos1 = constrain( newPos1, 0 , 180);

   
   myServo1.write( servoPos1 );

  
   return 0;
}

int servoControl2(String command)
{
   
   int newPos2 = command.toInt();

   servoPos2 = constrain( newPos2, 0 , 180);

   myServo2.write( servoPos2 );

   return 0;
}

void event_driven(const char *event, const char *data)
{
  fly_permission = 1;
}
Click to Expand
0

Code & Breadboard

Simulated Wind

There is a balance between the speed of the wind and the whistling of the fan.  The speed of the fan needs to be tuned to be able to sense the other feature of the ambient device.   The variable for such changes were parameterized for such adjustments.

0
/*The code is meant to turn on the fan in the #MuslimBan ambient device.  The
 ambient device turns on a fan that turns taunt a caged bird.  The bird flaps
 its wings and there is a sound caused by a dc motor that promotes anxiousness.
 The different devices are triggered by an event.
 */

int controlpin = D2;    //Controls the fan
int monitorlight = D7;  //Light for testing
const int pwr_off = 0;  //Sets analog signal to 0
int on_time = 3000;     //This was originally use to learn how to control and wire the fan
int off_time = 1000;    //This was originally use to learn how to control and wire the fan
int fan_on = 0;         //This variable triggers the code action to take place when the event occurs
int pwr_cmd = 100;      //how fast the fan spins
int fan_time = 9000;    //how long the fan spins in ms

void setup()
{
  pinMode(controlpin, OUTPUT);    //Sets up the the fan control pin
  pinMode(monitorlight, OUTPUT);  //The light on the photon is set up for testing
  Particle.subscribe("melikey",event_driven);   //This is the name of the event that triggers all the devices


}

void loop()
{

  if (fan_on == 1)    //fan_on variable is changed when the event is triggered
  {

//This segment of code is used to make test and make the original circuit, it was replaced by the fan_control fuction
  /*digitalWrite(monitorlight, HIGH);
  digitalWrite(controlpin, HIGH);
  delay(on_time);
  digitalWrite(monitorlight, LOW);
  digitalWrite(controlpin, LOW);
  delay(off_time);*/

  fan_control(pwr_cmd,fan_time);  //fan function take power level and time on
  fan_on = 0;       //change the intializing variable so that the fan only turns on once.
  }
  else{}

}

void fan_control(int pwr_lvl, int duration)
{

  int pwr_cmd = map(pwr_lvl, 0, 100, 0, 255); //maps the 0-100% to the analog values required
  analogWrite(controlpin, pwr_cmd);           // Writes the power of the fan
  delay(duration);                            // How long will the fan will be turned on
  analogWrite(controlpin, pwr_off);           // Turns off the fan


}
void event_driven(const char *event, const char *data)
{

  fan_on = 1;

}
Click to Expand
0
x
Share this Project

Courses

49-713 Designing for the Internet of Things

· 26 members

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


About

Our ambient device is a symbolic representation of panic in response to messages around banning people from the United States based on their religion and country of origin.

Created

February 7th, 2017