More than one Arduino


When you say esp, I assume you mean arduino.


I think this is the idea @nockrout, @Odianosen25, @wills106 talked about. From arduino you have relays that control 5v > 230 V cirquit. You can switch relays on or off, plus you can control switches and sensor directly in each room. Sensor is connected to 230V (if Sonoff / Shelly) or 3,3 V separate UTP cable (mySensors, Arduino). These MQTT hardware can be controlled over Internet or Wifi.

Is this the idea? I can miss something. I’m learning this installation secrets day by day but I’m still not good at it…


I am a bit confused by your Diagram.
Are you suggesting for example to be able to switch a relay on/off with both an Arduino and a Sonoff / ESP at the same time? I don’t understand the green wires from the Arduino to the relays.

If you use a Sonoff T1 Wall switch it is self contained, the relay to switch the light bulb on/off is built in to the wall switch.

You can turn the light on / off by either physically touching the switch or by using mqtt.


I think you are going round in circles and getting yourself awfully tied up.


I have reread the last few posts and I think the diagram you are after is as follows.

Yes I can’t spell…

Don’t Worry about the 10/100BaseT IEE802.3u and Ethernet. They are there just to get the point across that I am referring to using the Cat 5/5e/6 for it’s intended purpose.

Home Assistant using Cat 5 or what ever to the switch.
Switch connects to each Ethernet Shield (Running MQTT Client) in Room 1, Room 2 etc.
Ethernet Shield - Arduino
Arduino has sensors, relays, switches etc
Arduino passes sensor states back to Ethernet Shield.
Ethernet Shield converts sensor state into MQTT.
Ethernet Shield sends MQTT back down the ethernet cable where Mosquitto passes it to Home Assistant and does it’s thing.


@nickrout well you got me again, yes meant arduino :grin:

@wills106 u right on the spot, that’s what was meant.

@Michal_Nowakowski your diagram isn’t gonna do it. Please look into what @wills106 submitted and if you don’t understand we could take it up from there.



Thanks guys this is what I’ve needed. A clear diagram how to do it. I will sketch it again and place for review. Then when I will have clear idea we all can decide what version is better for the structure.
Arduino + shield + relay needs to fit inside wall can? Can I use FTP cable instead UTP ethernet cable (ftp is safer when it comes to noise reduction)?



Hi guys I’m back. Please check this connection. I can make some errors since I’m learning but please give me advice. When I will have some base, I will start new topic to compare this 2 methods (fully wired system vs mqtt base system)


This looks good and I like your approach.

Though there is no “fully wired system vs mqtt based system”. They are both MQTT based, but it’s wired vs wireless systems.

Also not sure how the shields work, but as an overview you got that design.

There is this framework that allows noobs like me to write simple code of the ESP based chips like arduino. You can catch it here Esphomelib - library to greatly simplify Home Assistant integration with ESP32.

I haven’t used it, the comments looks great. It should make it easier for you to develop your code if deciding to go full blown MQTT.

I have asked the question of how his code responds to shield, but he is yet to respond. So once he does, will post it here.



Arduinos are not esp based. The only connection between them is that you can program esp8266 based chips using the arduino programming environment. Esphomelib will not work with arduinos.


Oh ok thanks for that. Well I don’t use them, so a bit ignorant abt how they function. For some reasons I always thought they were same :thinking:


Hi with this idea… How to connect power 5v or 3.3v to Arduino when Arduino will be inside wall? By usb? i need to have usb cable also inside wall? This is problematic. Maybe ethernet shield will provide power?


The Arduinos shouldn’t be placed in the wall (if I understand what you mean.). I will normally say they be placed within the ceiling void in the location they will be used. You will need to provide power in the ceiling, which will be used to get power to the receiving units.

I don’t know the make of your ceiling, plaster board, wood (its definitely not grid being a home), but normally as long as there is an assess point into it, you can have a power socket at some point in that room’s ceiling.

if the ceiling is not possible, they can he “hidden” behind some other device, like the TV screen. Then you can run your cable from there, to the location of where you want to control of sense within the room.

This also allows for a neater way of managing things.

it really takes a lot of planning to get stuffs like this installed and working well



Sorry guys I have everything messed up. My idea was slightly different than reality. After making some reseach I’ve found that my wiring method will not work the way I’ve planned. But after some brainstorming I will use modified @willis106 idea (Ethernet shield over Arduino, but not inside each room. I will use 4 arduinos and connect them to Pachpanel, then I will send my FTP cable for each room. I will draw a skech tomorrow.

Only one think I don’t know is - how to transfer data via MQTT using shield (I need some examples of this), or maybe use MySensors? What is your opinnion on this (this looks cool , but I think I need to connect Arduino with Rpi - I stil don’t have experence on this)?


I haven’t read every post in this thread, but it appears to me that you are WAYYYY overcomplicating the project. Back up about 300 yards and take another look at what you want to accomplish.

Remember that in 10 to 20-years you will likely be selling the house and all your smart-home wiring will probably not be appreciated by the buyer. Don’t overdesign it in a way that paints your buyer into a corner. Worse yet, if this is a retirement move, you may go first and your wife may not have the expertise nor desire to maintain your installations when you aren’t around.

I am planning to move in five years when my wife retires, and I am taking all my Sonoff basics, ESP8266 sensor nodes, and Z-Wave switches with me. The buyer will move into a dumb home with conventional lighting wall switches. Our plan is to have our new home custom built and I plan to have a lot of CAT6 cable runs that I’ll probably never use because it’s rare that I can’t do something wirelessly.


Hi everyone, i see this post, and i am building a new house for smart house.

The ideas are here, but let me give an example.

You run power cables from each light to your server room and wire them up with sonoff or ethernet esp with tasmota on it and configured it in home-assistant.
When sensors and all that use cat 5/cat6 cables all around the house and when goes to your patch panel.
When from the patch panel to an Arduino mega with Ethernet Shield, so its wired, no wifi crap here.

When publish push button from Arduino mega with MQTT to your broker, and catch that on Home-assistant


You still need to have a switch at your outlet. Think of a toaster or electric frypan that bursts into flames, or your kid sticks a knife in an outlet. Hopefully the fuse/circuit breaker trips, but really you should be able to turn it off at the outlet rather than run to the server room.


Hm? Other than outlets that control lights, and are thus located close to the floor in only select location, no other outlets have switches, so why is that a requirement?

The only issue I would have is GFCIs, but GFCI (or RDCs depending on locality) can be installed at the outlets themselves, and still be fed switched power by a relay in a central location.


There is alot of maintenance at each room if i have the switch there.
The server room is centralised in the house, and there is alot of security for fire aswell.


Of course different jurisdictions have different requirements. All power outlets in my house have switches, and I have seen other mentions on this forum of a ‘requirement’ for local isolation.