Hardware Selection
I considered several options for this project: Arduino, Raspberry Pi, and the ESP32.
Coming from a background with PIC microcontrollers, my first instinct was Arduino. However, I wasn't keen on going "low-level" by managing registers in Assembly or diving back into C/C++. Furthermore, Arduino would require an external Wi-Fi module, adding complexity to the build. Perhaps I'll revisit Arduino for future projects where RAM and processing speed are more critical.
Next, I considered the Raspberry Pi. As a full-fledged computer, it felt like overkill for a simple temperature monitor.
Ultimately, the ESP32 emerged as the perfect compromise. It is significantly cheaper than a Raspberry Pi, includes an onboard Wi-Fi module, and supports MicroPython, which allows for faster, higher-level development. While it does require some initial setup to flash the MicroPython firmware, the ease of use makes it worth the effort.
For the sensor, I chose the BME280 for its affordability and its ability to measure temperature, humidity, and atmospheric pressure in a single package.
Hardware Simulation
A quick search led me to the Wokwi simulator, which offers a capable free-to-use version accessible directly via the browser.
The process wasn't entirely seamless; the standard component library lacks the BME280. To move forward, I had to develop a custom chip to simulate the sensor's behavior. While this custom implementation is a simplified version of the physical sensor, it allowed me to draft the logic and successfully test publishing messages via MQTT.
Next Steps (TODO)
Once the physical hardware arrives, the roadmap is as follows:
Flash the MicroPython firmware onto the ESP32.
Refine the code to ensure compatibility with the physical BME280 sensor.
Implement error handling for potential sensor failures or wiring issues.
Comments
Post a Comment