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

Traffic Monitor- Monitors traffic on the Go
Intermediate
  • 38
  • 2

Full instructions

The device uses color indication to display traffic on the road you are driving or you have selected.

Magic VR Hat
Intermediate
  • 675
  • 8

Wear the hat, get transported to different 360 VR experience.

From BT to WiFi: Creating WiFi Controlled Arduino Robot Car
Intermediate
  • 443
  • 5

Protip

NodeMCU ESP8266 in access point mode: the simplest way to make Wi-Fi controlled Robot Car from Bluetooth Arduino Robot Car + Android App.

DIY Complete Philips Hue Home Automation
Intermediate
  • 1,940
  • 5

Full instructions

This project emulates a Philips Hue Bridge that is able to control multiple types of lights.

ESP8266 - PIR Motion sensor detection
Intermediate
  • 51
  • 1

Full instructions

In this project, we are looking to detect motion (change) not average IR levels.

Race Car Dashboard (Online Connectivity)
Intermediate
  • 2,075
  • 8

The project was initially designed to acquire real-time race car data for BAJA-SAE competitions.

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaFree StoreBlog