Motion sensing night light
thingiverse
Motion sensing night light to light of bathroom Arduino code: //basic night light // A0 pin for LDR // A1 pin for motion sensor // LED1 led output on pin 9 // LED2 led output on pin 10 int LED1 = 9; int LED2 = 10; void setup () { // set up I/O pinMode(A0,INPUT); pinMode(A1,INPUT); pinMode(LED1,OUTPUT); pinMode(LED2,OUTPUT); // for serial monitor - watch LRD and motion sensor values Serial.begin(9600); } void loop(){ // read sensors int lightValue = analogRead(A0); int motionValue = analogRead(A1); // set lights to off,for start up and after lights are turned on // with motion digitalWrite(LED1,LOW); digitalWrite(LED2,LOW); Serial.println("light"); Serial.print(lightValue); // if it is dark then look for motion if(lightValue>50) { // look for motion if(motionValue>100) { // if motion, then turn on lights digitalWrite(LED1,HIGH); digitalWrite(LED2,HIGH); delay(120000); } else { digitalWrite(LED1,LOW); digitalWrite(LED2,LOW); } Serial.println("motion"); Serial.print(motionValue); } else { delay(300);
With this file you will be able to print Motion sensing night light with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on Motion sensing night light.