Wiring a relay board

Thread Starter

quique123

Joined May 15, 2015
405
So Im switching from an SPST relay board to a SPDT board. On the SPST relay board I currently have 3 channels occupied.

Channel 1: Has incoming Live and outoing to LED circuit of 4 lights. So I interrupted the home light circuit and fed the live into 1 relay terminal and then connected the other relay terminal to the outgoing line towards the lights. This works fine on SPST and Id like to keep it working on the SPDT.

Channel 2: Has incoming Live and outoing to a small compressor. Same as above but Im eliminating the compressor.

Channel 3: Has incoming 24VDC from power source and outgoing to 5/2 solenoid valve . The solenoid valve actuated a pneumatic cylinder and was operated by the compressor.

Channel 4: Is empty

Since Im replacing the compressor/solenoid valve/pneumatic cylinder with a linear actuator, I only need Channel 1 for lights and Channel 2 for the linear actuator. This leaves me with 2 doubts (wiring,commands):

Wiring
Channel 1: Now lights will be wired Live into common and outgoing to NO? Right?

Channel 2: Now actuator will be wired Live into common and outgoing to NO? Right?

Im guessing to NO because I dont want the lights on or the actuator activated constantly.

Commands
Channel 1: I used to send a command from a python script, (the letter e) for turning the relay ON and another command (o) for turning it off. Now the commands are a decimal 1 to activate relay 1, but now relay 1 has 2 positions. Would I send 1 two times and each successive one just toggles between the previous state? Here is a screenshot of the android app used to toggle it, its called blueswitch:

 

KeithWalker

Joined Jul 10, 2017
3,063
Wire it as you mentioned above, using the COM and NO contacts. You do not need to change the code at all. A SPDT relay works the same way a SPST relay. It just has an extra contact which is closed when the relay is de-energised.
New-4.jpg
 

Thread Starter

quique123

Joined May 15, 2015
405
yes but my power source puts out 24V+ and GND. The linear actuator has 2 cables. So:

Power Source ----- Relay
24VDC+ ---------- NO
GND -------------- NC

but what about the 2 lines coming from the actuator?
 

djsfantasi

Joined Apr 11, 2010
9,156
So Im switching from an SPST relay board to a SPDT board. On the SPST relay board I currently have 3 channels occupied.

Channel 1: Has incoming Live and outoing to LED circuit of 4 lights. So I interrupted the home light circuit and fed the live into 1 relay terminal and then connected the other relay terminal to the outgoing line towards the lights. This works fine on SPST and Id like to keep it working on the SPDT.

Channel 2: Has incoming Live and outoing to a small compressor. Same as above but Im eliminating the compressor.

Channel 3: Has incoming 24VDC from power source and outgoing to 5/2 solenoid valve . The solenoid valve actuated a pneumatic cylinder and was operated by the compressor.

Channel 4: Is empty

Since Im replacing the compressor/solenoid valve/pneumatic cylinder with a linear actuator, I only need Channel 1 for lights and Channel 2 for the linear actuator. This leaves me with 2 doubts (wiring,commands):

Wiring
Channel 1: Now lights will be wired Live into common and outgoing to NO? Right?

Channel 2: Now actuator will be wired Live into common and outgoing to NO? Right?

Im guessing to NO because I dont want the lights on or the actuator activated constantly.

Commands
Channel 1: I used to send a command from a python script, (the letter e) for turning the relay ON and another command (o) for turning it off. Now the commands are a decimal 1 to activate relay 1, but now relay 1 has 2 positions. Would I send 1 two times and each successive one just toggles between the previous state? Here is a screenshot of the android app used to toggle it, its called blueswitch:

There’s a lot missing from this code. For example, the variable b is set to many different values, but we can’t see how ‘b’ is used.

At a glance, it looks like the relay will toggle each time it’s code is received. This, sending 1 turns it on, sending another toggles it’s off. But that mysterious b... looks like it’s set to another command with a different mapping scheme
 

KeithWalker

Joined Jul 10, 2017
3,063
Yes, that is the way to do it. If the solenoid has two more wires to make the armature return, you will need to connect them to a second relay. Either relay is energized just long enough to make the armature change position.
 

LesJones

Joined Jan 8, 2017
4,174
I am confused by your last sentence in post #1. You start by saying that sending a letter "e" turns on the relay and sending a letter "o" turns off the relay. (That seems to make sense. ) You then change to sending a "1" to turn the relay on but no longer have a character to turn the relay off. Do you want to somehow make the relay toggle on and off when you send a "1" character ? A normal relay has 2 states on (Current passing through the coil.) and off (No current through the coil. I think it may be possible to get a latching relay that toggles between on and off. Changing to the method of driving the actuator with a SPDT relay. To do that you would need a + 24 volts supply AND a - 24 volt supply. If you are prepared to use a DPDT relay you can do it with a single supply rail. In the off state the relay could drive the actuator to the retracted position and in the on state it could drive the actuator to the extended position. If the actuator did not have built in limit switches you would have to add limit switches. An alternative to using a DPDT relay you could use two channels of your relay board. One would drive it to the retracted position when activated and the other would drive it to the extended position when activated. (If both channels were activated at the same time there would be no power to the actuator.)

Les.
 

Thread Starter

quique123

Joined May 15, 2015
405
So here is my new relay board:

https://www.amazon.com/Aihasd-Channel-Module-Bluetooth-Android/dp/B0749PYHKW

I'm actually not sure which is NO, Com and NC. Is there a way to find out, like a convention? I did snap this Pic of the underside of the board in case the traces help:
546D0B9F-BF78-41B4-B561-81BB4AE53A61.jpeg


As for the wiring, I've connected the 24v+ to the middle terminal in Relay A (which is usually the Common terminal).

I already had one of the actuator terminals wired to the 24v-. However I don't think that's a 24- terminal, I think it's a ground terminal. It's the (-) from a Phoenix Contact Uno 24vdc power unit:

https://www.phoenixcontact.com/online/portal/pi?uri=pxc-oc-itemdetail:pid=2902993&library=pien&tab=1

I'm not sure how to wire the rest.
 

Thread Starter

quique123

Joined May 15, 2015
405
I tried this but it doesn't work:

24v+ to Common
24v- to load
NO to load

Since the actuator is in the extended position since the first time I tried it, it hasn't retracted.
 

KeithWalker

Joined Jul 10, 2017
3,063
Are you using the right command to close the relay? Is the relay coil being energised? Is the relay closing? What happens to the actuator if you short the C terminal to NO? Do you have a voltmeter? do a bit of basic troubleshooting.
 

Thread Starter

quique123

Joined May 15, 2015
405
Yes the relay is activating, I can hear it click.

Measuring between the NO and Common terminal when the relay clicks it jumps to about 1.45V and drops to 0.35V. When I turn it off it drops to zero. I checked and there are 24v coming from the power source.

Where should I connect to Ground BTW?
 

KeithWalker

Joined Jul 10, 2017
3,063
If it really is connected as shown in your drawing, the supply negative and one side of the solenoid are connected together, making it circuit common.
It is not connected as in the diagram because when the relay is open, there should be full supply voltage between C and NO. Check your wiring.
 
Top