New Servo and Sensor project - need help!!

Hey Guys,
I was thinking of undertaking a new project on arduino. This is what I want it to do. I want it to use the servo motor and press the home lighting switch, each time somebody walks through the door. So for example, if i walk through the door once, it presses the top of the light switch, and when i walk in front of it the second time, it presses the bottom of the light switch. The switchI am talking about is the light switch on walls to turn on/off the lights in the room. I have a servo motor, arduino board, all the cables, push switches, light sensor, and a HC-SR04 sensor. I have a whole heap of other stuff aswell (I bought a kit online) but just needed some guidance on how I can build this project. Sorry if i'm not being clear, I'm very new to arduino.

Okay connect the servo and the HC-SR04 to the arduino and run through some example code.. Once you have done that and have an understanding of how you can get them to work together, start thinking about how you want your final project to behave. Then try to write a sketch to do that..
E.g.

do you want a button that will ignore any reading from the HC-SR04,
do you want to only turn the light on if it is dark...

Then get back to us.. :slight_smile:

You can setup the sensor and servo in this way. But your design has the problem that if a second person comes into the room the light will go off!.

You'll also need to mount the servo over the switch on the wall and provide it and the arduino with power from a wall wart

Mark

I suspect you will have a very ugly arrangement when a servo is attached to a regular light switch and the servo will get in the way of manual use of the switch. Have you considered switching the power with a relay which would be much simpler in almost every respect.

...R