Arduino Phone Detector
Usually, parents are not allowing their children to be on their phones all the time, even some of the parents would take away their phones. However, some clever kids would steal the phone back without anyone noticing. Therefore, the Arduino Phone Detector is for the parents, whenever the phone is gone, the box will lit up, so the children will not be able to get away easily, since the parents may see the blue lights.
Supplies
x1 光敏電阻
x2 Led 燈
x12 電線
x1 Arduino 板
Assemble the Parts
Places the led lights and the wires to the correct coordinate
Then Check if any wires are attached to the wrong point
Arduino Program
void setup(){
Serial.begin(9600);
pinMode( 12 , OUTPUT);
pinMode( 11 , OUTPUT);
}
void loop(){
Serial.print(analogRead( A0 ));
Serial.print(" ");
Serial.println();
delay( 20 );
if ( analogRead( A0 ) > 500 ) { //改
digitalWrite( 12 , HIGH );
}
else {
digitalWrite( 12 , LOW );
}
Serial.print(analogRead( A0 ));
Serial.print(" ");
Serial.println();
if ( analogRead( A0 ) > 500 ) // 改
{
digitalWrite( 11 , HIGH );
Video N' Photos
Credits
-Mr. David Huang's wonderful Arduino program / Arduino Class
-Instructables