1.9 KiB
1.9 KiB
Muraqib
Temperature and humidity sensor that sends its data via MQTT. The project is implemented using a Wemos D1 mini board with the following components:
- DHT22 temperature and humidity sensor
- Battery shield
- 3.7V 1000mAh Lithium battery
The sensor captures the data every 5 minutes and sends it to a MQTT broker and then enters deep sleep, it is important to save power as the device runs off a battery. This sensor is part of a project to grow mushrooms in a controlled environment.
Pinout of the board

Configuration
In the data directory, there is a JSON file that allows the configuration of multiple values:
- ssid: WiFi network name
- psk: WiFi password
- mqtt_host: IP address of the MQTT broker
- mqtt_user: username that has write access on the MQTT broker
- mqtt_password: password for the user that has write access on the MQTT broker
- mqtt_port: port used by the MQTT broker
- mqtt_topic: channel name
- device_id: unique identifier of the sensor
- sleep_time: time interval between each data transmission
- connection_attempts: maximum connection attemps to the network
The file needs to be renamed to config.json
Deployment
The software uses the Arduino framework and the development environment of PlatformIO, which offers better tooling than the official Arduino IDE.
- Upload the configuration file to the board:
pio run -t uploadfs
- Compile the project
pio run -t compile
- Upload firmware
pio run -t upload