0

linear actuator setting digial pins
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

linear actuator setting digial pins

by swarmingbee on Fri Jul 26, 2019 7:34 am

Fairly new to micro controller programming and currently organizing a project to use linear actuator to open/close a door. I understand concept of using two relays for the forward/reverse direction and setting corresponding pins to HIGH to engage the actuator motor. Most the actuators have built in limit switches to know when to stop but trying to understand what is best practice after the actuator hits the internal limit switch but the pin on controller is still set to HIGH? Is there any harm with the digital pin staying in the HIGH state? Trying to avoid buying a actuator with built in encoder for position feedback due to cost.

void extendActuator() {
digitalWrite(relay1, HIGH);
digitalWrite(relay2, LOW);
}

void retractActuator() {
digitalWrite(relay1, LOW);
digitalWrite(relay2, HIGH);
}

One thought I had was to get reed switches and monitor when the door is fully open/closed and then set pins to LOW when door is fully open or closed.

swarmingbee
 
Posts: 2
Joined: Wed Jul 24, 2019 4:19 pm

Re: linear actuator setting digial pins

by adafruit_support_bill on Fri Jul 26, 2019 8:04 am

There are a couple of ways to approach it.

The software approach is to wire the limit switches between the input pin and GND and have pullup resistors to VCC Then your code would monitor the limit switch input and de-energize the relay when it is hit.

The hardware approach is to wire the limit switches in-line with the relay coils using the NC (Normally Closed) contacts. So when one limit is reached, the relay automatically opens, stopping the motor.

adafruit_support_bill
 
Posts: 74643
Joined: Sat Feb 07, 2009 10:11 am

Re: linear actuator setting digial pins

by swarmingbee on Fri Jul 26, 2019 10:34 am

I thought the actuator itself had an internal limit switch built in to turn off the motor. Are you referring to separate limit switches?

swarmingbee
 
Posts: 2
Joined: Wed Jul 24, 2019 4:19 pm

Re: linear actuator setting digial pins

by adafruit_support_bill on Fri Jul 26, 2019 11:07 am

There are thousands of different types of linear actuators. Most do not have built-in limit switches. If you have a spec sheet for the ones you are using we may be able to give you more specific advice.

adafruit_support_bill
 
Posts: 74643
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.