ctoaun
Posts: 3
Joined: Mon May 18, 2015 12:28 pm

Relay activates, garage door doesn't

Mon May 18, 2015 2:59 pm

I have a garage door/gate opener almost completed. I'm using a raspberry pi 2, SainSmart 2-ch relay, chamberlain/LiftMaster remote control. All of the software that I've written is working perfectly. The raspberry sends me a lot of info/pictures through text messages and email. I have multiple web pages that allow me to control and run scripts on the raspberry(webiopi, javascript and python) from my iphone. As you can see in the attachment, I have white and black wires attached from the gate/garage buttons on the remote control and going into the relay. From the relay I have green and blue wires going to GPIO's 17 and 27 respectively. When I press the garage button on my iPhone, the correct LED turns off on the relay for one second. When I press the gate button on my iPhone, the correct LED turns off on the relay for one second. This is what should happen since I specified in my javascript:
button = webiopi().createSequenceButton("gate", "Operate GATE", 17, 1000, "10");
button = webiopi().createSequenceButton("garage", "Operate GARAGE", 27, 1000, "10");
There is obviously more to the script, just pasting the relevant parts that tell the GPIO's how to behave.

Now, if I remove the white and black wires from the relay and cross them the gate and/or garage will operate depending on which ones I cross. So, the relay seems to be working, the remote control works by itself, but when I tell it to operate by clicking the buttons on my iPhone (while everything is plugged in) the relay activates but the gate/door does not. Can anybody here tell me where I'm going wrong? All I can think is I have something wired incorrectly on the garage remote control. I just can't figure this out.

Thanks all!!
Attachments
Relay_RemoteLQ.jpg
Relay_RemoteLQ.jpg (51.96 KiB) Viewed 2227 times

anita2r
Posts: 226
Joined: Sun Dec 23, 2012 6:55 pm
Location: Ottawa, Canada

Re: Relay activates, garage door doesn't

Mon May 18, 2015 9:16 pm

Now, if I remove the white and black wires from the relay and cross them the gate and/or garage will operate depending on which ones I cross. So, the relay seems to be working, the remote control works by itself, but when I tell it to operate by clicking the buttons on my iPhone (while everything is plugged in) the relay activates but the gate/door does not.
A circuit diagram would help

Not sure what you mean by 'cross them'.
Do you mean you cross-them over to the other relay contact or did you mean that you connected them together.

If you connected them together (briefly) I am guessing that this simulates pressing a button on the remote control.
If this is the case, then it does not, as you say, prove that 'the relay seems to be working'.
To me it suggests the opposite - that the relays are not making (closing) the contacts.

If the leds you refer to are on the relay board, then i would look at two things:
1. are the relays themselves working, as opposed to the leds on the relay control circuit
With the black/white wires removed from the relays, use a multimeter to check that the relay contacts actually close
2. If the relays have change-over contacts are you using the correct pair of contacts
**********
It's hard to make out what the relay board is from the image, but it looks like a sainsmart module.
I haven't used one, but looking here http://www.sainsmart.com/sainsmart-uno- ... jects.html (scroll down the page to see a close-up) it looks as though the common connection on the relay is not the centre connection. To get the two wires (black & white) connected when the relay turns on, it looks like you need to use the outside two screw connectors on each block of three. The centre connector is 'normally on' with respect to the common connection.
**********

If the relays are not working, do you have sufficient power to drive them
Where are power and ground connected - are they connected to pins on the Pi's header or are they connected to a separate power source.

Regards

anita2R

johndough
Posts: 254
Joined: Sun Jan 13, 2013 2:00 pm

Re: Relay activates, garage door doesn't

Tue May 19, 2015 8:10 am

Hi

My opinion is the same.

You don't have sufficient voltage / current to power the relays.

They operate at 5volts.

The Pi provides 3.3volts.

You want a second and separate 5v supply just for the relay coils, and I cannot from the picture explain where this would connect.

The Sainsmart board is in 3 parts,1; the Pi input of 3.3 volts. then 2; 5volt area for the relay coils, and finally 3; the Contacts.

Parts 1 & 3 are probably fine. 2 needs more investigation.

Massi
Posts: 1691
Joined: Fri May 02, 2014 1:52 pm
Location: Italy

Re: Relay activates, garage door doesn't

Tue May 19, 2015 8:55 am

is the relay emitting a clear "click" when you activate it?
is it a 5V driven relay or a 12V?

I had a 5V relay that could not operate, even if connected to the raspi 5V, because it was too far from the raspi so the voltage drop accross the line would not activate it anymore. Take care of the power line and if it is not close to the raspi, use a different power source (remember to use common ground)

ctoaun
Posts: 3
Joined: Mon May 18, 2015 12:28 pm

Re: Relay activates, garage door doesn't

Tue May 19, 2015 12:24 pm

Thanks for the replies. I really appreciate you all taking the time to look at this and offer suggestions. To clarify my original post, if I touch the black and white wires together the door operates and the fact that the relay LEDs blink and I hear a click lead me to believe the relay is working. Original sentence was misleading...meant for it to be sort of a summary. I think part of the problem is that I had the relay power plugged into a 3v pin on the Pi. Now I have it plugged into a 5v and have also placed the black and white wires in the two outside ports as suggested by anita2R. I am getting different results but still not what is needed.

When I click the button to operate the door, the LED on the relay turns off for a second and I do hear a click. But the door does not operate. Something else I've found. If I reboot the raspberry pi, the LEDs on the relay seem to be about half brightness until... I go to the webpage or refresh the webpage on my phone(I'm not clicking the button to operate the door). Then the LEDs go to full brightness, I hear the relay click, and the door operates. After that I cannot get the door to operate again. I'm sure this behavior has something to do with the javascript that runs when the webpage is loaded as it initializes the pins. But I don't understand why it won't operate after this. So, in my original post I said that the software was working perfectly. Perhaps I was wrong about that. Maybe I'm not initializing something properly. Not home at the moment but I'll remote in and try to post the javascript in a bit.

Thank you all for looking at this.

anita2r
Posts: 226
Joined: Sun Dec 23, 2012 6:55 pm
Location: Ottawa, Canada

Re: Relay activates, garage door doesn't

Tue May 19, 2015 4:12 pm

Hi,
When I click the button to operate the door, the LED on the relay turns off for a second and I do hear a click
As I said before I don't have one of these relay boards, so this is a guess, but your comment about the LED turning off suggests that the control logic is reversed.

Regards

anita2R

Shea
Posts: 104
Joined: Fri Nov 25, 2011 7:16 pm
Location: Markham, Canada

Re: Relay activates, garage door doesn't

Tue May 19, 2015 11:30 pm

Hi, I am using one of these similar board to control my garage door. 3.3V GPIO signal with 5V for the relay board works for me. Since there is not much info provided by you, I can only try to provide some info for you to do the trouble shooting. These type of board init state is high, so you have to config it with your WEBIOPI config file. If your PI is too far away from the gate, or garage door, then there might not be enough current to drive it..

ctoaun
Posts: 3
Joined: Mon May 18, 2015 12:28 pm

Re: Relay activates, garage door doesn't

Wed May 20, 2015 1:06 am

Wow! I'm humbled and grateful for all of the responses. After correcting stupid mistakes and following your suggestions, the problem is solved.
1. The power adapter that I was using for the Pi was not supplying sufficient power for the relay.
2. I switched the logic. In webiopi config file I changed pins 17 and 27 to (1) instead of (0). This kept the relay from activating at startup. Then I changed the JavaScript to also initialize the pins high and when the button is pressed it goes to low for a second and back to high.

This solved everything.

Thanks again everyone. I can call my project complete!!

anita2r
Posts: 226
Joined: Sun Dec 23, 2012 6:55 pm
Location: Ottawa, Canada

Re: Relay activates, garage door doesn't

Wed May 20, 2015 3:48 am

Hi,

Great to hear that it works.

Its even tempted me to look at controlling my own garage door opener through a Pi.

Regards

anita2R

Return to “Automation, sensing and robotics”