I need help creating source code for my senior project. I’m creating a door that will open and close due to light (which I will implement later). I need help creating code that will extend and retract my actuator. Any thoughts? I have input1 into gpio20 and input2 into gpio21
deleted by Community♦ 2 days ago (RemoveAbandonedClosed)
This question was automatically deleted. Please see the help center for more information.
closed as unclear what you’re asking by joan, Milliways, Steve Robillard, Ghanima♦ Mar 26 at 21:46
Please clarify your specific problem or add additional details to highlight exactly what you need. As it’s currently written, it’s hard to tell exactly what you’re asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.
You question is a little bit vague. Let me ask you a couple of leading questions to make you more specific.
(1) Tell us more about the “door” you are going to “create”. Is it a very small door for your smart cat and she is strong enough to push the “door” open?
(3) Now suppose your door has a light sensor and switches on a green LED when there is light.
(4) The smart cat sees the green light and knows the door is not locked, and therefore pushes the door open, otherwise she won’t bother.
(5) If my guesses are correct, then what you need is not an actuator, relay, nor a solenoid, but a “door-solenoid”, like this.
(6) Are you using Rpi Python? If yes, I can suggest you where to starting look for useful code.
Or you may like to reply to my questions to go another direction.
In case you wish to read more before coming back, I would suggest the following links. GPIOZero is very good for python newbies.
By the way, a solenoid lock is very much like a solenoid which in turn operates like a relay, so you need to start getting to know the relay. And of course you can also google or youtube, but my references are good for newbies and also DIY hobbyists to get started.
And in case you don’t like reading articles and prefer videos, I would recommend this one:
And if you wish to try a general purpose solenoid instead of an expensive specific door lock, I would recommend the cheap ZYE1-0837AP. I have already done some research, so you carry on where I left.
You mentioned actuator and relay. I guess you mean solenoid and relay. Actually you need a relay to control a solenoid, because Rpi GPIO is not strong enough to drive a solenoid. So what you do is to let Rpi drive a relay module (yes, a “module” which Rpi can drive, not a bare bone relay which Rpi cannot!), which in turn drives a solenoid. Here is the picture of what you can do.
I will pause here. Please feel free to ask more questions or make counter suggestions and I am happy to join in.
Have a nice project, Sam.