How to control DIY linear actuator with end switches and sensor input? Answered
I want to build a DIY 12v DC linear actuator, using Arduino uno. The actuator is DIY so it does not have any position tracking.
I want to use 2 relays to control the direction of the actuator, two end switches, and one sensor input (preferably a photo resistor)
The sensor, and end switches are connected to Arduino UNO R3 as inputs and relays as outputs.
When the sensor is energized motor moves forward until it hits End Switch No 1 and stops;
When the sensor its not energized motor moves backwards until it hits End Switch No 2 and stops:
And be able to repeat this program whenever the sensor is energized.
I would be greatly appreciate if someone can help me with this sketch, because i don't have any experience with Arduino code.
Thank you and have a grat day.