Close
0%
0%

Send temperature with WEMOS D1 mini to MQTT broker

A temperature sensor (WEMOS D1 mini combined with DHT shield) programmed with mongoosOS to send data to a mqtt broker

Similar projects worth following
In this project i used a WEMOS D1 mini with a DHT shield to send the temperature and humidity to a MQTT topic.

Connect the two pins RST and D0 to activate wake up from deep sleep. On my WEMOS D1 mini (V3.0.0) this is easily possible if you connect the two solder pads marked with sleep.

From now on (deep sleep on board activated) you need to connect GND and D3 (GPIO0) to program the D1 mini.

After you have connected the pins you can flash the script (github repository) onto the D1 mini.

To run the script  remove the connection between GND and D3 and assemble DHT Shield to D1 mini.

Connect D1 mini to a separate power source. If you use a power bank please be aware that a lot of power banks switch off during D1 mini is in deep sleep and no wake up is possible.

After the script had run your the configurated mqtt topic (e.g. /home/sensors/room) will have received a jsonified string like this:

{"humidity":46.400002,"temperature":21.799999}

  • 1
    Clone github repository
  • 2
    Adapt configuration

    Adapt the cloned mos.yml and insert the following information according to your wishs

    • WIFI SSID and password
    • MQTT broker address
    • MQTT topic the data should be sent to
    • Time for deep sleep
  • 3
    Run mos build

    Run the mongooseOS build script. For this change to the folder where the cloned files can be found.

    Run in terminal

    mos build

View all 4 instructions

Enjoy this project?

Share

Discussions

difitux wrote 02/25/2018 at 16:36 point

This is my first project on hackaday. Please help me to improve the instruction and post your feedback. If you are interested i can add also and instruction to insert the sensor data to an influxdb.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates