Hello. I am a newbie so please bare with me. I have been wanting to make an arduino project that uses an arduino uno, motion detector, light sensor, and a stepper motor to automatically turn a switch when someone leaves the room after 3 minutes and the light is still on. I also want there to be a button to press that will automatically turn the switch on and off. Please help me. I have done lots of searching but nothing has popped up.
I also want the automatic switch to know the position of the switch so it won’t try to flip the switch when it’s already flipped
Can you describe the steps of what needs to happen in detail?
Something like
if motion detected
wait 3 minutes
if light is on
control switch
else
do nothing
The above however needs a lot more detail. Try to get it as complete as possible; it does not have to be in the above format. One question is how/when the stepper goes back to the initial position?
Regarding feedback about the stepper position:
Assuming the stepper controls a light switch to control the light that you mention, it should not be possible for the light to be on if the stepper has switched the light switch off. So (as an idea) your light sensor should reflect the position of the stepper.
To start you should forget about steppers motors and automation, instead just work out how you would wire the system using simple switches which might look something like this;
Then figure out how you would automate it. Rather than using a motor it would probably be more practical to replace one of the switches with relays.
in order to flip the switch, you would need a motor.
there are Arduino compatible switches that you can buy and they work internally like a relay. the switch is for humans, but the unit also takes signals from your Arduino.
motion sensors are well documneted for Arduinos. wall, ceiling or mini.
My suggestion is spend $1 and get a sensor and $1 and get a relay
connect these to your Aruduino and turn on some LED's
as you play with writing code, the bits will make more sense.
dave-in-nj:
....
there are Arduino compatible switches that you can buy and they work internally like a relay. the switch is for humans, but the unit also takes signals from your Arduino.
...
Do you have a link to those? I tried searching but I am obviously using the wrong keywords.