Things used in this project

Hardware components:
D1 mini
Everything ESP Wemos D1 Mini
×1
Nanomesher Human Machine Interface
×1
Sensirion SHT31
×1
Resistor 4.7k Ohm
×2
11026 02
Jumper wires (generic)
×1
Software apps and online services:
Ide web
Arduino IDE

Schematics

WeatherSender Schematic
A very simple weather logger which uses SHT3x sensor with i2c interface. The Arduino software will read data and send the data to Nanomesher HMI via HTTP
Weather sensor bb a0pc5m67fc

Code

WeatherSenderArduino
Arduino code for reading Humidity and Temperature from SHT31 and update data on the display.

Before using the code, change:
- SSID / PASSWORD
- ip address in http://192.168.1.12/TextSetText?p=0&n=line1&v=
- line1 - line4 depending on location of the sensor in http://192.168.1.12/TextSetText?p=0&n=line1&v=
#include <Arduino.h>

#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <Wire.h>
#include "Adafruit_SHT31.h"
#include <ESP8266HTTPClient.h>

#define USE_SERIAL Serial

ESP8266WiFiMulti WiFiMulti;

float t = 0;
float h = 0;


Adafruit_SHT31 sht31 = Adafruit_SHT31();

void setup() {

    USE_SERIAL.begin(115200);
   // USE_SERIAL.setDebugOutput(true);

    USE_SERIAL.println();
    USE_SERIAL.println();
    USE_SERIAL.println();

    for(uint8_t t = 4; t > 0; t--) {
        USE_SERIAL.printf("[SETUP] WAIT %d...\n", t);
        USE_SERIAL.flush();
        delay(1000);
    }

    WiFiMulti.addAP("SSID", "PASSWORD");

}

void loop() {
    // wait for WiFi connection
    if((WiFiMulti.run() == WL_CONNECTED)) {

        t = sht31.readTemperature();
        h = sht31.readHumidity();

        
        char temp[10];
        dtostrf(t,1,1,temp);

        char humid[10];
        dtostrf(h,1,1,humid);
        
        String url = "http://192.168.1.12/TextSetText?p=0&n=line1&v=";
        
        HTTPClient http;

        USE_SERIAL.print("[HTTP] begin...\n");
        http.begin(url + temp + "c " + humid + "%"); //HTTP

        USE_SERIAL.print("[HTTP] GET...\n");
        // start connection and send HTTP header
        int httpCode = http.GET();

        // httpCode will be negative on error
        if(httpCode > 0) {
            // HTTP header has been send and Server response header has been handled
            USE_SERIAL.printf("[HTTP] GET... code: %d\n", httpCode);

            // file found at server
            if(httpCode == HTTP_CODE_OK) {
                String payload = http.getString();
                USE_SERIAL.println(payload);
            }
        } else {
            USE_SERIAL.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str());
        }

        http.end();
    }

    delay(10000);
}

Credits

Logo full cwonpu2gn6
Nanomesher

We are a new startup developing IOT products.

Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Wireless Attendance System Using NodeMCU with MySQL
Intermediate
  • 563
  • 9

Protip

Here we are going to interface NodeMCU with RFID-RC522 and getting data to phpMyAdmin database.

Attendance System Using MYSQL with Raspberry and RFID-RC522
Intermediate
  • 1,136
  • 9

Protip

Here we are taking data from RFID reader which is connected to Node MCU V3 and saving it to MYSQL database running on Raspberry Pi.

IoT Pet Feeder
Intermediate
  • 6,225
  • 36

Full instructions

Use circuito.io to build a smart food dispenser for your pet controlled directly from your phone.

Build a Tank Volume Reader in Under $30 using ESP32
Intermediate
  • 721
  • 6

Full instructions

Build a DIY Level Sensor - tank monitor for volume, temperature, and humidity. Prototype for under $30.

NodeMCU Announcer for Domoticz
Intermediate
  • 77
  • 0

Full instructions

Status announcer for Domoticz using the Raspberry Pi and NodeMCU.

MATCHBOX LEDS WITH ESP8266 IoT
Intermediate
  • 39
  • 0

Protip

One IoT device controlled by wifi inside a Matchbox -Battery included!!!

ProjectsCommunitiesTopicsContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login