NodeMCU issues
June 07, 2024NodeMCU is an affordable solution for connecting devices to the internet via Wi-Fi. It comes with built-in Wi-Fi and numerous pins, allowing you to connect a variety of components to collect data or control devices.
I opted to create weather monitoring devices to track soil humidity and anticipate frost, which could harm my plants. Initially, I’m focusing on a few simple parameters to establish a minimum viable product (MVP).
R&D of Weather Device
The research phase is crucial. I explored several online ideas for constructing a weather station, ranging from complex to simple designs. I chose to incorporate the following elements:
- Temperature,
- Humidity,
- Soil moisture,
- Atmospheric pressure.
I found a sensor that measures temperature, humidity, and pressure, and another that only measures soil moisture. This allows me to test two different sensors, providing a more complex setup without being overly complicated. For power, I’ve temporarily settled on 3.7V rechargeable batteries.
Admittedly, my research was brief and superficial. I drew inspiration from a few concepts and…
Problems with Insufficient Research
One evening, I hastily placed an order based on memory rather than a detailed list. This led to the first issue: ordering incorrect items, such as the BMP280 instead of the BME280, which lacks a humidity sensor.
My research was based on projects that utilized USB-powered devices, and I didn’t investigate battery compatibility thoroughly enough.
Powering NodeMCU
There are several ways to power a NodeMCU. The most common is via USB, which is used in 90% of examples. However, when using batteries, you face two alternatives. One is to connect directly to the 3.3V pins, but the voltage must be very close to 3.3V. My 3.7V batteries could reach ~4.2V when fully charged and drop below 3V when discharged, which could damage the device or be insufficient. A voltage converter is necessary to maintain a steady 3.3V.
Another option is to use the VIN pin, which can handle a wider voltage range from 5V to 12V. This would be ideal, but my single 3.7V battery doesn’t provide enough power.
In either case, the voltage is either too low or too high.
Fixing Issues with a “Tape”
I resolved the power issue by connecting two batteries in series, yielding approximately 7-8V, which I can connect to the VIN pin. This solution is not ideal, but it is functional for the time being.
I’ve chosen to use the BMP280 sensor. Since this is a proof of concept, I can leave measuring air humidity for now.
My advice
- Always make notes. Some LLM can rewrite them later to make it beautiful, so just drop links, ideas, unrelated notes into some text file.
- Research is more important than development. It saves you time and money. Literally, I would have to wait for new things to arrive.