"In reality, you don’t need the power of a Raspberry Pi to handle simple embedded applications like an IoT sensor or web-connected LED.
The $5 NodeMCU board, which has built-in Wi-Fi, onboard flash storage, and is equally as easy to program as a Pi,
could handle the job elegantly. It includes a web server library if you really need one, or you can use the slimmed down MQTT-based protocol."
makeuseof.com/tag/stop-using-raspberry-pi-everything/