Tuesday, May 3, 2016

Arduino Servo Light Switch

This is a light switch servo that turn off the light temperately. Eventually I'll put a motion sensor that will turn the lights on when I walk in a room.



Here is the code:



#include <Servo.h>

Servo myservo; 

int switchpin = 13;
int val = 0;  

void setup()
{
  myservo.attach(9); 
}

void loop()
{
  val = digitalRead(switchpin);     

if (val == HIGH){
 myservo.write(70);
 delay(2000);
}
else myservo.write(1);
}

This is the video:


Saturday, February 6, 2016

Auto Off Circuit

This is a simple auto off circuit. The switch energizes the capacitor witch turns on the transistor. The 100k resistor drains the capacitor intern shutting down the transistor. On this circuit the transistor controls the relay.





My Auto Off Youtube Video