I really hate flying insect!

Made by Yolanda Chen

Send you email to notify if there is flying insect in your apartment. In the same time, you can know how fast it move

Created: January 29th, 2016

0

Intention

This project is designed for me and my roommate. I try to design a detector that can let me know if there is flying insects in my apartment. I am really afraid of flying insects. Knowing the number of it help me to prepare myself. Then I can do something to kill off them. In the same time, like a photogates. Because it also document the time the insect used to passing through, through calculation I can also know the speed of the insect. If it moves super fast, it means it is very aggressive, which I should pay more attention to.
0

Goal

Let me know every time a flying insect pass the LED and send an email to notify that. And by documenting the time it use to pass the LED to calculate how fast it can move.
0

Process

In this project,  a photoresistor and a LED will be use.

This app will publish an event when the beam of light between the LED and the photoresistor is broken.( In real life, it means a insect pass though)It will also publish an event when the beam of light between the LED and the photoresistor is broken.( then we know how many time the insect used to pass the LED. Because we already know the size of LED, we can get the speed of insect by divide the length of LED by the time between 'broken' and 'intact'.)

The final step is use IFTTT to link Particle with my gmail, then I can receive an email when the action 'broke' happens.



0

Outcome

1. Every time a flying insect pass the light, you will receive an Email.

2. By calculating the time between 'broke' and 'intact', you can also know how fast the insect move

0

Reflection

In this project, I combine what I learned in IOT workshop and the knowledge about photoresistor in http://www.instructables.com/   (some code form the tutorial internet Controlled Motion Detector- Particle Core by lightbus)

It a really amazing exploration. As a student who have no knowledge of neither coding and circuit before, it is definitely a challenge. Through struggle for a lot of time, finally I made it.

I feel very excited about my first IOT project. It can really solve problem. For I am very afraid of flying insect and every time I see it I will scream very loud. With the help of this app, I can get notification if it detect any insect flying through the LED. Then I can get prepared, and take some action to kill off them.

0
int led = D0;
int boardLed = D7;
int photoresistor = A0;
int power = A5;
int intactValue;
int brokenValue;
int beamThreshold;
bool beamBroken = false;

void setup() {

  pinMode(led,OUTPUT);
  pinMode(boardLed,OUTPUT);
  pinMode(photoresistor,INPUT);
  pinMode(power,OUTPUT); //

  digitalWrite(power,HIGH);

  digitalWrite(boardLed,HIGH);
  delay(2000);

  digitalWrite(boardLed,LOW);
  digitalWrite(led,HIGH);
  delay(500);

  int on_1 = analogRead(photoresistor);
  delay(200);
  int on_2 = analogRead(photoresistor);
  delay(300);

  digitalWrite(boardLed,HIGH);
  delay(100);
  digitalWrite(boardLed,LOW);
  delay(100);
  digitalWrite(boardLed,HIGH);
  delay(100);
  digitalWrite(boardLed,LOW);
  delay(100);

  digitalWrite(boardLed,HIGH);
  delay(2000);

  digitalWrite(boardLed,LOW);

  int off_1 = analogRead(photoresistor);
  delay(200);
  int off_2 = analogRead(photoresistor);
  delay(1000);
  digitalWrite(boardLed,HIGH);
  delay(100);
  digitalWrite(boardLed,LOW);
  delay(100);
  digitalWrite(boardLed,HIGH);
  delay(100);
  digitalWrite(boardLed,LOW);
  delay(100);
  digitalWrite(boardLed,HIGH);
  delay(100);
  digitalWrite(boardLed,LOW);

  intactValue = (on_1+on_2)/2;
  brokenValue = (off_1+off_2)/2;

  beamThreshold = (intactValue+brokenValue)/2;
}
void loop() {

  if (analogRead(photoresistor)>beamThreshold) {

    if (beamBroken==true) {

        Spark.publish("beamStatus","intact",60,PRIVATE);

        digitalWrite(boardLed,HIGH);
        delay(500);
        digitalWrite(boardLed,LOW);

        beamBroken=false;
    }
    else {

    }
  }
  else {

      if (beamBroken==false) {

        Spark.publish("beamStatus","broken",60,PRIVATE);

        digitalWrite(boardLed,HIGH);
        delay(500);
        digitalWrite(boardLed,LOW);

        beamBroken=true;
      }
      else {
          
      }
  }
}
Click to Expand
0
iot
Yolanda Chen - https://youtu.be/kLssB4ehG5A
x
Share this Project

Courses

49-713 Designing for the Internet of Things

· 4 members

This course charts the emergence of the now "connected world" to explore the possibilities for future products and connected spaces.


About

Send you email to notify if there is flying insect in your apartment. In the same time, you can know how fast it move