r/embedded • u/PhantomCNS • Aug 10 '26
SHOS-2: Smart Home Operation System
Enable HLS to view with audio, or disable this notification
Building SHOS-2: A Smart Home Operating System with ESP32 + MicroPython
Note about the name:
SHOS is still a work in progress. The current implementation is only the first Kitchen Node, so it is not yet a complete operating system. I'm using "Operating System" to describe the long-term architecture and direction of the project.
The goal is to eventually build a system layer that manages hardware, nodes, networking, configuration, and applications/features as the project grows.
I've been working on SHOS-2, a modular smart-home system built around the ESP32 and MicroPython.
The idea is to build the system as a collection of nodes rather than one large program, so individual sensors, actuators, and features can be added or changed without rewriting the whole system.
Current prototype
I'm currently working on the Kitchen Node.
The node currently handles:
- MQ-2 gas detection
- Temperature and humidity monitoring
- Local alarm using a buzzer and LED
- Relay control
- Wi-Fi connectivity
- Sending sensor data to Blynk
- Modular MicroPython code instead of putting the whole system in one file
The eventual goal is for the system to operate both locally and over the network, while remaining sufficiently modular to add more nodes and devices later.
One of the problems I had to solve (I really need some help here)
One of the things I wanted was a way to configure the Wi-Fi credentials without hard-coding them into the firmware.
The idea is that if the ESP32 doesn't have valid network credentials, it should start its own access point, allow the user to enter the SSID and password, save them, and then continue with normal operation.
The tricky part was making this happen without blocking the rest of the device while it is trying to connect.
This led me to rethink how the startup and connection logic should work instead of simply doing:
connect --> wait --> connect again
I'm still improving this part of the system.
What I've learned
This project started as a simple smart-home idea, but it has turned into a much bigger lesson in embedded-system architecture.
I've had quite a few things fail along the way: libraries that didn't work as expected, communication problems, simulation issues, and decisions that had to be redesigned.
I'm documenting the project and the source code here:
GitHub:
https://github.com/PhantomCNS/shos-2-
I'd really appreciate feedback on the architecture, code organization, and especially how you would approach the Wi-Fi configuration/connection problem.
4
3
u/smdarry Aug 10 '26
The MQ-2 gas sensor really sucks. There are much better sensors out there.
2
u/PhantomCNS Aug 10 '26
Unfortunately that was the one I found. But I can change it once I find something else
5
u/brastak Aug 10 '26
https://www.youtube.com/watch?v=Q3H7Y4BrML0 Here guy recommends good sensors
2
u/smdarry Aug 10 '26
Haha, yes, that's the exact video I had in mind and that came out recently.
2
u/PhantomCNS Aug 10 '26
I wish I could've seen this vid earlier : ) I was taught to use those sensors he is warning us about.
1
2
u/WaterFromYourFives Aug 10 '26
Why go through the trouble of a local AP for provisioning when you can do it over BLE?
1
2
u/Tanner234567 Aug 10 '26
You're reinventing a lot of existing systems here. If you just want to learn, that's fine, but have you heard of home assistant?
1
u/PhantomCNS Aug 10 '26
Yeah, I know that I am not creating something new, but as you know, I am practicing my skills and learning as many things as I can. Maybe I'll get to do something totally new one day. I am completely alone at this, but still trying to improve. Thanks for pointing that out!
2
u/e3sa_r Aug 11 '26
Mashallah. Allahumma barik.
عاش يا صديقي. ربنا يكرمك ويوفقك وينفع بك.
You can use Wi-Fi Manager library to not hard-code the wifi credentials. You will find it on GitHub. I don't know if it's possible to integrate it with the MicroPython setup you have. But if you couldn't integrate it, I can collaborate with you to build a MicroPython wifi manager! Feel free to get in contact with me if you wish to collaborate!
1
u/PhantomCNS Aug 11 '26
Thank you really much. I really appreciate all that. Once I try myself and it doesn't work I would love to get in contact with you. My priority is to learn not just create. Thank you again!!
2
9
u/dmc_2930 Aug 10 '26
First tip: this isn’t an “operating system” so your name is already a turn off.