wiring new house for espeasy and power supply

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
megamarco83
Normal user
Posts: 168
Joined: 13 Apr 2017, 23:09

wiring new house for espeasy and power supply

#1 Post by megamarco83 » 18 Apr 2020, 15:24

hi, in a new house, two levels: 1st 100 square meters, second floor 80 square meters.
i would like to control lights, blinds, push button for lights+blind control, heater and colling elements.
i would like to use the combination of espeasy and domoticz.
roughtly i can consider:
16 relays for light
50 pushbuttons (gpio as in)
9 blinds -> 18 relays (1for up and 1for down)
8 relays for heating (solenoid valves)
6 relays for garden irrigation

i think to use nodemcu or wemos. with a rought extimation i will need: n° 12 nodemcu.
i would likte to put them inside some junction box placed in the middle of the house the esp8266 + relays and from that central point wiring: blinds, light, light commands (pushbuttons), heating valves, etc...

my doubts are:

1) the connection of nodemcu are made by dupont cables.
there is a way to use somting with screw fixation? it could be more safety

2) usually the electrical junction box are provided by din rails.
there is something to fix nodemcu + arduino relays ?

3) power supply.
nodemcu and wemos and generally esp8266 are powered by 5v DC
i see that the consumption is very low, so i can use for example:
https://www.meanwell.com/productSeries. ... 6#tag-6-17

or
https://www.meanwell.com/webapp/product ... rod=HDR-15
https://www.meanwell.com/webapp/product ... od=ICL-16R
https://www.meanwell.com/webapp/product ... rod=MDR-10

what's the best from these models? and how much power?

4) i'm afraid about volt drop due to long wiring.
i mean, i will have 5v DC that will distribute around the house.
i will put in the middle of the 1st floor of the house: router+ many nodemcu+arduino relays, in one big junction box
on 2nd floor (in the middle) another junction box with nodemcu that control second floor + wifi repeater + arduino relays for 2nd floor

the wiring cables, conidering 100 square meter of house + nodemcu postioned on garden to irrigation control, can be long at least.... 60-70 meters (???) i don't know...
but if i powered with 5v i think that i could have some problems due to lenght of the cables, correct?

another aspect is: input controls (push buttons) will be connected to GPIO of nodemcu.
if i'm not wrong nodemcu gpio will works: 0v = off 3,3v = on
if for example i want to control one blind with wall switch i will have this push buttons that are about 60meters far from nodemcu, and nodemcu should recognise 3,3v (if pressed) or 0v (if not pressed)
is it possible??

thanks to all for suggestions!

TD-er
Core team member
Posts: 3404
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wiring new house for espeasy and power supply

#2 Post by TD-er » 18 Apr 2020, 15:39

Why not using Sonoff devices?
There are also DIN rail plates for the Sonoff units, so you can mount them to a DIN rail.

megamarco83
Normal user
Posts: 168
Joined: 13 Apr 2017, 23:09

Re: wiring new house for espeasy and power supply

#3 Post by megamarco83 » 18 Apr 2020, 15:49

TD-er wrote: 18 Apr 2020, 15:39 Why not using Sonoff devices?
There are also DIN rail plates for the Sonoff units, so you can mount them to a DIN rail.
because to controll this numbers of relays and input i need 12 nodemcu that has 9 usable GPIO
if i will use sonoff instead of nodemu i will need....thousand :)

TD-er
Core team member
Posts: 3404
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wiring new house for espeasy and power supply

#4 Post by TD-er » 18 Apr 2020, 15:57

Well Sonoff does have the 4-channel units, so then you only need "250" ;)

mrwee
Normal user
Posts: 180
Joined: 31 Aug 2016, 12:52

Re: wiring new house for espeasy and power supply

#5 Post by mrwee » 18 Apr 2020, 16:11

Quite a project :D

Have you considered products like Shelly switch/dimmer?
You need to be careful mixing low voltage GPIO's with 110/230V. There are some strict rules when e.g. having mixed cables in the walls.
Also it's true that ESP8266 doesn't consume much current, but if you have many on the same PSU, then they will consume quite a lot when all are powered on at the same time.
Make sure you have good Wi-Fi coverage inside + outside (if watering the garden)

Personally I have a lot of CAT5e / CAT6 cable throughout the house / garden, which I use for Ethernet or connect to a home-built power panel using 1-wire RJ45 pinout (https://www.weather-above.com/Rain%20Tr ... geold.html). I'm using an old ATX PSU with extra fuses to prevent cables from melting in case of a short.

megamarco83
Normal user
Posts: 168
Joined: 13 Apr 2017, 23:09

Re: wiring new house for espeasy and power supply

#6 Post by megamarco83 » 18 Apr 2020, 16:12

:D :D :D :D :D :D :D :D :D :D
coorect, but they cost 20euro :) and has 4ch
nodemcu+8ch relay cost 8euro and has 8ch :-)
joke apart....i'm struggle and afraid mayor about power supply of 5v. i'm afraid about voltage drop that i can have using long wires and also the connection of input gpio of 3,3v-0v with long cables.

maybe one solution could be add at every nodemcu a power regulation like this:
https://it.aliexpress.com/item/32845223 ... hweb201603_
what do you think?

this could be a solution to power on nodemcu, but it is not a solution to avoid voltages drom from input push putton that works from 3,3v to 0v
right?


i'm not able to design a pcb, but the best could be:
inset the link above power regulation + pcb terminals with screw + female pins to fix nodemcu

https://it.aliexpress.com/item/32828459 ... hweb201603_

https://it.aliexpress.com/item/40009095 ... hweb201603_

and after that build a box that contain: 8 ch relays+ pcb

megamarco83
Normal user
Posts: 168
Joined: 13 Apr 2017, 23:09

Re: wiring new house for espeasy and power supply

#7 Post by megamarco83 » 18 Apr 2020, 16:15

mrwee wrote: 18 Apr 2020, 16:11 Quite a project :D

Have you considered products like Shelly switch/dimmer?
You need to be careful mixing low voltage GPIO's with 110/230V. There are some strict rules when e.g. having mixed cables in the walls.
Also it's true that ESP8266 doesn't consume much current, but if you have many on the same PSU, then they will consume quite a lot when all are powered on at the same time.
Make sure you have good Wi-Fi coverage inside + outside (if watering the garden)

Personally I have a lot of CAT5e / CAT6 cable throughout the house / garden, which I use for Ethernet or connect to a home-built power panel using 1-wire RJ45 pinout (https://www.weather-above.com/Rain%20Tr ... geold.html). I'm using an old ATX PSU with extra fuses to prevent cables from melting in case of a short.
yes, also shelly could be a solution....but they has 2ch and cost....a lot!!!
nodemcu+arduino relay has 8ch and cost less than 8euro

for 230v AC correct, but they will not mixed with AC. i will have corrugated hose for 230V and separated corrugated hose to distribute DC 5v around the house to connect the push buttons

User avatar
Ath
Normal user
Posts: 244
Joined: 10 Jun 2018, 12:06
Location: NL

Re: wiring new house for espeasy and power supply

#8 Post by Ath » 18 Apr 2020, 16:43

Putting all nodemcu's in the central junction box, then adding a (higher powered) PSU there is a proper solution, not much voltage-drop to expect. Also the relays should be in that junction box, switching mains power for lights and blinds-motors.
When placing a nodemcu in the garden, just bring normal mains power there and use a decent PCU (most micro-usb phone-chargers will suffice).

Low-voltage wiring should be short, mains wiring can be much longer without causing trouble.
As written above, don't place low-voltage wires and mains power in, or close to, the same tube in the wall or ground, it will cause safety hazards and add unwanted distortion to the low voltage equipment.
/Ton

TD-er
Core team member
Posts: 3404
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: wiring new house for espeasy and power supply

#9 Post by TD-er » 18 Apr 2020, 17:10

Well if you are talking about relays costing less than an euro, then I would not switch high currents with those.

Maybe also nice to have a look at solid state relays, or other electronic switches using a triac.
Those do switch at zero-crossing of the AC voltage (so don't use them to switch DC).
This may also be more friendly for the connected devices you want to switch on/off.
Most solid state relays are like an opto coupler, so it is like switching a LED.
A triac is not isolated from mains, so if you look for those, make sure you know what you are doing :)

megamarco83
Normal user
Posts: 168
Joined: 13 Apr 2017, 23:09

Re: wiring new house for espeasy and power supply

#10 Post by megamarco83 » 18 Apr 2020, 17:32

Ath wrote: 18 Apr 2020, 16:43 Putting all nodemcu's in the central junction box, then adding a (higher powered) PSU there is a proper solution, not much voltage-drop to expect. Also the relays should be in that junction box, switching mains power for lights and blinds-motors.
that's what i want:
1 common place for 1st floor with nodemcu dedicate for 1st floor + relay
1 common place for 2nd floor with nodemcu dedicated to 2nd floor + relat in the same place, in the middle of the 2nd floor
Ath wrote: 18 Apr 2020, 16:43 Low-voltage wiring should be short, mains wiring can be much longer without causing trouble.
sorry, not understand this sentence.
using scenario above, i will have power relay and nodemcu in the middle of the house, but the push buttons are dislocated everywhere.
i mean i can have a push button on opposite side of the nodemcu, and maybe a 60meter cable that will connect this push button to nodemcu. pushbutton is a input for nodemu, so it will be connected to a free gpio, and it will work from 3,3v (on) to a 0v(off)
so using this long cable i can find some problem on control push buttons?
thanks

related to power supply, i posted three models, what's the best one?
and how much power? i guess that for n°12 nodemcu a 5VDC 12Watt power is more than enought, correct?
better to have two power supply 5VDC one at 1st floor and another one to 2nd floor, or one it will be enought?

as power relay i will use this 8ch:
https://it.aliexpress.com/item/32997387 ... hweb201603_
they are solid state 10A and has optocoupler onboard
it will be ok?

remain the issue how to fix nodemcu and ralay in junction box :)

happytm
Normal user
Posts: 107
Joined: 15 Aug 2016, 17:53

Re: wiring new house for espeasy and power supply

#11 Post by happytm » 18 Apr 2020, 18:55

This series of video's discuss alternative way of wiring for DIY home automation at https://www.youtube.com/watch?v=ZUEKr_4 ... K&index=40.

Thanks.

mrwee
Normal user
Posts: 180
Joined: 31 Aug 2016, 12:52

Re: wiring new house for espeasy and power supply

#12 Post by mrwee » 18 Apr 2020, 19:08

I'm feeing my ESP's with 12V, then bringing it down to 5V or 3.3V using something like: https://www.aliexpress.com/item/3286208 ... web201603_

I'm not a fan of those which can be adjusted by potentiometer, better to have it fixed.
You must make sure that you have fuses on your feed-voltage, and that the PSU can handle all the ESP's starting at once.

User avatar
Ath
Normal user
Posts: 244
Joined: 10 Jun 2018, 12:06
Location: NL

Re: wiring new house for espeasy and power supply

#13 Post by Ath » 18 Apr 2020, 20:13

megamarco83 wrote: 18 Apr 2020, 17:32
Ath wrote: 18 Apr 2020, 16:43 Low-voltage wiring should be short, mains wiring can be much longer without causing trouble.
sorry, not understand this sentence.
I just made the statement that higher voltage lines, like 110/220v, are less susceptive to interference than low voltage, and by your design you are implementing that, so it was more of a confirmation.
megamarco83 wrote: 18 Apr 2020, 17:32 i mean i can have a push button on opposite side of the nodemcu, and maybe a 60meter cable that will connect this push button to nodemcu. pushbutton is a input for nodemu, so it will be connected to a free gpio, and it will work from 3,3v (on) to a 0v(off)
so using this long cable i can find some problem on control push buttons?
I'd go for a pull-up resistor on any input GPIO, and use the button to pull it down to 0, that's way more reliable, the internal pull-ups in ESP's are between 30k and 100k so I'd use external pull-ups of 2.2 or 4.7k on the long cables to avoid spurious interferences simulating a button-press.
/Ton

megamarco83
Normal user
Posts: 168
Joined: 13 Apr 2017, 23:09

Re: wiring new house for espeasy and power supply

#14 Post by megamarco83 » 18 Apr 2020, 20:47

Ath wrote: 18 Apr 2020, 20:13
I'd go for a pull-up resistor on any input GPIO, and use the button to pull it down to 0, that's way more reliable, the internal pull-ups in ESP's are between 30k and 100k so I'd use external pull-ups of 2.2 or 4.7k on the long cables to avoid spurious interferences simulating a button-press.
thanks for explanation.
how i have to connect the pull-up resistor of 4,7k at every gpio that will used as input?
because i guess i will need it for all my push buttons: relay will not need because they will stay very close to noedmcu, but push buttion will be far from nodemcu. the pull-up resistor should be connected close to push button, or close to nodemcu?
thanks again

User avatar
Ath
Normal user
Posts: 244
Joined: 10 Jun 2018, 12:06
Location: NL

Re: wiring new house for espeasy and power supply

#15 Post by Ath » 18 Apr 2020, 21:44

megamarco83 wrote: 18 Apr 2020, 20:47 how i have to connect the pull-up resistor of 4,7k at every gpio that will used as input?
Pull-ups are normally only needed on input ports, and most commonly, as the name suggests, they are connected between VCC (3.3v) and the input. And yes, each port should get its own pull-up.
I always connect them close to the controller.

Something like this:
Image
/Ton

megamarco83
Normal user
Posts: 168
Joined: 13 Apr 2017, 23:09

Re: wiring new house for espeasy and power supply

#16 Post by megamarco83 » 19 Apr 2020, 19:32

hi to all....
i thinked a board that can allow using this heather pin female:
https://it.aliexpress.com/item/32861400 ... hweb201603_
nodemcu v2 cp2010 ; nodemcu v3 cp340 ; wemos d1 mini
on board i foreseen a pcf5874 connected on TX and RX pin
and i use the suggestion of put on remaining GPIO 4.7k resistor pull up

i used for firts time eagle cad, i attach to you a picture of schematic and bord on 2 layers
it's my firts time, i spend all yesterday night and all today :(
maybe can someone check if i'm on right way?

i see this prototiper:
https://cart.jlcpcb.com/quote?orderType ... aseNumber=

maybe if my circuite is correct i can ask for a quotation to print my board and assemble the components
what do you think?

in this way i can fix wire using fix screw, i choose phoenix connector that should this one:
https://it.aliexpress.com/item/33010961 ... hweb201603_

then i need to build a cover to put this pcb board on house junction box
espeasy2.png
espeasy2.png (33.3 KiB) Viewed 8983 times
espeasy.png
espeasy.png (33.51 KiB) Viewed 8983 times
thanks for support

User avatar
dynamicdave
Normal user
Posts: 224
Joined: 30 Jan 2017, 20:25
Location: Hampshire, UK

Re: wiring new house for espeasy and power supply

#17 Post by dynamicdave » 19 Apr 2020, 21:05

Sorry I'm a bit late to the party...

I'm paranoid about connecting a voltage directly to an input pin (just in case it was mis-configured as an output).
I just use an extra resistor to limit the current and protect the input pin.

I usually use two resistors connected as per the attachments.

Fig-A is wired as an Active LOW or Pull-Down circuit.

Fig-B is wired as an Active HIGH or Push-Up circuit.

Any resistor value between 1K and 3K3 should work fine.

Regards, David
Fig_A.jpg
Fig_A.jpg (84.75 KiB) Viewed 8978 times
Fig_B.jpg
Fig_B.jpg (110.84 KiB) Viewed 8978 times

megamarco83
Normal user
Posts: 168
Joined: 13 Apr 2017, 23:09

Re: wiring new house for espeasy and power supply

#18 Post by megamarco83 » 19 Apr 2020, 21:40

hi David, thanks for suggestion!!!!!
i used a 4.7k, so you suggest, if i use two resistors, to use two identical resistor? for exmple 1k both?

and..... last point...."noooooooo" i just finished the layout :( :(
kill my self, redo all from begin...two days spent on it :-))
....but i'm very slow and spend many time to find the components, and understand how to proceed with eagle cad :) so that's my gulty :-)

megamarco83
Normal user
Posts: 168
Joined: 13 Apr 2017, 23:09

Re: wiring new house for espeasy and power supply

#19 Post by megamarco83 » 20 Apr 2020, 00:18

hi, i finalize to add two resistor.
can please someone check the wiring and very if all is ok?
thanks so much to all
espeasy.png
espeasy.png (142.1 KiB) Viewed 8959 times
espeasy2.png
espeasy2.png (29.63 KiB) Viewed 8959 times

megamarco83
Normal user
Posts: 168
Joined: 13 Apr 2017, 23:09

Re: wiring new house for espeasy and power supply

#20 Post by megamarco83 » 20 Apr 2020, 17:22

for example:i chosed PCF8574T SOIC-16 and the pins: a0;a1;a2 will be connected to VCC or GND ? i find some different usage....
where should i connect int pin ?
is it correct to put condensator 100n from VCC and GND of pcf8574 ?

the connection of pull down resistors is correct?

i will use toe socket for nodemcu V2 Cp2102, that on left side will be commond with nodemcu V3 CH340 and another socket for wemos

what do you think?

Stejin
Normal user
Posts: 6
Joined: 19 Feb 2020, 23:42

Re: wiring new house for espeasy and power supply

#21 Post by Stejin » 27 Apr 2020, 11:05

Consult the docs for pcf8574 for the wiring specific things like /int.
a0,a1,a2 connect to ground or vcc depending on the i2c address you want to use, again see the docs.

I'm also on some planning my own house automation with custom relay + switches, essentially not identical, but close to what you plan.

Just to give you some ideas:

I plan on using multiple MCP2017 which has 16 Ports, instead of your 8 with the PCF.
That means, I can use up to 8x16 which would give me 128 input/output options.
All that with a single ESP8622 (less energy cost ect.)
I know it would be very nice to have everything on one board, but if something breaks it would be much easier to change a component if on different pcb's.
What I mean, the port Multiplier needs only 4 cables to be connected: VCC,Ground,SCL/SDA which would be a very nice separate component.

I would use Active low, because the MCP has internal pull-up. For longer cables an external pull up will be used.
Why not active high? The voltage drop on long lines would be so high, that the signal would not be interpreted as "high" without additional things.
Additionally is an pull low through the switch instant, an active high with a switch could be to short to "charge" the wire to give a high signal (esp. with a capacitor for noise/interference reduction).
I tested with ca. 10-15m SFTP Cat5e AWG24 + MCP2017 internal pull up and it worked fine.

I tried used ESPEasy / Tasmota, both support only one MCP or not enough ports through default ways.
I written my own firmeware prototype which support all 8 MCP and can be configured as input/output. The data is send to a MQTT Server which also acts as the master for controlling the outputs. I even added some code to the MCP lib to support multiple MCP on the same object without resetting the config.

megamarco83
Normal user
Posts: 168
Joined: 13 Apr 2017, 23:09

Re: wiring new house for espeasy and power supply

#22 Post by megamarco83 » 27 Apr 2020, 12:49

Stejin wrote: 27 Apr 2020, 11:05 Consult the docs for pcf8574 for the wiring specific things like /int.
a0,a1,a2 connect to ground or vcc depending on the i2c address you want to use, again see the docs.
i read it:
https://datasheet.lcsc.com/szlcsc/NXP-S ... _C7605.pdf
but sorry, i'm not so skilled in electronic....that's my first approach on it, my knowledge is in mechanics, so i'm learning by myself and of course making stupid questions / experimenting
what i understand if that using pcf8574 (so the datasheet linked and not pcf8574A) i can change the adress using A0 A1 A2 putting on VCC or GND and making combinations.
what i do not understand from that datasheet is how to determinate for example an adreess of 0x20 and if i connect in serie two pcf8574 and i want a second address of 0x21?
if i undestand correct, whit that datasheet, that is the integrated that i can choose from prototype supplier library, i shoudl connect:
0x20 => a0 = gnd a1= gnd a2=gnd
0x21 => a0 =vcc a1=gnd a2=gnd
Sda pcf1 = sda pcf2 = gpio5 = d1
SCL pcf1 = scl pcf2 = gpio4 =d2
correct?

Stejin wrote: 27 Apr 2020, 11:05 I'm also on some planning my own house automation with custom relay + switches, essentially not identical, but close to what you plan.

Just to give you some ideas:

I plan on using multiple MCP2017 which has 16 Ports, instead of your 8 with the PCF.
That means, I can use up to 8x16 which would give me 128 input/output options.
All that with a single ESP8622 (less energy cost ect.)
I know it would be very nice to have everything on one board, but if something breaks it would be much easier to change a component if on different pcb's.
What I mean, the port Multiplier needs only 4 cables to be connected: VCC,Ground,SCL/SDA which would be a very nice separate component.
first of all thanks for sharing ideas!
i bought also a mcp2017 but as you, i'm wondering to use espeasy and tasmota.
in some application espesy give its best in someother tasmota, do not blame me :)
anyway i would like also to control with domoticz to a more complete automation.
using mcp2017 in tasmota is very difficult and it has not support using IDX of domoticz devices, so i prefer to have pcf8574, maybe using two on same board.
not sure if pcf8574 in tasmota can be used also as input, but for sure it can be used for output.
in espeasy i know that pcf8574 can be used as well for input and output

Stejin wrote: 27 Apr 2020, 11:05 I would use Active low, because the MCP has internal pull-up. For longer cables an external pull up will be used.
Why not active high? The voltage drop on long lines would be so high, that the signal would not be interpreted as "high" without additional things.
Additionally is an pull low through the switch instant, an active high with a switch could be to short to "charge" the wire to give a high signal (esp. with a capacitor for noise/interference reduction).
I tested with ca. 10-15m SFTP Cat5e AWG24 + MCP2017 internal pull up and it worked fine.
here come my big lacks of knowledge, so is very difficult from a mechanic to understand and follow the discussion about pull-up or pull-down pro/cons and making right/best choose.

some post above, it was posted manual sketch of pull up and pull down.
i thought to use pull down, so active low, because looking at this:
https://espeasy.readthedocs.io/en/lates ... /GPIO.html
i will use gpio5 and gpio4 as SDA, SCL
the output of pcf to control relay (so 8 output)
and the gpio of esp8266: gpio14, gpio12, gpio13, gpio0, gpio2, gpio3(rx), gpio1(tx) as input, in total i will have 7 input from nodemcu.
i understood (maybe wrongly) that if i choose pull up i can have some problems using for example gpio0 and gpio4, gpio1 because if they will put on low at boot the esp will not boot.
so, if you can please help me looking at my schematic for example at gpio0:
gpio.jpg
gpio.jpg (327.11 KiB) Viewed 8675 times
i painted inside the black circle the resistor that i used. they go to VCC 5v
so, is it correct?

thanks for reply to another newbee stupid question.
Stejin wrote: 27 Apr 2020, 11:05 I tried used ESPEasy / Tasmota, both support only one MCP or not enough ports through default ways.
I written my own firmeware prototype which support all 8 MCP and can be configured as input/output. The data is send to a MQTT Server which also acts as the master for controlling the outputs. I even added some code to the MCP lib to support multiple MCP on the same object without resetting the config.
of course i'm not able to write my own system :)
but i'm cuorious on what relays you will choose for your house?
how you will manage the input? only with mcp?
do you will use domoticz or something else to house automation?

related to pcb with many stuff you are correct, but i will put pin heated on my pcb to allow assembly of nodemu v2 or nodemcu v3 or wemos
the pcf8574 will be soldered
i think that if some components could has issue, it will be the esp, so i can deassemble and substitute it or just remove to flash.
of course if pcf will be affected by some issue i need to resolder manually...
inside my pcb there are only resistors, one capacitors, pcf8574 and nothing more...
the relay that i choose are the "ar
duino blue" relay:
like this:
https://www.aliexpress.com/item/1869860 ... hweb201603_
that are working at 5v and can support 10A 230V AC
are not solid state, but they cost a few euro, so it they will broke in some years, i can easly substitute the module, becuase they will be connected by wires to my pcb.
i'm wondering to create some connection like pinheater on my pcb (instead of phoenix connection) so i can snap the relay board into my pcb, so i can avoid wiring, what do you think? (that's mechanic background :-))

thanks again

Stejin
Normal user
Posts: 6
Joined: 19 Feb 2020, 23:42

Re: wiring new house for espeasy and power supply

#23 Post by Stejin » 03 May 2020, 12:14

megamarco83 wrote: 27 Apr 2020, 12:49
Stejin wrote: 27 Apr 2020, 11:05 Consult the docs for pcf8574 for the wiring specific things like /int.
a0,a1,a2 connect to ground or vcc depending on the i2c address you want to use, again see the docs.
i read it:
https://datasheet.lcsc.com/szlcsc/NXP-S ... _C7605.pdf
but sorry, i'm not so skilled in electronic....that's my first approach on it, my knowledge is in mechanics, so i'm learning by myself and of course making stupid questions / experimenting
what i understand if that using pcf8574 (so the datasheet linked and not pcf8574A) i can change the adress using A0 A1 A2 putting on VCC or GND and making combinations.
what i do not understand from that datasheet is how to determinate for example an adreess of 0x20 and if i connect in serie two pcf8574 and i want a second address of 0x21?
if i undestand correct, whit that datasheet, that is the integrated that i can choose from prototype supplier library, i shoudl connect:
0x20 => a0 = gnd a1= gnd a2=gnd
0x21 => a0 =vcc a1=gnd a2=gnd
Sda pcf1 = sda pcf2 = gpio5 = d1
SCL pcf1 = scl pcf2 = gpio4 =d2
correct?
Yes.
0x20 to 0x27 for pcf8574.
megamarco83 wrote: 27 Apr 2020, 12:49
Stejin wrote: 27 Apr 2020, 11:05 I'm also on some planning my own house automation with custom relay + switches, essentially not identical, but close to what you plan.

Just to give you some ideas:

I plan on using multiple MCP2017 which has 16 Ports, instead of your 8 with the PCF.
That means, I can use up to 8x16 which would give me 128 input/output options.
All that with a single ESP8622 (less energy cost ect.)
I know it would be very nice to have everything on one board, but if something breaks it would be much easier to change a component if on different pcb's.
What I mean, the port Multiplier needs only 4 cables to be connected: VCC,Ground,SCL/SDA which would be a very nice separate component.
first of all thanks for sharing ideas!
i bought also a mcp2017 but as you, i'm wondering to use espeasy and tasmota.
in some application espesy give its best in someother tasmota, do not blame me :)
anyway i would like also to control with domoticz to a more complete automation.
using mcp2017 in tasmota is very difficult and it has not support using IDX of domoticz devices, so i prefer to have pcf8574, maybe using two on same board.
not sure if pcf8574 in tasmota can be used also as input, but for sure it can be used for output.
in espeasy i know that pcf8574 can be used as well for input and output
As far as i know Tasmota works "best" with an MQTT Server backend.
I would recommend that you dive into the topic of a central Home-Automation "Hub", which collect all sensors and controls all outputs.
I will probably go in the direction of ioBroker, because it support a lot (almost all?) of different Protocols and Systems.

One MCP worked completely fine with Tasmota, no problems there.
megamarco83 wrote: 27 Apr 2020, 12:49
Stejin wrote: 27 Apr 2020, 11:05 I would use Active low, because the MCP has internal pull-up. For longer cables an external pull up will be used.
Why not active high? The voltage drop on long lines would be so high, that the signal would not be interpreted as "high" without additional things.
Additionally is an pull low through the switch instant, an active high with a switch could be to short to "charge" the wire to give a high signal (esp. with a capacitor for noise/interference reduction).
I tested with ca. 10-15m SFTP Cat5e AWG24 + MCP2017 internal pull up and it worked fine.
here come my big lacks of knowledge, so is very difficult from a mechanic to understand and follow the discussion about pull-up or pull-down pro/cons and making right/best choose.

some post above, it was posted manual sketch of pull up and pull down.
i thought to use pull down, so active low, because looking at this:
https://espeasy.readthedocs.io/en/lates ... /GPIO.html
i will use gpio5 and gpio4 as SDA, SCL
the output of pcf to control relay (so 8 output)
and the gpio of esp8266: gpio14, gpio12, gpio13, gpio0, gpio2, gpio3(rx), gpio1(tx) as input, in total i will have 7 input from nodemcu.
i understood (maybe wrongly) that if i choose pull up i can have some problems using for example gpio0 and gpio4, gpio1 because if they will put on low at boot the esp will not boot.
so, if you can please help me looking at my schematic for example at gpio0:
gpio.jpg
i painted inside the black circle the resistor that i used. they go to VCC 5v
so, is it correct?

thanks for reply to another newbee stupid question.
Uff oh yeah thats a different issue, why i plan on not using any of the "default" gpios of the nodemcu/ardruino/... for my relays in this project. Because some of them are not "usable" without side effects on bootup, or must have specific "values" on bootup or it will not work or even worse flip your relays on and of randomly at startup.

The thing is why active low is used, the chips can often switch only very little power on high (like 100µA), but much more like 25mA to low (ground) in case of the pcf8574 (max of 100mA).
megamarco83 wrote: 27 Apr 2020, 12:49
Stejin wrote: 27 Apr 2020, 11:05 I tried used ESPEasy / Tasmota, both support only one MCP or not enough ports through default ways.
I written my own firmeware prototype which support all 8 MCP and can be configured as input/output. The data is send to a MQTT Server which also acts as the master for controlling the outputs. I even added some code to the MCP lib to support multiple MCP on the same object without resetting the config.
of course i'm not able to write my own system :)
but i'm cuorious on what relays you will choose for your house?
how you will manage the input? only with mcp?
do you will use domoticz or something else to house automation?
I will go with ioBroker and can use more or less any of these systems. It should support domoticz.
I will probably make my project (the MCP controlling stuff) open source, so anyone could use it easily, but it currently needs more testing and some more features.
megamarco83 wrote: 27 Apr 2020, 12:49 related to pcb with many stuff you are correct, but i will put pin heated on my pcb to allow assembly of nodemu v2 or nodemcu v3 or wemos
the pcf8574 will be soldered
i think that if some components could has issue, it will be the esp, so i can deassemble and substitute it or just remove to flash.
of course if pcf will be affected by some issue i need to resolder manually...
inside my pcb there are only resistors, one capacitors, pcf8574 and nothing more...
the relay that i choose are the "ar
duino blue" relay:
like this:
https://www.aliexpress.com/item/1869860 ... hweb201603_
that are working at 5v and can support 10A 230V AC
are not solid state, but they cost a few euro, so it they will broke in some years, i can easly substitute the module, becuase they will be connected by wires to my pcb.
i'm wondering to create some connection like pinheater on my pcb (instead of phoenix connection) so i can snap the relay board into my pcb, so i can avoid wiring, what do you think? (that's mechanic background :-))

thanks again
I tested these:
https://www.ebay.de/itm/Weihnachtsverka ... 3706856237
because the traces on the PCB are much bigger. But I didn't decided finally, because I need to think about mounting all of these and maybe go in a direction of DIN-Rails mounted Relays.
Many cheap ones have small traces with could only support like 300W or even less, so no way they gonna withstand 10A on 230V AC.

I will probably go with Cables to connect the relay board with the other things over some 8+ Pin Connectors. So my low power logic components can be a bit away from the high power relays.

megamarco83
Normal user
Posts: 168
Joined: 13 Apr 2017, 23:09

Re: wiring new house for espeasy and power supply

#24 Post by megamarco83 » 03 May 2020, 14:36

Stejin wrote: 03 May 2020, 12:14
As far as i know Tasmota works "best" with an MQTT Server backend.
I would recommend that you dive into the topic of a central Home-Automation "Hub", which collect all sensors and controls all outputs.
I will probably go in the direction of ioBroker, because it support a lot (almost all?) of different Protocols and Systems.

One MCP worked completely fine with Tasmota, no problems there.
i do not know ioBroker, but i see the website.
it's domotic hub like domoticz or smarthome or openhub?

Stejin wrote: 27 Apr 2020, 11:05

Uff oh yeah thats a different issue, why i plan on not using any of the "default" gpios of the nodemcu/ardruino/... for my relays in this project. Because some of them are not "usable" without side effects on bootup, or must have specific "values" on bootup or it will not work or even worse flip your relays on and of randomly at startup.

The thing is why active low is used, the chips can often switch only very little power on high (like 100µA), but much more like 25mA to low (ground) in case of the pcf8574 (max of 100mA).
here comes my issue....
i tested one nodemcu powered at 5v DC then connect two PCF8574 and n°2 8ch relay (the same you posted below!!)
if i turn on simmultaneously the 16 relays only 14 are triggered on, the last two goes to trigger but the relay phisically is not close. i think that the issue could be the voltage dropdown.
do you experimented the same issue using 8ch+8ch connecthed to two pcf8574 connected to same ESP?
Stejin wrote: 27 Apr 2020, 11:05
I will go with ioBroker and can use more or less any of these systems. It should support domoticz.
I will probably make my project (the MCP controlling stuff) open source, so anyone could use it easily, but it currently needs more testing and some more features.
mmm....sure that support domoticz?
i do not see it inside web site...ioBroker should be the domotic system, so it should substitute domoticz, or i'm wrong?

Stejin wrote: 27 Apr 2020, 11:05 I tested these:
https://www.ebay.de/itm/Weihnachtsverka ... 3706856237
because the traces on the PCB are much bigger. But I didn't decided finally, because I need to think about mounting all of these and maybe go in a direction of DIN-Rails mounted Relays.
Many cheap ones have small traces with could only support like 300W or even less, so no way they gonna withstand 10A on 230V AC.

I will probably go with Cables to connect the relay board with the other things over some 8+ Pin Connectors. So my low power logic components can be a bit away from the high power relays.
this relay are exatly the same that i have i hands, and i tested.
i find issue connectring two of this 8channel to one nodemcu using two PCF8574 and sharing the 5v DC power supply for nodemcu+pcf+the two 8ch relay
if i try to turn on all of 16 relays, not all can be trigger on, only 14, the latest 2 are truned on, but phisically the relay is not close.

for din assembly i would like to solve the issue using this:
https://www.aliexpress.com/item/4000071 ... hweb201603_

there are with different interaxis

Stejin
Normal user
Posts: 6
Joined: 19 Feb 2020, 23:42

Re: wiring new house for espeasy and power supply

#25 Post by Stejin » 03 May 2020, 17:01

megamarco83 wrote: 03 May 2020, 14:36
Stejin wrote: 03 May 2020, 12:14
As far as i know Tasmota works "best" with an MQTT Server backend.
I would recommend that you dive into the topic of a central Home-Automation "Hub", which collect all sensors and controls all outputs.
I will probably go in the direction of ioBroker, because it support a lot (almost all?) of different Protocols and Systems.

One MCP worked completely fine with Tasmota, no problems there.
i do not know ioBroker, but i see the website.
it's domotic hub like domoticz or smarthome or openhub?

Stejin wrote: 27 Apr 2020, 11:05

Uff oh yeah thats a different issue, why i plan on not using any of the "default" gpios of the nodemcu/ardruino/... for my relays in this project. Because some of them are not "usable" without side effects on bootup, or must have specific "values" on bootup or it will not work or even worse flip your relays on and of randomly at startup.

The thing is why active low is used, the chips can often switch only very little power on high (like 100µA), but much more like 25mA to low (ground) in case of the pcf8574 (max of 100mA).
here comes my issue....
i tested one nodemcu powered at 5v DC then connect two PCF8574 and n°2 8ch relay (the same you posted below!!)
if i turn on simmultaneously the 16 relays only 14 are triggered on, the last two goes to trigger but the relay phisically is not close. i think that the issue could be the voltage dropdown.
do you experimented the same issue using 8ch+8ch connecthed to two pcf8574 connected to same ESP?
For testing i connected 2x8 port on one 16 channel MCP and i tested also 2 different MCP. That worked fine. (I had one problem, I messed up one solder point and there was no connection one 1 pin)
You should be able to trigger all the relay's with a manual ground connection, maybe do this first.

megamarco83 wrote: 03 May 2020, 14:36
Stejin wrote: 27 Apr 2020, 11:05
I will go with ioBroker and can use more or less any of these systems. It should support domoticz.
I will probably make my project (the MCP controlling stuff) open source, so anyone could use it easily, but it currently needs more testing and some more features.
mmm....sure that support domoticz?
i do not see it inside web site...ioBroker should be the domotic system, so it should substitute domoticz, or i'm wrong?
yes complete substitute.
megamarco83 wrote: 03 May 2020, 14:36
Stejin wrote: 27 Apr 2020, 11:05 I tested these:
https://www.ebay.de/itm/Weihnachtsverka ... 3706856237
because the traces on the PCB are much bigger. But I didn't decided finally, because I need to think about mounting all of these and maybe go in a direction of DIN-Rails mounted Relays.
Many cheap ones have small traces with could only support like 300W or even less, so no way they gonna withstand 10A on 230V AC.

I will probably go with Cables to connect the relay board with the other things over some 8+ Pin Connectors. So my low power logic components can be a bit away from the high power relays.
this relay are exatly the same that i have i hands, and i tested.
i find issue connectring two of this 8channel to one nodemcu using two PCF8574 and sharing the 5v DC power supply for nodemcu+pcf+the two 8ch relay
if i try to turn on all of 16 relays, not all can be trigger on, only 14, the latest 2 are truned on, but phisically the relay is not close.

for din assembly i would like to solve the issue using this:
https://www.aliexpress.com/item/4000071 ... hweb201603_

there are with different interaxis
nice, didn't know something like this "exists" ... with a 3d printer it would even be possible to print your own.

Sharing the 5V from power supply is essential.

megamarco83
Normal user
Posts: 168
Joined: 13 Apr 2017, 23:09

Re: wiring new house for espeasy and power supply

#26 Post by megamarco83 » 03 May 2020, 20:38

Stejin wrote: 03 May 2020, 17:01
For testing i connected 2x8 port on one 16 channel MCP and i tested also 2 different MCP. That worked fine. (I had one problem, I messed up one solder point and there was no connection one 1 pin)
You should be able to trigger all the relay's with a manual ground connection, maybe do this first.
i understand that this relays has two different way for connections:
1) jd-vcc jumper connected
- VCC = 5v DC shared with powering of ESP
- GND = 0v DC shared with powering of ESP

2) JD-VCC jumepr removed
- jd-vcc (external one) = 5V external power supply
- GND (the pin at side of JD-VCC) = 0v of external power supply
- VCC (beside of int8) = 3,3V comes fom ESP
- GND (beside of int1) = not connected

i make the tests using this configuration: 6 nodemcu + 2 wemoss d1 mini ; 1 power supply for 5v DC ; 8ch relay boards
in case 1) i see some issue when i power one at same time more relays. i take one nodemcu and connect 3 pcf and n°3 8ch relay board (one for each pcf and connected on same nodemcu)
then another one 4ch relay connected to another nodemcu and then another one 4ch connected to a wemoss.
i try power on all at same time: 8ch + 8ch + 8ch (connected to same nodemcu trough 3 pcf) + 4ch (connected to another nodemcu) + 4ch (connected to a wemoss)
all relays board and esp8266 are sharing same 5v and GND in this case.
In this case when i power all relay on at same time i find issue: the leds of relay triger on, but some ralays (not all) i see that are not phisically triggered as close. If i switch off some relay the others that still trigger on, but phisically not close, now become close.
so i think that the power supply is not enought to triger all togheter.
my powe supply is 5V 1,5A (7,5w)

in case 2) i see no issue, but of course i use two different power supply:
for relay 5v 1,5A and for esp 5v 1A
in this case all relay triggered at same time with no issue.
unfortunatly i do not have more powerfull power supply, so i do not know if it can solve the issue....
but looking in internet i see that in case2) we trigger the optocoupler with 3,3V and the relay with 5v, so we separate the power and trigger, that i think it's a good thing!
in case1) we not separete them.
what do you think?
do you experimented also this issue triggering many relay at same time with same power supply?
how many ampere has your power supply?

at the end...i'm thinking to develop my board (it will be posted open source, and i already posted above some sketch with schematic and pcb) because, using a pcb you will have some advantages:
pin heater to install the esp8266 (nodemcu or wemoss) and you can easy remove / subristute it at necessity
inside pcb i will place some phoenix connectors so i can wire and fix with screw cables for input of wall switch, more strong connection compared to doupont connection
i would like to place inside my pcb also pinheater with same pitch of this relay board, so you have just to put above inserting the female pinheater of my pcb into male pinheater of relaybard. It will be simply snapped in, so no connections :)
what do you think?

i see this prototyper that seams not so expensive.
https://jlcpcb.com/
they also can soldering components. but as i wrote, just pcf + pinheater + phoenix connector + 5 resistors for gpio pin.

last question from my side.
how you wil will use a push button active on hight?
it means that it will be 0v around switches, and when you press the button it will go at 3,3v and it will trigger the relay?
do you have a schematic how to use in active on hight?
i serach but it not clirify me...
i'm succeed on workin on opposite side, i have 5v and when it go at 0v trigger the relay.
i'm using this TTP223 as push button.
thanks

Stejin wrote: 27 Apr 2020, 11:05
nice, didn't know something like this "exists" ... with a 3d printer it would even be possible to print your own.

Sharing the 5V from power supply is essential.
yes, but you have to develop and print :D
another point is that the printed samples, after some year become weak and can broken.
a molded component is more powerful for life time, and it will be my house's domotic so i hope that will life for many year :D

jimmys01
Normal user
Posts: 19
Joined: 07 Jan 2019, 22:37

Re: wiring new house for espeasy and power supply

#27 Post by jimmys01 » 03 May 2020, 23:36

Hello from me as well.

I have just finished my very own house and I could have done the automation wiring as I wanted. I had a lot of dilemmas to solve.
My final solution after a lot of consideration is as follows. Use sonoff 3ch T0 for the switches. Thats it. Blinds, Lights, Shutters and Curtains. All Tasmotised. For sensors and IR stuff I use Wemos with ESPeasy.
The reasons are as follows.
For me those T0 switches look very sexy.
But most importantly.. The wiring of the house was made standard. If I sell the house the next persons electrician will know hot to fix the lights, troubleshoot etc..
If something happens to me,this "thing" can be maintained.

You will save "some" costs by running UTP to the light switches than 1,5mm cable of the standard wiring.
You need to terminate all this UTP's somewhere right? Also each light has to terminate to the switch box for it to get the power from the relay right?
That is not a problem for a 4-5 light 30sqr meter hotel room. How about a 180m house now as you have.. The cable runs will become very very long. You will need a freaking lot of space in your breaker box as well.
If something breaks (and it will) YOU will have to fix it. Nobody you can call if something happens.


I glanced over your PCB designs and please oh please add filters in the inputs to mitigate noise in the long cable runs. Google "ghost switching".

Hope you figure this out! Please keep the updates coming.

Stejin
Normal user
Posts: 6
Joined: 19 Feb 2020, 23:42

Re: wiring new house for espeasy and power supply

#28 Post by Stejin » 04 May 2020, 10:15

These relays trigger (depending on the version) with "low", so why you ask for high trigger buttons? (basically a button)
The Buttons in your installation will never trigger the relay directly. Thats the essential part of home automation, to split trigger and actuator/relay completely with a centralized brain controlling everything.

If you have the exact same relay they consume ca. 70 mA per relay. 1500mA power supply you could have 21.4 relays which means 2.68 relay boards, so yes your power supply is to small.

As jimmys01 suggest adding filters probably means capacitors which increase chargup time for the trigger line. Which means active high will probably not work at all, because the time to charge the line could be longer then a button press. Thats why active low is used.

@jimmys01
For a big house I plan to use multiple "switch boxs" in the house, like on each floor.
This will significantly reduce the cable run lengths and decentralize the equipment.

Additionally i plan on using a good documentation for all the equipment ect. so that everyone that has some experience can maintain it. (like suggested here: https://youtu.be/QLMOlJYssms?t=364)

megamarco83
Normal user
Posts: 168
Joined: 13 Apr 2017, 23:09

Re: wiring new house for espeasy and power supply

#29 Post by megamarco83 » 04 May 2020, 13:58

Stejin wrote: 04 May 2020, 10:15 These relays trigger (depending on the version) with "low", so why you ask for high trigger buttons? (basically a button)
The Buttons in your installation will never trigger the relay directly. Thats the essential part of home automation, to split trigger and actuator/relay completely with a centralized brain controlling everything.
i'm asking about hight trigger for two reasons:
one is you sentence here:
Stejin wrote: 04 May 2020, 10:15 The thing is why active low is used, the chips can often switch only very little power on high (like 100µA), but much more like 25mA to low (ground) in case of the pcf8574 (max of 100mA).
i undestood that was better to use active on hight.
Second reason is that i want to use this as button:
https://hobbycomponents.com/sensors/901 ... uch-sensor
in this page you can see how it works. it can be used as active hight (default) but also with active low (connecting with a link point A)
in this case(A=linked=active low) the outpin of TTP223 will give +5v and go to 0v when it is pressed. the led on the TTP223 will alwayas stay on, and when i press it switch off...so not so good.
it's possible to flip the led working? or possible to remove led from the board keeping the board working also without led?


yes, this relay trigger with "low" but you can manage flagging "invert relay" in tasmota and also in espeasy. or inside rules using #state=0 to trigger and #state=1 to not trigger
so i think that's not a matter using button that trigger on hight and having this relay trigger on "low"....are two different things that can be cooperate, correct?
Stejin wrote: 04 May 2020, 10:15 If you have the exact same relay they consume ca. 70 mA per relay. 1500mA power supply you could have 21.4 relays which means 2.68 relay boards, so yes your power supply is to small.
understand. but why not powering the relay isng JD-VCC ?
in this case it's possible to power on the relay with a separate power supply, of course in this way you will need a power supply for NodeMCUs and a power supply for relay boards, but you will have power separate to logic, or i'm wrong.
Please consider that i'm not electronic guy, so i just documented my self reading/seraching, so i can be wrong and i'm here to learn and find a best way to operate :)

last question related to power supply unit.
if i buy a power supply, what is the best?
https://www.aliexpress.com/item/4000545712429.html?mp=1
https://www.aliexpress.com/item/4000192 ... 37559%2323
https://www.aliexpress.com/item/3276980 ... 37559%2323
are from same company but i do not undertand the differences...
about the power, what can be a suitable power for this project?

As jimmys01 suggest adding filters probably means capacitors which increase chargup time for the trigger line. Which means active high will probably not work at all, because the time to charge the line could be longer then a button press. Thats why active low is used.
here i ask both of you,
can you please attach a schetch how to connect the capacitors in my schematic to use push buttons?
maybe specify active low and active high.
thanks so much!!!

happytm
Normal user
Posts: 107
Joined: 15 Aug 2016, 17:53

Re: wiring new house for espeasy and power supply

#30 Post by happytm » 05 May 2020, 21:04

This is another protocol worth considering https://github.com/gioblu/PJON , https://www.pjon.org/documentation.php & https://www.youtube.com/watch?v=GWlhKD5lz5w.

There is a complete home automation system based on above PJON protocol at https://github.com/fredilarsen/ModuleInterface.

Thanks.

User avatar
ForsyDia
Normal user
Posts: 3
Joined: 08 Aug 2020, 19:06

Re: wiring new house for espeasy and power supply

#31 Post by ForsyDia » 14 Sep 2020, 14:00

Wow, pretty ambitious project, hope you will finish it soon.

User avatar
Seanin
Normal user
Posts: 3
Joined: 16 Aug 2020, 16:52

Re: wiring new house for espeasy and power supply

#32 Post by Seanin » 15 Sep 2020, 19:14

Wow, pretty ambitious project, hope you will finish it soon. I had a friend that did something similar but he used Shelly switch, and in the end, he said it was a bit expensive, compared to concurrents which are not so overpriced. Anyway, the best idea in such cases is to contact an electrician, which won't do the job for free, but I am sure will do it better than you, because he is specialized in this domain. My friend did this at least. You can call some electrician st louis mo and I am sure you will be pleased with their services

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests