Building a DIY Smart Home Device: Get S**t Done

agafox

Oleg Agafonov

Posted on July 20, 2024

Building a DIY Smart Home Device: Get S**t Done

This year is the first time I wrote down a list of annual goals. One of them was to learn how to solder and build a DIY smart home device. When you set a goal like this, the hardest part is finding a project that will give you enough motivation to get shit done πŸ’©πŸ’©πŸ’©. Ironically, this phrase, known by every developer, was a real inspiration.

Last October, we bought a house in a Bulgarian village. Most of the villages here don’t have a central sewage system, so every house has an underground reservoir for wastewater. Every time it’s full, you call a special truck that pumps it out and takes it to a water recycling station(hopefully 😈😈😈). I had never lived with such a system before. A few months after we started living in the house, we encountered a situation where the water rose up to the pipe. When it happened again a month ago, I knew I needed to get shit done.

The idea of my first DIY smart home device was simple but intriguing: take an ultrasonic sensor, a cheap controller board with WiFi (to make things easier), and connect it all to a battery powered by a solar panel. Connect the board to WiFi and start sending API requests to New Relic. New Relic is a top-notch monitoring system that takes care of drawing a dashboard and sending monitoring alerts to Telegram or any other messenger. As soon as everything was planned, I placed a few orders on AliExpress and started waiting.

The ultrasonic sensor AJ-SR04M came first. It’s a very interesting device that works in five different modes. You can choose one by soldering a particular resistor. Here is a very good blog explaining it all in detail. Fortunately, the mode I chose works if you simply short the resistor. While waiting for the controller board, I decided to play with the sensor and connected it to my Flipper Zero:

Flipper Zero connected to the AJ-SR04M sensor

A week later, I received an ESP32 dev board. There is a lot of information on the internet about these boards, but for me, it was important that it comes with an embedded WiFi module and is easy to program using Arduino IDE or Visual Studio and PlatformIO:

ESP32 dev board programmed with Visual Studio and PlatformIO

I knew that the hardest part of the project would be related to the battery and solar panel, but here I cheated. Some months ago, I bought a solar-powered WiFi camera from AliExpress that was not working. Being too busy at the time, I missed the return window, so I disassembled it and took the entire power supply module.

What was left was to assemble everything and mount it on the reservoir. I decided not to go with a fancy 3D-printed solution and bought an electrical box the size of the solar panel:

The Get Shit Done Device mounted to the reservoir

The entire project took me 16-20 hours in total, spread equally over four weekends. Now I can see how close the water gets to the pipe. Also, once it’s getting close enough, I get a sarcastic notification in Telegram. But most importantly, I accomplished one of my annual goals and had lots of fun learning new things. It was also fun to joke with my Bulgarian friends that, while people are turning off lights by talking to Alexa, I probably found the idea for the most demanded smart home device in the country πŸ˜†πŸ˜†πŸ˜†.

πŸ’– πŸ’ͺ πŸ™… 🚩
agafox
Oleg Agafonov

Posted on July 20, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related