Soapy is a smart power extension brick (amicably known as a soap bar) that is carefully designed to bring a novel level of convenience to your life. Through harnessing the power of the pocket-sized ESP32 micro-controller and the MQTT publish-subscribe network protocol, Soapy will enable you to effortlessly switch on or off your everyday home devices with a simple click of the button on your mobile phone or laptop through our web app; it’s that easy! We plan to showcase our product using a simple and highly relatable home example -- light bulbs.
Imagine the dread you feel when you are lying comfortably in bed, but have to get up and walk over to the other side of the room, just to turn off your light switches (or any other device for that matter) before trudging back into bed. Doesn’t this sound exhausting and familiar to you?
Most electrical switches/soap bars in the market today are still using old school switches that require manual operation, which simply adds too much inconvenience to our lives. Although there are existing solutions such as smart Internet of Things (IoT) plugs from various big name brands, these products may potentially have malicious code that can snoop on your home network traffic and possibly infringe on your privacy. Doesn’t this sound scary? In addition, the smart devices software included are limited to what the brand gives you which could be restrictive. Wouldn’t it be a relief if there were to be a solution that can tackle all these issues while providing the same functionalities as a smart IoT plug, if not more?
Our goal is to build Soapy, an open source smart soap bar that connects to the user’s home network, allowing one to conveniently switch on/off the individual switches via a web app interface.
The Internet connectivity of Soapy will allow you to track and manage the state of the soap bar from anywhere in the world. If you’re unsure whether your TV or house lights are left on after you have left the house, just check the Soapy web app and be on your way to resuming your other important tasks.
The open source nature of our solution allows the community to continually add new features and build upon the Soapy's source code. The possibilities are endless, ranging from software extensions to designing an RGB light show and to the integration with popular smart home ecosystems. Additionally, the transparency of Soapy’s source code will give users the peace of mind that the privacy and integrity of their home network is carefully preserved and intact.
Our solution consists of three main components:
- MQTT server
- Software Stack
Our hardware components include the ESP32 board, relay module and physical plug. To set up, the ESP32 first acts as an access point, allowing users to input their necessary device details, such as home Wi-Fi credentials, from a web page served by the ESP32. Once the initial set up is complete, the ESP32 switches mode to connect to the home Wi-Fi, and from there the relay can be used to control the electrical switch.
We then use the MQTT publish-subscribe network protocol, where our broker is hosted on MyQttHub. The ESP32 subscribes to the "/esp32/update" topic, waiting for the Web application to publish command messages on the same topic.
Our web stack consists of VueJS, .NET 5 and a PostgreSQL database. This web app allows users to control individual switches. When a user toggles the on and off button, it publishes a message to the MQTT broker. This message will be received by all ESP32s, which then crosscheck their UUIDs to determine if they need to be switched on or off.
Users can also write "programs" or short sequences of "ons" and "offs" to the ESP32, which can possibly lead to very creative light shows!
Challenges we overcame
In dealing with the cabling of the hardware, we had to ensure that every wire is correctly connected to the respective components. Any minor mistakes and oversight could potentially result in dire and life-threatening consequences (apart from the extensive amount of time spent on debugging any error), especially since we are dealing with electricity. Hence, extra time was devoted to ensure that the entire team carefully vets through the hardware before we put the product to live test.
On top of that, due to a lack of hardware resources and time constraint, there were times when we had to think out of the box for solutions to circumvent problems that range from a lack of a wire cutter to an accidentally damaged power socket. This had truly put our engineering skills to good test.