Hi guys, it is 2021 we suppose to have flying
cars by now and smart robots everywhere. But the distribution board in my house still
looks like this: this is horrible, no Wi-Fi, no display, nothing… and as the guy who loves
DIY home automation I take it personally. Today we gonna fix this by building a
distribution board that has a display, Wi-Fi, can measure power and a lot of other
stuff, and sends data to the internet. So get some coffee and let’s get started. Since I am building a smart distribution board,
I need a display to show some useful information. I decided to use 1602 LCD display with I2C module It, of course, would be much cooler to
use an OLED display here, but OLEDs have burn-in issues and the display should be
capable of working 24/7 for many years, so this LCD looks like a good solution here. Placing I2C module under the display here is not
an option, because I don’t have enough space here, not a big deal, of course, I just need to solder a bunch of wires. And here is the I2C module, I already removed
4 SMD components here, I recommend doing the same. Two of the components ware just a red
LED with a resistor, but the most important here is to remove 4.7K pull up resistors.
Why remove resistors you may ask? Well, the display needs 5V to operate, and
the resistors pull I2C bus high to 5V, but I am going to use ESP8266 with uses 3.3V
logic, so I am just gonna use the external resistors that will pull I2C bus to 3.3V, which
gonna make everything perfectly compatible. Adding a decoupling capacitor to the
power supply line is a good idea also. And after soldering a lot of wires, I want
to make sure that the display still works. Perfect, it works; now I just need to mount everything, using hot glue adhesive was probably a bad idea here so later I decided to use silicone sealant, which can easily handle high temperature without melting.
The next step for me was writing the code for the project and testing the energy monitor module.
It took a couple of days. My projects often just work in a progress, so a lot of decisions
ware made during the actual building process. The last problem I had to solve is to
implement the overvoltage protection. The voltage readings we already
getting from the energy monitor module, but how to turn off the electricity in my
house using software? it was a challenge. Here is an interesting solution that I came up with. I am going to use residual-current circuit breaker, this device automatically disconnects
a circuit when it detects that the electric current is not balanced between the
supply and return conductors of a circuit, and creating this unbalancing current is
easy, we just need a relay, and a resistor, or a capacitor. Let me demonstrate; please
don’t repeat this experiment it is dangerous. And be careful with the
capacitor when it is charged. Now I think it is time to show
the full circuit of the project. Link to the circuit and the source code you
can find in the description to this video. And now I just need to make
the mainboard. Let’s start. First, let’s solder female socket
header connectors for the ESP8266. Perfect.
Now, we need to solder three 4.7k pull-up resistors, two of
them are pull-up resistors for the I2C bus. They pull I2C bus to 3.3 Volts. Another resistor
is a pull-up resistor for the 1-wire bus, this is the bus for the digital temperature sensor.
Now let’s solder header connectors, for every device.
Everything is going to be connected to this board using header connectors, so it is
very convenient. There is not much to tell here, everything has to be soldered according
to the schematic. Let’s just do it. Here is the finished board after cleaning. Now, I just need to solder a
pin header for the display. Perfect, let’s install the board. Next step is to choose a power supply.
I decided not to use this crappy board from AliExpress that I previously wanted to use, it doesn’t look reliable. No fuse, no filters. I don’t like this. So I am
gonna use a charger from a Smartphone. This is much better. Let’s solder wires.
Let’s cover everything with silicone sealant. Perfect. Now, let’s mount energy monitor
module and the relay with the capacitor for the overvoltage protection.
I decided to use a piece of glass here. And of course, I add fuses everywhere; I just
want to be prepared for the worst-case scenario. Okay, let’s connect wires and mount everything. Okay, perfect. Let solder some wires for the relay. And wires for the power monitor module. Okay, that is perfect.
While I was waiting for the circuit breakers, I decided to
analyze my other monitor module, because I never trust devices that ware build in China. That when I noticed this: two SMD resistors
that have mains voltage applied to them. The problem with these resistors they have
a maximum voltage rating of 200 volts. My paranoia will not allow
me to sleep knowing this. I hate when China makes something
like this. I have to fix it. I decided to replace those resistors
with the series of smaller resistors. This can handle even 2000 volts. Now the resistors replaced and my
paranoia is happy now. So let’s continue. And now circuit breakers have arrived, so I
started preparing everything for the installation. Almost forgot to install DS18B20
Temperature sensor. Let’s install it now. Before the installation I did some final tests,
that is when I measured the current through the capacitor that should trigger the residual-current
circuit breaker, and it is only 15mA, not enough, although it works. I need to add one
more capacitor, to make it at least 30mA. Okay, that is good enough. Let’s add two
sequentially connected 470k resistors, they just gonna discharge capacitors
and probably not very needed here. So that is how it all looks now.
Now, everything is ready for the installation. The actual installation I didn't record, there is nothing interesting there, I just
connected wires to the circuit breakers. That's it. So here is the final result. Now I can turn everything off from
a smartphone, let me demonstrate. It works. This is how it looks inside. And this is how the web page looks like.
Here we have live information, about voltage, power, current, frequency,
power factor, energy meter, and temperature inside the distribution board.
If voltage becomes too high, the system will turn everything off in my house, and I am
gonna get a text message with the reason why. If the temperature gets high
I also gonna get a message. But that is not all.
We also have live chats. Live voltage values for example. Or even power consumption if you need that.
It shows minimum, maximum and the last value. Let me show what happens when
I turn this hairdryer on. We immediately see it on the chart.
Let's try that again. So basically I have live chart with power consumption in my house. That’s cool. Let’s try again.
It works. Also, it sends data to the internet every minute,
so I can easily see what voltage I had and when. So that is pretty much it for today,
in the description, you'll find everything needed to build this project. Thanks for
watching and see you in the next one.