Disclaimer

Please, proceed carefully following the tips published in this blog, specially when Main Power is involved. I'm not responsible for any damages caused by what is written in this blog.
Thank you

Monday, 24 December 2018

Home Automation System - Let's continue with packages


I'm back...after a lot of time spent at work.

Step by step, I'll reach my goals...no need for hurry...it's a hobby!

Today's target is the packaging of photovoltaic production and basement consumption monitoring system

Here you can find my previous post about it...

http://domoticsduino.blogspot.com/2018/10/home-automation-system-two-pzem-004t.html

As you can see in the following image, it's a mess...and high voltage wires (220v) and PZEM-004T are not safe!


Now finally I'm pretty sure that this monitorin system works well...so it's time to package it, in the best manner I can afford (I'm not so good in manual jobs)đŸ˜‰

In brief, I have to arrange two PZEM-004T device and a ESP 8266 Mcu, keeping free space for wires and power.

I will use two boxes:



The big one for two PZEM-004T and the small one for the ESP 8266.

To let the wires get out from the box I made some holes in the plastic (I repeat: I'm not so good in manual jobs)



Here is the two PZEM-004T on the bottom of the plastic box. They fit perfectly.


Ok, boxes closed and wires connected again. Here is the final result (a little cleaner than before...)


Next step will be to hang boxes on the wall; now they are just leaning on the wall.

-----------------------------------------------------
Similar items used in this project
-----------------------------------------------------


3Pcs Geekcreit® NodeMcu Lua WIFI Internet Things Development Board Based ESP8266 CP2102 Wireless Module

12,66€
Geekcreit® NodeMcu Lua WIFI Internet Things Development Board Based ESP8266 CP2102 Wireless Module

4,11€
3Pcs Geekcreit® NodeMcu Lua ESP8266 ESP-12E WIFI Development Board

13,58€
AC Digital Multifunction Meter Ammeter TTL Current Tester Module PZEM-004T With Coil 100A 80-260V

5,25€
10pcs 100 x 80 x 32mm DIY Electronic Plastic Housing Junction Box Power Supply Box Instrument Case Jig Box XL-39

11,60€
2pcs 75 x 54 x 27mm DIY Plastic Project Housing Electronic Junction Case Power Supply Box

1,73€
5Pcs KY-015 DHT11 Temperature Humidity Sensor Module For Arduino

7,67€
10Pcs DHT11 Digital Temperature Humidity Sensor Module For Arduino

9,31€

Sunday, 11 November 2018

Home Automation System - Let's make it cleaner



It's time to put in order my things and idea about my Home Automation System project



In particular:

openHAB: there's a little confusion on logical name of item and things

MQTT: topic names are a little complicated to be memorized

Software: I have a lot of custom firmware version wrote for my custom devices (see ESP8266...)

Hardware: my custom devices are always "unfinished", with "live" wires...I'd like to packaging them

Let's start from the last point

The first device which needs a good packaging, also for security purpose, is the power meter, placed on the main floor (see https://domoticsduino.blogspot.com/2018/05/home-automation-system-energy.html)

Some weeks ago, I bought some plastic boxes. Here is the mail bag



and these are the boxes...two different sizes



I hope both PZEM-004T and ESP8266 will fit together



Perfect fit. Now I will try to run the wires through the hole


Ok, now I put it in its right place...hoping it will work as before



Luckily, it works as expected. Next packages will be the device involved in monitoring the photovoltaic production and basement consumption (see https://domoticsduino.blogspot.com/2018/10/home-automation-system-two-pzem-004t.html) and the device with gas, temperature and humidity sensors (see https://domoticsduino.blogspot.com/2017/11/home-automation-system-my-first-sensors.html)


-----------------------------------------------------
Similar items used in this project
-----------------------------------------------------

Friday, 26 October 2018

Home Automation System - Automating a floor lamp







Let's continue with my Home Automation System design, based on the wonderful OpenHAB

This time the main attraction is a simple floor lamp that will be trasformed in a SMART Device, using a Sonoff Basic.

These are my soldiers:




For those who don't know it, SONOFF  is a simple "wifi button", which allows you to control electrical loads remotely. The Basic version is the simplest one with a single relay.

It seems a simple job...

I will replace the standard button with the SONOFF...so, I will cut the wires to move away the button from the lamp...and plug these wires in INPUT e OUTPUT pins of the SONOFF.

Let the things be a little more complicated: on TASMOTA (https://github.com/arendst/Sonoff-Tasmota/wiki/DHT11-Wiring---Sonoff-Basic), I learnt that it's possible to manage an humidity/temperature sensor, linked to a free pin inside the SONOFF (GPIO14). A compatible sensor is the DHT11 and, luckily, I own some of them.


This sensor has 3 pin, Vin, GND and OUT. So I link Vin and GND to the right SONOFF pins and OUT pin to the GPIO14 (always inside the sonoff)...To discover the right position of these pins, I used again the TASMOTA Wiki (https://github.com/arendst/Sonoff-Tasmota/wiki/GPIO-Locations)

Here are the wires soldered and protected by a heat-shrinking sheath




Now, I have to solder the other side of the wires to the DHT11...



Also here I used a heat-shrinking sheath ...these pins are very close



And here is the complete device...



Now I make an hole in the plastic case to let the wires get out



And here is the lamp with the SONOFF and the DHT11...



Now it's software time. Using the well known TASMOTA web interface, I selected the right sensor connected to the GPIO14.

and then I inserted the usual MQTT informations.

Back to the home page, I noticed that the data acquired by the DHT11 is displayed on top of the page


Let's configure OpenHAB defining new items and the MQTT topic used by the SONOFF...

My MQTT topic will be smarthome/light_env/%topic%/%prefix%/

Looking to the TASMOTA console, I noticed a new prefix in the topic related to the temperature and humidity information:


This will be the topic which I'll use in the items definition.

Here is the result

Basic UI


Grafana Dashboard



And this is the switch for the lamp


-----------------------------------------------------
Similar items used in this project
-----------------------------------------------------