Last year while I was visiting my father in Lebanon, I noticed how the current economic situation has affected his daily life, and how cumbersome for him was it to follow up on providing the minimal requirements for a decent life. For those who do not know how is life there now, I will touch upon that in a couple of sentences: In Lebanon power cuts are something normal and you can't expect more than 4-6 hours of mains electricity per day. To compensate to that, many communities or small towns offer electricity through power generators, but these are capped usually by a certain amount of current (5A, 10A or 15A) and are usually more expensive (by about 150%) than the mains electricity prices. This leads to the fact that most people will run their power hungry appliances and devices during mains hours, and try to reduce their consumption during generator hours. You would see people running their hot water boilers in winter times or the air conditions in summer on mains, or making sure that the washing machine always runs on mains.
My old man was constantly complaining about not being able to get along with this, sometimes not knowing when mains or generator is running, or when to run what device to avoid getting a high bill by the end of the month.
So he was asking me if anything can be done about it after seeing how I have had made my house fully automated. I told him, well, we could home automate everything in your home but we will end up with a very expensive solution. Then a great idea hit me hard when I realized that I've been developing products for the automotive industry for the last decade, for sure I can work on something that eases my dad's life a bit. That's when the vision of “Vulcan Smart Controller” was born.
So I sat with dad for 3 hours and started to brainstorm about the features he (or any other customer) would like to have to simplify their daily life. And the outcome was amazing!
I wanted to start with a device that provides the following basic features, but also having 2 main factors in mind: scalability and extensibility:
2x 16A Relays to handle the power hungry home appliances
DIN rail mountable (2DIN), for ease of installation
Led indicators and a small OLED screen to display various types of information
1x AC input detection line. This can be used to detect generator electricity when it is provided
Ability to control the relays through a web interface and later on through a dedicated app
Simple rule engine to automate the control of the 2 relays
But later on I ended up deciding to incorporate lot of features that can be useful as well like:
Ability to communicate with other devices over MODBUS RS-485. Devices like power meters, DIN relays and Fluid level detectors
On board temperature sensor to monitor module temperature and avoid burn-outs and over heating
Ability to measure real time consumption on both relays. This will help setting maximum current draw or maximum monthly allowed consumption through the app for each relay
RF receiver Implement ESP-NOW to gather data from other wireless sensors, like temperature sensors to monitor hot water, thus giving the possibility to turn off the boiler earlier on to avoid unnecessary power consumption
Ability to communicate with Solar inverters (either through APIs or through MODBUS RS-485) to give more ability to the user to set rules based on additional events. For example, if the house is running on solar power, turn on the hot water boiler when the sun is at peak by reading out the data from the solar controller.
Adding AI ability to learn from user habits and take decisions by itself
I decided to leverage the knowledge I gathered over years in embedded SW development, hardware engineering and app development to set the pace for this project. I knew I have to learn lot of things and technologies along the road to be able to reach the goals I've set above. After long hours of research I settled for the following technologies:
Embedded SW development
Wemos Mini D1 ESP8266 16bit IoT chipset with WiFi connectivity packaging 4MB of flash, and up to 80KB of RAM and running at 80MHz (or 160MHz if necessary)
XIAO ESP32C3 from Seeed Studio: is a 32-bit RISC-V CPU (up to 160MHz) with WIFI and BT connectivity, 4MB flash and 400KB SRAM
Using Platform IO as Arduino based development platform
Flutter for cross-platform app development (backed up by Google)
Issues tracking, devops and wiki
Setup a self-managed Gitlab instance for issues tracking and devops, running in a docker container hosted on a Ubuntu 20.3 machine and running behind a nginx reverse proxy
Setup a self-managed Wiki.js instance for documentation purposes, running in a docker container hosted on a Ubuntu 20.3 machine and running behind a nginx reverse proxy
Backend services
MQTT secure broker running in a docker container hosted on a Ubuntu 20.3 machine
Self-managed S3 Minio management service (similar to S3 AWS service from API perspective) running in a docker container hosted on a Ubuntu 20.3 machine and running behind a nginx reverse proxy
Firmware code is hosted at https://gitlab.vulcan.ddns.me/vulcan-i-smart/vulcan-i-firmware
Flutter codebase is hosted at …
all development is made on local PC (MacBook) with Visual Studio Code. Commits are pushed later to Gitlab.
A build and test pipeline is triggered on each commit. If succeeded, a push request should be submitted for the commit to be included in the official release
A release (tag) would trigger an auto increment version, build, test and deploy stages
In the deploy stage, the firmware is pushed to the S3 Minio storage and the link to it together with the SHA-5 fingerprint of the Minio Server is published to the secure MQTT broker for the firmware on the Smart Controller to be notified. The firmware then compares the firmware versions and fetches the newer firmware if necessary, before starting an auto OTA update process