hello i am new here,
i have a project that i am working on and i was wondering on how i can connect a dc motor to a light sensor,
what i am looking for is when the sunrises the dc motor activates and starts to turn anti-clock wise, and when the sunrises and it becomes dark the dc motor starts to turn opposite way.
what types off sensor do i need and what boards should i use.
thank you for your time for reading this
Any Arduino board will do. Since you do not need a lot of speed a Light Dependent Resistor (LDR) would work for the sensor.
For the (brushed) DC motor you will need an H-bridge motor driver and an external power supply for the motor. The Arduino cannot supply enough current for a motor and you want to reverse the motor. Pick a H-bridge motor driver according to the stall current spec of the motor. The stall current should be listed on the motor data sheet. Pololu has a great line of brushed motor drivers.
For any other type of motor you will need a driver compatible with the motor.
Google "arduino dc motor" for more information (about 30 million hits).
Read the how to use this forum-please read sticky to see some advice on how to ask an effective question.
You will need a bit more to the code than just light/dark.
You need sufficient hysteresis to stop opening/closing multiple times around the trigger point.
It can get really dark during the day at times (e.g. before a massive rainstorm); I've seen it getting dark enough for the street lights to turn on in the middle of the day. Do you want your hatch to close in that situation?
You may need sensors to make sure nothing gets killed by your system as it opens or closes (based on the many many other threads asking basically the same I am kinda assuming you're looking to automate a chicken coop).
Welcome to the forum.
Please read the first post in any forum entitled how to use this forum.
When the sun has risen do you want the motor to keep turning anti-clockwise and when the sun has set the motor to keep turning clockwise?
Can you tell us the application please?