PhoneFinder

Made by Anna Lawn

Found in DIoT 2018 1- Home Hack

Identify location of a misplaced object within a home.

0

Problem Statement:

My mother, living alone in Orlando FL, is constantly losing her phone. She sets it face down in a random and inconsistent locations within or in close proximity to her home (front porch, bathroom, bedroom, kitchen, back yard, etc). I chose to tackle this problem because I know my mother will never see this issue as detrimental enough to justify fixing. However, I would like to save her time and trouble because she gave me life, and she deserves a little help once in a while.  

0

Goal:

Create a phone case that lights up and makes sound when called to identify the phone's location.

0

Process:

  • Elecrit Microphone Amplifier (Sound Sensor) Part and Wiring:

Not included in our toolkits, but manageable to find. Three pins must be soldered into OUT, GND, and VCC. 


Wiring done before the part had been soldered.


Diagram of wiring from initial part documentation.


Elecrit Microphone Amplifier (Sound Sensor) added to wiring. The sensor needed to be manually adjusted using a small screw on the bottom of the device to arrange for tolerances and sensitivity.



  • LED Part and Wiring:

Standard LED found in toolkits. 


Wiring for LED alongside sensor wiring.



  • Piezo Part and Wiring:

Part included in our kits. Outputs sound that can be modified with frequency adjustments. 


Fritzing diagram for Piezo wiring:



  • Final finished breadboard:


-1

Fritzing Final Circuit Diagram:


0

Parts Used:

  • Breadboard
  • Particle Photon
  • Elecrit Microphone Amplifier (Sound Sensor)
  • Standard LED 
  • Piezo (buzzer)
  • Connection Wires
  • BBR Resistor
0

Completed Code:

1
//COMPLETED CODE:

// the pin we're reading from
int mic_pin = A0;

// store the noise level / reading from the electret
int noise_level = 0;

const int sampleWindow = 50;

int ledPin = D0;
int lastLedValue = 0;
int speakerPin = D1;

// setup() runs once, when the device is first turned on.
void setup() {
  // Put initialization like pinMode and begin functions here.
  // We want to tell the Photon that we'll use
  // D0 as an output pin.
  Serial.println( 9600 );

  pinMode(ledPin, OUTPUT);
  pinMode(speakerPin, OUTPUT);
}

// loop() runs over and over again, as quickly as it can execute.
void loop() {

  noise_level = sampleNoise( );
  Serial.println( noise_level );

  if( noise_level > 850 ){
    int brightness = map( noise_level, 0, 1000, 0 , 255 );
    Serial.println( noise_level );
    Serial.println( brightness );
    Serial.println( "\n" );
    lastLedValue = brightness;

  }else{
    if(lastLedValue > 0){
      lastLedValue = lastLedValue - 100;
      tone(D1,1000,1000);
      delay(1000);
    }
    if(lastLedValue <= 0){
      lastLedValue = 0;
  }
}


  analogWrite(ledPin, lastLedValue);   // Turn ON the LED pins
  delay(250);               // Wait for 1000mS = 1 second
}



int sampleNoise( )
{
  unsigned long startMillis = millis(); // Start of sample window
  int highest_sample = 0;
  int lowest_sample = 1000;
  // collect data for 50 mS
  while (millis() - startMillis < sampleWindow)
  {
    int sample = analogRead( mic_pin );
  	// invert the range, and convert it to a percent
  	sample = map( sample, 0, 4095, 1000, 0 );
  	// now see if the sample is the lowest;

  	if ( sample > highest_sample ){
  	highest_sample = sample ;
  	}
  	if ( sample < lowest_sample ){
  	lowest_sample = sample;
  	}
  }

  Serial.print( "Highest = " );
  Serial.println( highest_sample );
  Serial.print( "Lowest = " );
  Serial.println( lowest_sample );

  int peakToPeak = highest_sample - lowest_sample;
  return peakToPeak;
}
Click to Expand
0

Final Video:

0
0

Reflection:

While there would still be some hardware integration for this concept to work properly (circuit and components must be integrated into a phone case for feasibility), this prototype is functional. The most difficult aspects were integrating the three components together and adjusting the tolerances for the sound sensor and the piezo. 

x
Share this Project

Courses

49713 Designing for the Internet of Things

· 25 members

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


Focused on
About

Identify location of a misplaced object within a home.

Created

January 25th, 2018