Looking for Some Best Microcontroller for a DIY Smart Home Project?

Hey everyone,

I am working on a DIY smart home automation project and need advice on choosing the right microcontroller. My main requirements are:

Wi-Fi and Bluetooth connectivity
Low power consumption
Support for multiple sensors (temperature, motion, humidity, etc.)
Compatibility with platforms like Home Assistant or MQTT

I have been considering the ESP32 because of its built-in Wi-Fi/Bluetooth and affordability, but I am open to other options like Raspberry Pi Pico W or STM32. I want something reliable and easy to program, preferably with good community support.

Would love to hear your experiences !! Which microcontroller do you recommend for smart home applications and why: ?? Also, any tips on power management and security would be appreciated. I have also gone through this https://thinkrobotics.com/blogs/learn/best-microcontrollers-for-diy-electronics-projects-react-native but still need some more suggestions.

Looking forward to your insights !!

With Regards,
Derek Theler

2 Likes

Hi Derek,

I too like the ESP32, being able to deploy solutions with ESPHome is a breeze.
Pico W is a great option as well, support is increasing pretty quickly.

Iā€™ve handed power management a bit hap-hazardly, either I will power something with mains voltage, or use a nano-power timer HAT, of course other solutions exist for putting devices into sleep mode.

Liam

1 Like

Hi Derek, thatā€™s a very open ended question and will generate lots of opinions and very few facts that you havenā€™t already got.

Personally I have a computer programming background, then into robotics as the Raspberry Pi came out, so I like the full-featured software tools- rather than the lower level Arduino.

Several years ago I got into home automation, and again was impressed both with Home Assistantā€™s number of integrations, and that Raspberry Pi was a low entry cost.

I use TP-Link and Tuya local integrations, and came across ESPHome as an open alternative for tuya firmware, and it didnā€™t take long for me to decide to make ESPHome my preferred environment for devices. Partly because of the integration with Home Assistant, but mainly because of all the available ESPHome components and that so much can be done with parameters in yaml configuration code. It was so easy to add reporting of uptime, ESPHome version, wi-fi parameters including signal strength, a long button press to perform a reset, and of course to get consistent power monitoring on my Arlec PC191HA power points.

I am currently finishing a greenhouse project using ESP32-S3 and ESPHome. I recommend ESPHome, and the ESP32. but I canā€™t compare with RasPi Pico as I am trying to build my knowledge with what I have, rather than spread myself too thin.

Of course itā€™s not perfect - nothing is. I find the yaml coding is exceedingly sensitive to syntax and especially indentation, and sometimes the levels of indentation become ridiculous. You can do a lot more using lambdas ā€¦ but that uses C++ programming whereas the rest of Home Assistant uses Python.

While the list of supported components is very impressive, I have learnt to check for ESPHome support before buying hardware modules. Support for some of the features of newer ESP32 chips is still experimental or not available yet. And, like Home Assistant, i find the standard of documentation to be variable.

ā€¦ but itā€™s a large Open Source project developed mostly by people donating their ā€œspareā€ time.

Grrrrr ! I bought one of the DFRobot Solar Power Manager 5V boards, and quickly discovered that it manages bugger all. You will still need to add your own circitry to report the battery voltage so your automation can respond before the power just dies. I have had a couple of rants about this in other threads :wink: Suffice it to say that if doing it again I would include other brands of solar charger modules in my purchasing comparison.

1 Like

Hi @Derek288719

My pick for anything smart home related would be a FireBeetle 2 ESP32 C6 IoT Development Board (Supports Wi-Fi 6, Bluetooth 5, Solar-Powered) | Buy in Australia | DFR1075 | Core Electronics.

Itā€™s can work with ESP home, itā€™s low power and has the option to put a LiPo battery directly to the board, you can also read the battery voltage directly with GPIO 0. I havenā€™t tested the solar capability of the board but its nice to know the option is there if needed.

I also think the Firebeetle looks perfect for outdoor IoT projects with LiPo battery and solar panel connections built-in. But the ESP32-C6 is not yet officially supported ā€¦ though I found several threads in the forums which suggest that most or all the standard functionality is working now. My main concern was whether the additional power circuitry chips on the breakout board are supported by ESPHome, and you have confirmed the important sensor - battery voltage - is available, so Iā€™ll give it a go ā€¦ but soon.

Considering your requirement, ESP32 is by far the best. It has dual-mode (Wi-Fi & BLE), perfect for connecting to Home Assistant, MQTT, or cloud services. It has ADC, I2C, SPI, and UART interfaces, making it easy to connect temperature, motion, and humidity sensors. It supports low power modes also: ESP32 Low Power Modes - The Engineering Projects
If you still want to look for an alternative, you can consider Nordic nRF52840. It is best for ultra-low-power Bluetooth LE devices. In case you want to make PCBs for your project, you can get some insight on the cost here: ALLPCB.com

Hi @Donald23173

From my messing around with it, the limited functionality is that the performance is a bit slower than say an S3 or WROOM, but it sips around 30mA at idle with no peripherals.

The charging is all automatic really, only thing from the power circuitry that is needed is the battery voltage taken as an analog measurement, otherwise whenever power is connected to the USBC on the board or the VIN pins the battery will start charging, otherwise it will operate off the battery.

For ~$10 its also one of the cheapest ESPs on the market.

1 Like

Have any of the Home Assistant / ESPHome gurus here had any luck with the Waveshare ESP32-C3 mini dev board
https://core-electronics.com.au/esp32-c3-mini-dev-board-iot-wifi-bluetooth.html and ESPHome?

I have a situation of the device is ā€˜onlineā€™ (ESPHome Builder page) yet it is ā€˜unavailableā€™ when I look at on the device page. It has a motion sensor attached and I get a ā€˜detected motionā€™ and ā€˜became unavailableā€™ for the exact same second I reboot it (although ā€˜onlineā€™).

Not had much luck searching the HomeAssistant website, tried numerous things unsuccessfully

  • board: esp32-c3-devkitc-02
  • static IP has been assigned
  • power_save_mode: none
  • fast_connect: true
    Beginning to wonder if the board is ā€˜too slowā€™ for my Wifi, but lower speed set to 1MB.

Any thoughts / ideas are much appreciated. Dave

1 Like

Hey @David173576,

I canā€™t speak specifically for that board but I have had similar issues using the Seeed Studio XIAO ESP32-C3

The built-in antenna on that board seemed to struggle to keep a solid connection with my home wifi and I imagine the waveshare alternative would suffer from a similar problem. That Xiao board comes with a small antenna to connect to the board to get around this issue which worked for me so maybe something similar would help out your ESP32-C3?

Other than that the only thing I can think of is maybe the board is rebooting unexpectedly due to insufficient power supply.

Keep us updated if you find any solutions to this!

1 Like

I should have a play with this, just to see how it works.
I assume the simplest fast setup would be onto a Pi for the home assist, then use the ESP HOME on the module ?
I have some stock ESP32 Wroom32, C3 and S3 modules I can test.

2 Likes

Hi @David173576

One thing to check is that your router is running at 2.4GHz with different SSIDs if it can run both a 5GHz and 2.4GHz network at the same time, in the past this has caused issues for me with devices showing as ā€œonlineā€ but being unreachable

2 Likes

Hi Samuel,

Thanks for the good ideas. The Waveshare ESP32-C3 has a small ceramic antenna so I donā€™t think itā€™s ā€˜extendableā€™. I was running it from about 10m through three internal walls, so moved it to about 3m from my Wifi router, with same result.

For power, itā€™s running from a USB-C that I charge my phone off, so no issue there.

I can do updates OTA, and it logs with connections and joining the network, so I know itā€™s transmitting, at least for confirming uploads. This is also the second board Iā€™ve tried, first time on a bread board, this time with the PIR motion detector soldered on.

Will let you know how I go. Cheers, Dave

Hi Michael,

A couple of steps involved for me at least. I have HomeAssistant running as itā€™s own OS on a RPi 5 with a SSD. ESPHome is then included as an integration. You can do it other ways with dockers and other stuff that is too Linux / software techie for me!

I started experimenting with a Pi Pico and MQTT but ESPHome seems a fair bit easier, when it works. Thereā€™s a bit of a process to sync an ESPHome Node / Device, setting fixed IPs in a .yaml file, etc, but once set up, making a a motion sensor is five or six lines of ā€˜codeā€™.

I already got a motion detector working with this ESP32-C6:

That processor is a bit of overkill and even ESPHome isnā€™t really set up for it, but I got it working, with the same PIR motion detector, so I know it can be done.

I thought Iā€™d try the simpler, ā€œbetter supportedā€ ESP32-C3, and thatā€™s when the trouble began!

Have fun. Cheers, Dave

Cheersā€¦ Im just playing atm so I can learn about it.
I got the Pi4 flashed with the OS and working.
I imported the ESPHome addon seems to work.
The funny thing was I flashed the ESPHome to the C3 but it failed to move onto wifi setup. HomeAssist found it and let me set the wifi ssid and password, so its now on wifi. I think it did it over bluetooth ???

And that raised my first question re your challenge. I wonder if its seeing it as a wifi AND bluetooth device; where BT my be out of range, but wifi is up and working ?

Im still working out whats what, and trying to work out how you know if a device is online or offline.

1 Like

Hi David
Just butting in here.
When you say things are ā€œsoldered onā€ be a bit careful here. That area around the ceramic antenna that has no copper ON BOTH SIDES should be treated as a ā€œno goā€ area. That is for everything including breadboard. Anything in the vicinity of this area on either side of the board witt affect the antenna operation. It would be struggling a bit as it is given its size without anything else adding to its lack of performance.
Cheers Bob

1 Like

Hi Dan, thatā€™s very interesting.

I have a Unifi UDR running 2.4GHz and 5GHz with the same SSID. A separate guest network SSID on 2.4GHz. Most things (other than laptops) are older and only connect on 2.4GHz.

Are you saying that the router tries to move the device up to the 5Ghz band, which it canā€™t do so it appears unreachable while still being on the 2.4GHz band? How did you fix it - using a 2.4GHz-only SSID?

Iā€™ve not had this happen with any other device, and not even sure how Iā€™d find out. Every time Iā€™ve done an OTA update of the ESP32, it works immediately, using 2.4GHz as the only band the device has.

So it doesnā€™t sound quite right but I think thereā€™s more to be explored in the router idea - thanks!

Cheers, Dave

Thanks Bob,

Iā€™ve soldered onto pins 2, 3 and 4, about as far away from the antenna as you can get, on a postage stamp. The circuit card is not enclosed in anything.

I know that it can transmit and receive successfully, otherwise it couldnā€™t do all of the handshakes for the over-the-air flash update - so Iā€™ve ruled out RF, especially now at 3m from the router.

Cheers, Dave

Hi Michael,

My router is only WiFi, not bluetooth. A future me will work out how to turn BLE off if it saves battery power, when I try adding a battery.

The initial connection is a bit fiddly. You may get a rejection because your LAN is not HTTPS, so you need to leave it attached to your computer and do the initial flash update via an ESPHome loader website. Once you get that initial connection you can do all further OTA updates directly.

For example, one of the suggested solutions was a fixed IP, which you canā€™t do with the initial ESPHome loader (maybe somewhere deep in the setup files, I donā€™t know). So once on the Wifi I update the .yaml file for a fixed IP, uploaded that to the flash memory, setthe IP on my router, and reboot the device - no problem. Likewise the ā€˜binary sensorā€™ motion detector lines are all added after the initial flash load by OTA update.

Itā€™s possibly not letting you do the initial load without https?

Cheers, Dave

Sorry, missed your last point.

Click on ESPHome builder. The device should appear on a tile and itā€™ll say online or offline in the top right. (you may need to ā€˜add deviceā€™ the first time)

Also, you can go to settings ā†’ devices and services ā†’ devices (up the top), find the device in the list and click on its name. That will get you to its Device Info page. On the right there is a logbook, which should identify when it came online or ā€˜became unavailableā€™.

cheers, Dave

Hi @David173576

Personally I run 2 separate SSIDs (eg. Dans_wifi_2.4GHz and Dans_wifi_5GHz) since Iā€™ve done this I havenā€™t had any issues, your results may vary.

1 Like