grasuoare
Posts: 9
Joined: Sat Jun 29, 2019 11:19 am

Relee boars + RS485

Sat Jun 29, 2019 11:50 am

Hi Guys,

I'm new to this world, please don't laugh. I have a big project in my house. I want every light to be turned on/off by a relay. (the switches will remain on the walls, lol), so in this case i made a schema with how should i wire all the stuff.

Could you please tell me if something is wrong or it will not work? Thanks in advance!

Image

For the project i'm using:
9 pcs - DC 5V RS485232 (TTL) RTU Control UART Relay Switch Board PLC Support for Modbus
10 pcs - Board with 8 relays.

Thanks!

blimpyway
Posts: 192
Joined: Mon Mar 19, 2018 1:18 pm

Re: Relee boars + RS485

Sat Jun 29, 2019 3:34 pm

You should give some links to specification/product pages for these boards.

The PI's 5V line will not be able power all those boards, relays and modules.

grasuoare
Posts: 9
Joined: Sat Jun 29, 2019 11:19 am

Re: Relee boars + RS485

Sat Jun 29, 2019 6:30 pm

For sure,

Here is the link for the RS485 Board: https://www.ebay.com/itm/8ch-RS485-Modb ... SwMrJc5leX

Here is the link for the Relay Board:
https://www.ebay.com/itm/5V-8-Channel-R ... Sw5BpdEMPF

Could you please tell me if i made the connections correctly? For the power supply how should i wire them? :)

Brandon92
Posts: 775
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: Relee boars + RS485

Sat Jun 29, 2019 6:53 pm

First of all. Before I'll give you any advice for this project.
What do you know about electronics, and is this your first project? And have you any experience in this field. Because this is not a easy project and you need probably a lot more than that (wrong) relay board.

grasuoare
Posts: 9
Joined: Sat Jun 29, 2019 11:19 am

Re: Relee boars + RS485

Sat Jun 29, 2019 8:20 pm

Good knowledge in the process of how the boards are populated, soldered and inspected. (i'm working in an electronic factory, process owner on programming the placement machines and automatic optical inspection machines)
At the electronic part and what the boards are doing my knowledge is moderate, but i'm a fast learner.

I had a similar project but with I2C expanders, and it went wrong because of the distance between the boards. That's why i try to use RS485.

Brandon92
Posts: 775
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: Relee boars + RS485

Mon Jul 01, 2019 5:31 pm

Okay, then I will tell you the following:
  • Is that relay board according to the high voltage standaard (clearance and creepage distance, quality of the solder and PCB and ...
  • Is the relay qualified to switch your load safely and reliable. So can the relay handle the inrush current of your load. Because the specification on the relay itself is with a resistance load. And your load is that not, so it will switch probably a lot less.
  • How are you going to plan the wiring, are you using fuses (and other protection) and what are the specification of that part.
  • Are all the relays connected to one group in your house.
  • And the things I forgot/ did not mention to you
So if some question that I briefly have written here can't be answered correctly or you don't know the answer to it. Then you need to think twice of the parts that you are going to use. For example, if the relay is not suitable of switching your load. It will switch just fine for a x amount of time. But then it will get hotter, or you can't switch it of. If it get to hold it could start a fire. If the solder is not good, it could also generate to much heat, and again you could have a fire in your house. And there are a lot more what I can say here..

And I personally would not want those relay board anywhere in my house installation. I would buy it from a seller like farnell and get the parts that are designed for this. By the way, you could use this relay board to switch a real relays with a low voltage.

But remember, yes this kind of relay board are cheap. But how much cost you live (your roommates) and your house in comparance with the products that you are going to use and connect.

And the last thing, the house installation is not the place to play around if you are not have the right qualification for it. It seems very easy, but it can bite you in your ass (so to speak).

(Sorry, for all the negative input :? It's noting personal ;))

grasuoare
Posts: 9
Joined: Sat Jun 29, 2019 11:19 am

Re: Relee boars + RS485

Mon Jul 01, 2019 8:43 pm

Thank you for your response and time!

- a better board. could you give me a link with one that has 8 relays?
- the wiring is planed by an electrician (not me), professional work (but i have to give him the boards)
- each board of relays + board control is placed in every single room (+ relays connected to lights), then connected to the raspberry pi that's in technical room (now i have crossed directly from every single room a LAN cable from the technical room)

I have found another link that i can use (the control board). Check it out:

http://rhwebco.com/relayControl.html?fb ... Eg2vYhTg6s

User avatar
IOTON
Posts: 95
Joined: Tue Jul 02, 2019 1:00 pm
Contact: Website

Re: Relee boars + RS485

Thu Jul 04, 2019 3:03 am

Your connections are wrong.

You can't parallel uarts.

the best way to do it - buy usb-rs485 dongle and connect it normally by 485 line.

for test reasons 2$ chienese dongle is fine.

for work I recommend to buy usb-rs485 dongle with galvanic isolation

grasuoare
Posts: 9
Joined: Sat Jun 29, 2019 11:19 am

Re: Relee boars + RS485

Thu Jul 04, 2019 5:44 pm

Thank you sir!

After a little search i got to this.

The board : https://github.com/Erriez/R421A08-rs485 ... /README.md

Image

Should i continue with this one? :)

User avatar
IOTON
Posts: 95
Joined: Tue Jul 02, 2019 1:00 pm
Contact: Website

Re: Relee boars + RS485

Thu Jul 04, 2019 6:02 pm

grasuoare wrote:
Thu Jul 04, 2019 5:44 pm
Thank you sir!

After a little search i got to this.

The board : https://github.com/Erriez/R421A08-rs485 ... /README.md

Image

Should i continue with this one? :)
yes, it will be fine. don't forget what I wrote about galvanic isolation

grasuoare
Posts: 9
Joined: Sat Jun 29, 2019 11:19 am

Re: Relee boars + RS485

Thu Jul 04, 2019 6:13 pm

I won't. i'm writing all the info in notebook :) and i thank you again!

I don't understand one important fact and if you could please explain.

For example we have one light that we want to turn on/off:
- manual (by wall switch)
- by raspberry (domoticz, home automation, etc. )

It is possible for both activation, the state of the light (if it is on or off) to be known by raspberry?

blimpyway
Posts: 192
Joined: Mon Mar 19, 2018 1:18 pm

Re: Relee boars + RS485

Thu Jul 04, 2019 7:41 pm

Yes you can switch the light on/off from either manual switch or relay google for "two switches for one light diagram". Replace one switch with a relay.

And no, it won't know whether the light is on or off without some extra sensor for either current or light.

User avatar
IOTON
Posts: 95
Joined: Tue Jul 02, 2019 1:00 pm
Contact: Website

Re: Relee boars + RS485

Fri Jul 05, 2019 3:04 am

grasuoare wrote:
Thu Jul 04, 2019 6:13 pm
I won't. i'm writing all the info in notebook :) and i thank you again!

I don't understand one important fact and if you could please explain.

For example we have one light that we want to turn on/off:
- manual (by wall switch)
- by raspberry (domoticz, home automation, etc. )

It is possible for both activation, the state of the light (if it is on or off) to be known by raspberry?
It is possible only if your wall switch connected to raspberry. Or you will need an additional relay circuit and a feedback circuit.

grasuoare
Posts: 9
Joined: Sat Jun 29, 2019 11:19 am

Re: Relee boars + RS485

Fri Jul 05, 2019 2:35 pm

I understand how it will work with manual switch and relay but i really don't understand how it will be wired to get also the state of the light.

Could you help me with a tutorial or a schema with the feedback of the state of the light (on or off)? I saw several posts about this without any feedback.

Thank you all for the time and feedback!

User avatar
IOTON
Posts: 95
Joined: Tue Jul 02, 2019 1:00 pm
Contact: Website

Re: Relee boars + RS485

Fri Jul 05, 2019 3:36 pm

grasuoare wrote:
Fri Jul 05, 2019 2:35 pm
I understand how it will work with manual switch and relay but i really don't understand how it will be wired to get also the state of the light.

Could you help me with a tutorial or a schema with the feedback of the state of the light (on or off)? I saw several posts about this without any feedback.

Thank you all for the time and feedback!
To get the state of light you will need to use a resistor divider and optocoupler. It's dangerous and you need to really understand what are you doing.
Here the schematic. Attention - SFH620 is AC input optocoupler.
Connect AC_N1 and AC_L1 to lamp, GPIO11 to raspberry GPIO PIN, recalculate R14, R16 resistors for resistance and power (my schematic for 24VAC).

Don't kill yourself.
Image

Brandon92
Posts: 775
Joined: Wed Jul 25, 2018 9:29 pm
Location: Netherlands

Re: Relee boars + RS485

Fri Jul 05, 2019 5:53 pm

grasuoare wrote:
Mon Jul 01, 2019 8:43 pm
Thank you for your response and time!

- a better board. could you give me a link with one that has 8 relays?
- the wiring is planed by an electrician (not me), professional work (but i have to give him the boards)
- each board of relays + board control is placed in every single room (+ relays connected to lights), then connected to the raspberry pi that's in technical room (now i have crossed directly from every single room a LAN cable from the technical room)

I have found another link that i can use (the control board). Check it out:

http://rhwebco.com/relayControl.html?fb ... Eg2vYhTg6s
Okay, good to hear that a electrician is connecting everything together. About a alternative with relay, the best way is to buy separate relay an place them on a din rail. And I thinkt the best idea is that you ask the electrician for the correct type of relay. Because he can see what type he needs and possible buy them cheaper/ or at a store where you cant buy them.
IOTON wrote: To get the state of light you will need to use a resistor divider and optocoupler. It's dangerous and you need to really understand what are you doing.
Here the schematic. Attention - SFH620 is AC input optocoupler.
Connect AC_N1 and AC_L1 to lamp, GPIO11 to raspberry GPIO PIN, recalculate R14, R16 resistors for resistance and power (my schematic for 24VAC).

Don't kill yourself.
Image
I will NOT ADVICE that he use this schematic. Because there is no protection and the way of connection/ soldering is also very importent for this kind of application. For example if you use a "standaard" experiment board the Clearance between the high voltage and low voltage is to low. So there is a possibility that the high voltage could be pressent on the low voltage side. And this could kill someone. And one other thing to remeber is that he "will" use this part in more then one roome in the house. So the light will not be powered by the same group and when the this could potential connect serveral groups to each other and this is a very dangerous situation.

But why do you want to check if the relay is really on. If you use a good one there is no problem and what says that the light is not diffect when you turn it on.

By the way when I take a look at this picture its look like the high voltage and the low voltage are to close to each other. And therefore not save to use!

grasuoare
Posts: 9
Joined: Sat Jun 29, 2019 11:19 am

Re: Relee boars + RS485

Fri Jul 05, 2019 6:09 pm

IOTON wrote:
Fri Jul 05, 2019 3:36 pm

To get the state of light you will need to use a resistor divider and optocoupler. It's dangerous and you need to really understand what are you doing.
Here the schematic. Attention - SFH620 is AC input optocoupler.
Connect AC_N1 and AC_L1 to lamp, GPIO11 to raspberry GPIO PIN, recalculate R14, R16 resistors for resistance and power (my schematic for 24VAC).

Don't kill yourself.
Image
I won't.
I have a problem with your idea.

- Raspberry Pi is situated in technical room.
- In every other room i have 1 boar of relays that is going to be connected to the lights of that particularly room
The connection from Raspberry Pi (technical room) is made trough a LAN cable to all rooms (as you know trough RS485 parallel solution).

It will work by wiring them all, from every room to the same pin? If yes, how?

Thank you again!
Brandon92 wrote:
Fri Jul 05, 2019 5:53 pm

Okay, good to hear that a electrician is connecting everything together. About a alternative with relay, the best way is to buy separate relay an place them on a din rail. And I thinkt the best idea is that you ask the electrician for the correct type of relay. Because he can see what type he needs and possible buy them cheaper/ or at a store where you cant buy them.

But why do you want to check if the relay is really on. If you use a good one there is no problem and what says that the light is not diffect when you turn it on.

By the way when I take a look at this picture its look like the high voltage and the low voltage are to close to each other. And therefore not save to use!
For the board i will ask him for a better solution then.

For the check of the relay. I want to check the lights when i'm not at home, when i'm in bed (lazy), if my wife forgot to switch them off, etc.

Is there a solution ?

Thank you all again, it surly helps me allot!

blimpyway
Posts: 192
Joined: Mon Mar 19, 2018 1:18 pm

Re: Relee boars + RS485

Fri Jul 05, 2019 10:54 pm

@Brandon - the schematic IOTON proposed was for 24V. So there should be a AC transformer with sufficient insulation.

And anyway the optocoupler's purpose is to insulate input from output for high voltages. A perfboard being risky doesn't mean the scheme in itself isn't right. Voltage insulation is a matter of distance between PCB traces which is a different thing than the scheme itself.

-------------------
For the relay PCB board - only the relay's common ac lead gets close to the relay's coil leads. It still can be wired to Neutral side of the AC. Probably not mentioned in documentation, if such thing exists.
-------------------
But you got a point, the original poster seems quite uncertain about which wires where should be connected. This raises a question about risks.
------------------
He needs to know whether the light is on or off in the case he wants to use a scheme like this, with the relay replacing one manual switch. He wants the lights to be turned by either relay or manual switches. That's a complication.

User avatar
IOTON
Posts: 95
Joined: Tue Jul 02, 2019 1:00 pm
Contact: Website

Re: Relee boars + RS485

Sat Jul 06, 2019 2:11 am

/////////////////////////////
I won't.
I have a problem with your idea.

- Raspberry Pi is situated in technical room.
- In every other room i have 1 boar of relays that is going to be connected to the lights of that particularly room
The connection from Raspberry Pi (technical room) is made trough a LAN cable to all rooms (as you know trough RS485 parallel solution).

It will work by wiring them all, from every room to the same pin? If yes, how?

Thank you again!


///////////////////////////////

You will need a schematic like this for every lamp, just connect it to the different gpio pins of your raspberry and enjoy.

If you have a number of lamps more than number of gpio pins, just use a multiplexer like tca9548.

@blimpyway It's normal to use a schematic I posted w/o any transformer with correct resistors. Optocoupler like this has maximum repetitive peak isolation voltage 890V.

User avatar
IOTON
Posts: 95
Joined: Tue Jul 02, 2019 1:00 pm
Contact: Website

Re: Relee boars + RS485

Sat Jul 06, 2019 2:36 am

Brandon92 wrote:
Fri Jul 05, 2019 5:53 pm
grasuoare wrote:
Mon Jul 01, 2019 8:43 pm
Thank you for your response and time!

- a better board. could you give me a link with one that has 8 relays?
- the wiring is planed by an electrician (not me), professional work (but i have to give him the boards)
- each board of relays + board control is placed in every single room (+ relays connected to lights), then connected to the raspberry pi that's in technical room (now i have crossed directly from every single room a LAN cable from the technical room)

I have found another link that i can use (the control board). Check it out:

http://rhwebco.com/relayControl.html?fb ... Eg2vYhTg6s
Okay, good to hear that a electrician is connecting everything together. About a alternative with relay, the best way is to buy separate relay an place them on a din rail. And I thinkt the best idea is that you ask the electrician for the correct type of relay. Because he can see what type he needs and possible buy them cheaper/ or at a store where you cant buy them.
IOTON wrote: To get the state of light you will need to use a resistor divider and optocoupler. It's dangerous and you need to really understand what are you doing.
Here the schematic. Attention - SFH620 is AC input optocoupler.
Connect AC_N1 and AC_L1 to lamp, GPIO11 to raspberry GPIO PIN, recalculate R14, R16 resistors for resistance and power (my schematic for 24VAC).

Don't kill yourself.
Image
I will NOT ADVICE that he use this schematic. Because there is no protection and the way of connection/ soldering is also very importent for this kind of application. For example if you use a "standaard" experiment board the Clearance between the high voltage and low voltage is to low. So there is a possibility that the high voltage could be pressent on the low voltage side. And this could kill someone. And one other thing to remeber is that he "will" use this part in more then one roome in the house. So the light will not be powered by the same group and when the this could potential connect serveral groups to each other and this is a very dangerous situation.

But why do you want to check if the relay is really on. If you use a good one there is no problem and what says that the light is not diffect when you turn it on.

By the way when I take a look at this picture its look like the high voltage and the low voltage are to close to each other. And therefore not save to use!
At first, consult with IPC2221. You will find a lot of information about clearance and safety. After that look at the picture you posted.

Imho it is not an engineering masterpiece, but it's acceptable to use if you install it in the proper place.

Anyway, anybody who works with hive voltages needs to understand a lot of theory. And must know safety rules.

grasuoare
Posts: 9
Joined: Sat Jun 29, 2019 11:19 am

Re: Relee boars + RS485

Sun Aug 04, 2019 6:08 pm

Hi all!!!

I finally succeed with this project. (without the reading the state of the relay - now I'm waiting for a solution of reading it from a domoticz project).

I have another part that is in my mind for a wile now. What do you recommend of a dimmer integration to the project? I want all lights from every board (8 boards x 8 lights/board) to be dimmed manual and virtual (domoticz).

edit: without wireless or IR implementation. cable (same RS485 may be a solution? )

Thank you all! :)

Return to “Automation, sensing and robotics”