Trying to hookup a linear actuator to photocell using a DPDT relay #2

Thread Starter

Mouthpear

Joined Dec 24, 2018
25
Hi there, I'm trying to follow this tutorial to create a circuit that will control a linear actuator by using a photocell via a DPDT relay which switches the polarity of the power to the linear actuator.

I'm struggling because I'm a complete beginner when it comes to electronics (and I mean COMPLETE beginner) but wanted to create this as automatic chicken coop door switches are quite expensive! I've wired it up the best I can with guidance but it's still not working unfortunately.

Things to note:
  • The DPDT relay I have is different from the one used in the tutorial, the one I have looks like this, so I've had to wire it up a bit differently.
  • The photocell I have is different from the one used in the tutorial, it has screw terminals which are 'LI', 'LO', and 'N'.
  • I'm using T tap connectors to split up my cables.
Here's a diagram of how I've got it connected at the moment:


Apologies for my terrible diagram but I hope it's easy to understand.

Thank you for any help at all!

Did you ever get this working?
 

Thread Starter

Mouthpear

Joined Dec 24, 2018
25
I just left this in Stack exchange but I felt I should put it here also. Either way I hope that if you find this to be a better answer here and there that you will mark it as so. TY


I hope that you didn't mess up your relay trying it all these different ways. The answer is so much simpler than you think. But first, You should wire the Actuator to the commons. Makes it easy to replace, do maintenance or reverse the wires. Dump the three wire sensor and just use a single photo cell. The first two Images are the schematic current flow to illustrate how it works and that it does work. Top one is day time and the middle is night time. The third is the practical wiring diagram. The protection of the Photocell is simple also. Use a small glass or plastic jar and run the wires through the cap. Get a few of those moisture packets that come in over the counter medication bottles and throw then in there. Cap and mount the jar. Simple. Hope this helps.

Sunrise.jpgSunset.jpgPicture1.png
 

MisterBill2

Joined Jan 23, 2018
8,808
If the linear actuator does not have some other means to stop it by switching off at the ends of motion it will be stalled and fail. So that is the very first consideration.
 
there are plenty of chicken coop door circuits here and elsewhere. They mimic the design of an automotive door actuator with limit switches. Motor-limits.pdf in this https://forum.allaboutcircuits.com/...house-roof-window-control.134958/post-1130917 thread is pretty comprehensive.

Usually two SPDT automotive relays are used with 30A+ contact ratings. See ww.partsexpress.com for relays and pre-wired plugs. The DC actuator overruns. Using two DPDT switches where the commons are attached to the motor and the NC contacts go to ground, ground the motor when it's being stopped. It acts as a generator into a short and stops fast
one relay is UP, one is DOWN. If both UP and DOWN are activated at the same time, the result is still "brake".

The limit switches go in the coil circuit, so they need to be rated for the coil current. Not necessarily a small feat.

The photocell idea is fairly stupid, clouds will mess that up. An Astronimical timer is what you want. https://www.aliexpress.com/i/32924167750.html?spm=2114.12057483.0.0.5bcd26c0mPQwn9 It computes sunrise and sunset. At home, I have one that turns on a light at about 1hr after sunset and off at 11:30p.

if yoour operating off of a battery, that creates some other problems if youneed to conserve power. The Siemens LOGO is a mini-PLC that has an astronomic timer incorporated. You also get a webserver.
 

Thread Starter

Mouthpear

Joined Dec 24, 2018
25
If the linear actuator does not have some other means to stop it by switching off at the ends of motion it will be stalled and fail. So that is the very first consideration.
That's not even close to being the first consideration. Reversing polarity is the most common thing. LOL Why are you even bringing that up? Is this one of those sites that just counts comments despite content?
 

Thread Starter

Mouthpear

Joined Dec 24, 2018
25
The photocell idea is fairly stupid, clouds will mess that up. An Astronimical timer is what you want.
This wasn't my post or thread to start with. Heck I am a bit peeved that it got moved off a thread where the info I posted would have done good but now no one there will ever get to see it.

"The photocell idea is fairly stupid, clouds will mess that up." Stupid? Really? It only seems that way when people don't know or can't figure out how to set them up. Cloudy days are not that big of an issue.
"An Astronimical timer is what you want." Actually the person who started the tread wanted to use a photocell, so you are wrong there. You want to not tell people what they want, they tend not to like that. Best to give them the best answer you can that stays within their scope. Like your ID says. KeepItSimpleStupid
 
Perceived scope: Photocell controlling chicken coop door based on the thread this thread was embedded in
New scope: Photocell and no chicken coop door.

Dynamic braking and limit switches still apply, I think. The timer doesn't necessarily.
 

Thread Starter

Mouthpear

Joined Dec 24, 2018
25
Perceived scope: Photocell controlling chicken coop door based on the thread this thread was embedded in
New scope: Photocell and no chicken coop door.

Dynamic braking and limit switches still apply, I think. The timer doesn't necessarily.
Embedded here yes but where it would be the most use would have been to leave it there. As it is, this thread is not referenced in the other tread in any way.
"Dynamic braking and limit switches still apply" Yeah but that's not what the original thread is about. Adding that just clutters things.

Personally I like timers better and even arduino controlled coop doors better, but I try and stay within the scope.
 

Tonyr1084

Joined Sep 24, 2015
6,000
The use of a photo resistor can be used if it triggers something with a large hysteresis. Otherwise, yes, clouds can be an irritant. The door opens in the morning, then clouds come over and the door closes. If it stays cloudy all day the door might not open up again till the next morning.

This site is geared toward answering the question posed by the poster. However, if someone is headed in a direction that could be complicated it's not a sin to make an alternative suggestion. I've posted threads that others have advised a different solution - and they work better than the one I was originally having trouble with. For that I've been grateful.

I agree that IF the sun comes up and the door opens - and stays open - and stays open - the motor is going to fail. The motor has to do its job then stop. OR the motor has to be so over-rated that sitting there all day with power running through it doesn't harm it. But then you can't use battery or solar. You'll kill the battery and there won't be power to close the door in the evening. But a timer just seems to be a better idea from what I see. That and limit switches.
 
Last edited:

ebeowulf17

Joined Aug 12, 2014
3,276
Either way I hope that if you find this to be a better answer here and there that you will mark it as so.
Is this one of those sites that just counts comments despite content?
You seem to want this forum to be a competition that you can win. It isn't. Nobody is being graded. No one is keeping score. You can't win. We just talk through things and try to help each other out. It's a discussion, not a contest. Sometimes there is a very clear conclusion to a thread, but not always.

Your post here was following up on a specific question from over a year ago. It's a pretty safe bet that the original thread starter either abandoned the project or (more likely) got the answer they needed on the third post, which did in fact answer the question of how to wire the relay contacts to make a reversing switch.

There wasn't really anything left that needed to be discussed there, so no particular need to revive an old thread. If you want to discuss these circuits in more depth for your own interest, that's fine, but the assumption is that if the thread starter hasn't said anything in a very long time, they're done with the project (for better or for worse) and any further discussion should probably be treated as a new subject.

If you don't like the structure and nature of these forums, you can explain your viewpoint to moderators, but there's no reason to lash out angrily at anyone (users or moderators.)

Frankly, it's pretty bold of you to come in as a new member and expect everything to suddenly change based on your preferences. Why not explore the forum, read other posts, and see how things usually work around here before trying to tear it all down and rebuild it to your own specs?
 

Reloadron

Joined Jan 15, 2015
5,935
I believe that as drawn when the motor M runs driving an actuator it will eventually, run into a stall get hot and game over. There is no provision for limit switches. Then there is the also mentioned matter of hysteresis as in there is not any. It's not about or as simple as a cloud passing over. There is more to it. The transition of saturated to not saturated is not a simple On / Off and during that transitional period at dawn or dusk that relay is just going to sit there and chatter. Just maybe this is why in chicken coop door applications consideration is made at design time for little details like limit switches on actuator motors and the hysteresis zone at dawn and dusk.

No, members here do not get any points for post count, they do get credit for addressing questions with answers which will work in actual real applications. Hard to ignore the fact that the circuit which began this thread addresses neither limit stops or hysteresis. Now if you would like to modify the circuit then have at it.

A simple Google will bring up a dozen coop doors or more. The attached drawing takes into consideration both limits of travel and hysteresis. It also offers a manual override which is likely a nice to have.
Chicken Coop Door 1.png

Ron
 

Thread Starter

Mouthpear

Joined Dec 24, 2018
25
You seem to want this forum to be a competition that you can win. It isn't. Nobody is being graded. No one is keeping score. You can't win. We just talk through things and try to help each other out. It's a discussion, not a contest. Sometimes there is a very clear conclusion to a thread, but not always.

Your post here was following up on a specific question from over a year ago. It's a pretty safe bet that the original thread starter either abandoned the project or (more likely) got the answer they needed on the third post, which did in fact answer the question of how to wire the relay contacts to make a reversing switch.

There wasn't really anything left that needed to be discussed there, so no particular need to revive an old thread. If you want to discuss these circuits in more depth for your own interest, that's fine, but the assumption is that if the thread starter hasn't said anything in a very long time, they're done with the project (for better or for worse) and any further discussion should probably be treated as a new subject.

If you don't like the structure and nature of these forums, you can explain your viewpoint to moderators, but there's no reason to lash out angrily at anyone (users or moderators.)

Frankly, it's pretty bold of you to come in as a new member and expect everything to suddenly change based on your preferences. Why not explore the forum, read other posts, and see how things usually work around here before trying to tear it all down and rebuild it to your own specs?

Says the person who just came here lecture and not post ANYTHING related to the thread.
 

Thread Starter

Mouthpear

Joined Dec 24, 2018
25
This site is geared toward answering the question posed by the poster. However, if someone is headed in a direction that could be complicated it's not a sin to make an alternative suggestion. I've posted threads that others have advised a different solution - and they work better than the one I was originally having trouble with. For that I've been grateful.
Yes it is nice to offer other solutions but FIRST answer their question. I have no problem with that. I do have issues where these, so called "veterans of the forum", interject information that wasn't even asked about. While offering NOTHING in response to the question asked.

Example. In the thread I reference there was a guy who just started talking about limit switches when the question was how to wire a particular relay module to work with a photocell. The guy had nothing to say about the photocell.

The poster wasn't asking about limits witches nor does it really matter. Maybe the person already had that handled. Why assume the person doesn't already?

As to your comments about the actual subject. A simple Photocell Module with Time Delay solves that issue. Using two is even better. This demo I made shows how it works. Long time delay and sensitivity set high. So even on the cloudiest of days it stays on. So it doesn't start to close until it is actually very dark. In the video I set the time delay low just to show it work, and so I wasn't standing there holding the flashlight for a long time.


I did not post this because I didn't want to get accused of "hijacking" the thread. You mentioned that giving the poster options is a good thing. Well, it seems that other don't like it when you do that. I in fact gave an answer and gave other possible solutions, and I did it on that very thread that I referenced, yet my information got moved to here. I was accused of "hijacking", by the very same person in the example. Go figure.
 

Tonyr1084

Joined Sep 24, 2015
6,000
Why assume
Sometimes we try to help without sufficient information. We take it upon ourselves to "Assume" certain parameters, or may give examples using assumed parameters. It's been said that when you assume you make an ass out of you and me. Not calling you any names, just pointing out that assumptions can lead to problems.

When we have insufficient information it's very hard, sometimes impossible to give a good, correct and safe bit of advice. Often I've seen people ask the same question over and over because the thread starter (TS) doesn't address the question. A question that for some reason seems important to the one answering the question.

As for why you got accused of hijacking someone else's thread - well, when person A starts a conversation and person B starts asking more questions, person A's question can head off in a direction that A didn't need or want. There's no problem with having your question moved to its own thread. Moderators (I'm not a mod) make a judgement on how to keep things moving in the right direction for all here. I've poked a question into someone else's thread and was split off into my own question too. Just remember, we all are humans, and we all make mistakes. Obviously a moderator (or two) may have thought splitting your question off was the right thing to do.

I don't know how much more help I can be, but I'll keep an eye out. If I have anything useful (that I'm aware of) I'll share it. But my level of knowledge and experience pales in comparison to many others here. Answering questions is a way for me to sharpen what I do know. Following threads is a way to learn yet more. The end result sometimes leads me to start a thread of my own asking 'is this a good way?' Sometimes I get useful help. Other times I get this: 'Why are you trying to do it that way? There are so many better ways to do it." I accept that. Learning is a life-long process. Anyone who thinks they're the end-all, be-all of knowledge is missing the point. We ALL can learn something. We just have to be willing to.
 

Tonyr1084

Joined Sep 24, 2015
6,000
When I was a boy I had one of those plastic rockets that you put water in it then pumped it up with air. When you pulled the lock the rocket would blast off into the sky. My friend and I decided to launch it at a target. I pumped it up and he aligned the rocket with the target then said "Fire". When I pulled the lock the rocket blasted away shooting a stream of water backwards, soaking my friends face.

We had a plan. We tried it. We learned. Had someone said prior to the launch that my friend was going to get a blast of water in the face we would have rethought our plan to include additional actions - that of after aiming - to move out of the blast zone.

Same thing is going on with this thread. A question is posed and we see issues that the TS may not have considered. To mention limit switches - though you didn't ask - is a wise service. If our giving you additional insight is offensive to you - there's nothing more we can say or do. And answering the question the way you want it answered could lead (in some cases) to damage or injury. And none of us want it on our consciences that we may be responsible for damage or injury. Or worse, death.

Understand our intentions are good. We're not here to beat anyone up. Though sometimes arguments may erupt - the main point is to help. So I hope the water rocket story helps. Incidentally, I laughed my arse off when my friend stood there with a face full of water and an expression of "Well that sucks!".
 

MaxHeadRoom

Joined Jul 18, 2013
23,166
Abscence of limits:
That's not even close to being the first consideration. Reversing polarity is the most common thing. LOL Why are you even bringing that up? Is this one of those sites that just counts comments despite content?
That is a little arrogant IMO, it is a perfectly valid assertion, almost as though treating a motor overload condition in the possible absence of a limit as trivial! :rolleyes:
Max.
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,221
That's not even close to being the first consideration. Reversing polarity is the most common thing. LOL Why are you even bringing that up? Is this one of those sites that just counts comments despite content?
The original poster stated that they were a complete beginner in electronics, which is a very important consideration.

Beginners often make the assumption that what they want to accomplish should be very easy to achieve, and become frustrated/disillusioned when their schemes result in a non-functional project, or worse yet, a smoking pile of junk, which happens a lot more frequently than you might think.

We have had plenty of folks come on here asking for help with their project, and then found out that they've already let the smoke out of one or more of the components.

One of the most important things is to find out all of the particulars of the project. For example, how is this project being powered? Nothing has been mentioned thus far. If it's being battery powered, then current usage is critical; as a constant drain of a stalled motor and/or energized relay will rapidly discharge even a lead-acid battery.

If it's a line-powered supply, what is the backup power in case the mains power fails? If this kind of thing is not considered, you may wind up with starved or eaten chickens.

The schematic in reply #2 probably won't work, as the photoresistor likely won't go low enough in resistance to supply enough current to turn on the Darlington transistor to energize the coil of the relay, changing polarity across the linear actuator's motor.

It would require the addition of a comparator IC such as an LM311 to detect the voltage at the junction of the photo resistor and a suitable value resistor to ground, with a capacitor from the junction to ground to keep electrical noise quiet.

Then, the other input of the comparator needs an adjustable voltage reference to compare against the aforementioned junction, made using a potentiometer with the ends to power and ground, and the wiper wired to the input.

But, that alone doesn't allow for hysterisis, which will have to be supplied from the comparator's output via a resistor; preferably variable.

The LM311's output cannot SOURCE current, it can ONLY SINK current. The Darlington on the relay board requires current SOURCED to it, so a PNP transistor is called for; collector to +12v/Vcc, base to output of LM311 using a 10k resistor, and a 10k resistor to the base of the Darlington, with a 1k pull-down resistor on the Darlington's base to ground. Also, a 1k pull-up resistor needs to go between the base of the PNP transistor and +12v/Vcc to ensure it's cut off.

All of this added circuitry will increase current draw; but nothing compared to having a relay coil energized, and infinitely less than that of a stalled motor in a linear actuator.

The issue of the possibility of a stalled linear actuator may seem inconsequential to you. However, a stalled motor may draw 7 to 15 times the current of the same motor under no load. That power will be dissipated in the motor as heat, resulting in very high power consumption and very likely a burned-out motor in fairly short order; or if thermally protected, failure by burning out the thermal fuse.

Are there motion-activated lights outside? Raccoons will soon learn to turn the lights on to open the chicken coop door.

Their are quite a range of people on these forums, of all ages, and from all walks of life. Some of us old retired engineers sometimes forget how confusing it all was when we started out. It's imperative for us to remember to have empathy and be kind, to treat everyone with respect.

About 60 years ago, I attempted to make an electromagnet from some lamp cord wire, a 10-penny nail, and a large doorbell dry cell. I stripped the insulation from about 10" of the middle of the copper lamp cord, and about 3/4" from each end of the 3 foot length. I wrapped the middle 10" of the wire around the nail (almost an Archemedes screw in appearance), then connected the ends to the battery terminals. I was very surprised to discover that the nail became very hot very quickly, but didn't attract iron fillings or another nail.

I didn't understand about ampere-turns, or that magnetic fields were different from electrical current. My Dad very patiently tried to explain it to me. But I was just around 7 years old at the time. A few months later, I built my first motor from nails, electrical tape, and a roll of magnet wire. It was a real thrill when it worked right away.

What most of us try hard to do here is to help others reach successful conclusions to their projects; which can take considerable amounts of time, effort and patience. All too often, newbies will try to make part substitutions without telling us, very inadequate power supplies, connect components wrong, the lists are endless. We do all this out of the kindness in our hearts and the desire to help complete strangers succeed; and all too often we don't even receive thanks for our efforts.

We want our new experimenters to succeed. In order to have a successful result, we wind up having to drag a lot of answers out of our new folks.

In order to successfully engineer a solution to a problem, as many variables as reasonably possible need to be considered.

Failure to consider things like reverse-EMF from the motor when the current is disconnected will result in burned relay contacts, shortening their lives considerably. Strategically-placed diodes can inexpensively solve that problem.

Failure to use motor braking may result in motor overruns.

Failure to use limit switches results in high power consumption and short motor life.

Ideally, limit switches would interrupt the current to the coil of the relay being actuated.

For best results, two single-pole double throw aka "changeover" automotive relays should be used. A single double-pole double throw relay like the original poster had may SEEM like the right relay to use, but in reality it is a poor choice for this application, not the least of which is wasting power all day or all night.

Nobody is born knowing this stuff. We all started off as a blank slate. Lots of us still have pretty hard heads ;)
 
Last edited:

Tonyr1084

Joined Sep 24, 2015
6,000
That's not even close to being the first consideration. Reversing polarity is the most common thing. LOL Why are you even bringing that up? Is this one of those sites that just counts comments despite content?
Not the first consideration??? Well, first, second, third or last - doesn't matter. Without limits the project is going to fail. Should we not consider failure?
This wasn't my post or thread to start with. Heck I am a bit peeved that it got moved off a thread where the info I posted would have done good but now no one there will ever get to see it.

"The photocell idea is fairly stupid, clouds will mess that up." Stupid? Really? It only seems that way when people don't know or can't figure out how to set them up. Cloudy days are not that big of an issue.
"An Astronimical timer is what you want." Actually the person who started the tread wanted to use a photocell, so you are wrong there. You want to not tell people what they want, they tend not to like that. Best to give them the best answer you can that stays within their scope. Like your ID says. KeepItSimpleStupid
I wanted to build a rocket and fly to the moon. So I was going to use 10 thousand sticks of dynamite. Someone said there's a better way. I have as yet to complete my journey to the moon; but someone asked "How are you going to get back home?" Well, I hadn't thought of that. If some "Veteran" hadn't asked me - I might be stuck on the moon for the rest of my life - however short that may be. And the dynamite? I'd probably never even get there. I'm glad others point out my mistakes before I make catastrophic ones.
Yes it is nice to offer other solutions but FIRST answer their question. I have no problem with that. I do have issues where these, so called "veterans of the forum", interject information that wasn't even asked about. While offering NOTHING in response to the question asked.
I have one question for you: Why are you so hostile at others attempting to help? This isn't a classroom exercise where we have to solve the equation the way the teacher wants it solved - someone is asking for help. A drowning person might grasp at straw while calling for help. Should we throw him more straw? Or perhaps wouldn't it be better to toss a float or life preserver? Or even a rope? But wait - he didn't ask for them. So should we let him drown?

Many take offense when someone scolds them for trying to help. I do the same thing - offer help in a different direction. Sometimes the TS WANTS an answer to be specific to the parameters he/she has set. If so stated then we will do as he/she wishes. And sometimes I offer an answer that others see problems with my approach to the solution. I'm never offended, not unless someone with the manor of speech (text) speaks down to me in a way that makes me feel smaller than I already am. I have no use for those who offer negative comments and derision. We're not here to deride others. You grew up testing 9V batteries on your tongue. So you want to test a 90V battery in the same manor. We suggest you don't try that. But if you MUST! Then it's your party.

Don't denigrate us for trying to help by pointing out things that are overlooked. Sometimes the slightest mistake in calculations can lead to devastating consequences.

But if you know better than us - then why even ask us for anything?
 

Thread Starter

Mouthpear

Joined Dec 24, 2018
25
Abscence of limits:

That is a little arrogant IMO, it is a perfectly valid assertion, almost as though treating a motor overload condition in the possible absence of a limit as trivial! :rolleyes:
Max.
You should read the part about the person using a Linear Actuator. So unless the person purchased a commercial actuator (highly doubt that they did) most of the ones people buy for this purpose, have internal limit switches. So again "That's not even close to being the first consideration." Second the person was asking about reversing polarity. Not limit switches.
 

Thread Starter

Mouthpear

Joined Dec 24, 2018
25
The original poster stated that they were a complete beginner in electronics, which is a very important consideration.

Yes so why bring up things that they are not asking about? Why not answer what the person asked and then give further information, not just blurt out something they didn't ask about and not eve answer their question.

You should read the part about the person using a Linear Actuator. So unless the person purchased a commercial actuator (highly doubt that they did) most of the ones people buy for this purpose, have internal limit switches. So again "That's not even close to being the first consideration." Second the person was asking about reversing polarity. Not limit switches.
 
Last edited:
Top