Introduction: 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 板

Step 1: 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

Step 2: 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 );

Step 3: Video N' Photos

Step 4: Credits

-Mr. David Huang's wonderful Arduino program / Arduino Class

-Instructables