Skip to content
A simple Temperature and Humidity Sensor reporting via MQTT
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
Case With Sensor.jpg
Pin Connections.png
Sensor In Printed Case.jpg


A simple Temperature and Humidity Sensor reporting via MQTT

This sample code uses AM2301 library It reports the temperature and humidity every 5 seconds, the temperature is a mean value sampled 10 times. Therefore it takes 50 seconds to report the first value. This helps smooth out the noise from the AM2301 sensor. The Wifi user name and password is set in the Wifi_Settings.h file and the MQTT broker etc in the MQTT_settings.h file. A watchdog is enabled that will re-boot the sensor if the remote PC does not pole the sensor at least once every 20 minutes, disable this it not required.

A simple case for this project

I have a few ready made PCB's here

You can’t perform that action at this time.