Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino Nano and ESP8266 Wi-Fi Grain Moisture Monitor with LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino Nano and ESP8266 Wi-Fi Grain Moisture Monitor with LCD Display

Circuit Documentation

Summary

This circuit is designed to monitor grain moisture using an AHT10 sensor and display the data on a 16x2 Serial Enabled LCD. Additionally, the data is sent to a remote server via an ESP8266-01 WiFi module. The circuit is powered by a Step Down Module and a Mini 360 Buck Converter, with control provided by an Arduino Nano.

Component List

  1. Arduino Nano

    • Description: A small, complete, and breadboard-friendly board based on the ATmega328P.
    • Pins: D1/TX, D0/RX, RESET, GND, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11/MOSI, D12/MISO, VIN, 5V, A7, A6, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13/SCK
  2. WiFi Module ESP8266-01

    • Description: A self-contained SoC with integrated TCP/IP protocol stack that can give any microcontroller access to your WiFi network.
    • Pins: RX, GPIO0, GPIO2, GND, +3V3, Reset, CH-PD Chip power down, TX
  3. Serial Enabled 16x2 LCD - Black on Green 5V

    • Description: A 16x2 character LCD with a serial interface.
    • Pins: GND, RX, VDD, RS, R/W, E, DB4, DB5, DB6, DB7, BL+, PGM, PGC, PGD, VPP
  4. Step Down Module

    • Description: A module that steps down voltage from 24V to 5V.
    • Pins: 24v IN+, GND, 12v IN+, 5v OUT+, 5v OUT-
  5. Mini 360 Buck Converter

    • Description: A small, efficient buck converter that steps down voltage.
    • Pins: IN-, OUT-, OUT+, IN+
  6. AHT10

    • Description: A high-precision, fully-calibrated, digital temperature and humidity sensor.
    • Pins: Vcc, Gnd, SCL, SDA
  7. Rocker Switch

    • Description: A simple on/off switch.
    • Pins: 1, 2

Wiring Details

Arduino Nano

WiFi Module ESP8266-01

Serial Enabled 16x2 LCD

Step Down Module

Mini 360 Buck Converter

AHT10

Rocker Switch

Documented Code

Arduino Nano Code

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

AHT10 Code

/*
 * Grain Moisture Monitor Circuit
 * Components: AHT10, Arduino Nano, Step Down Module, Rocker Switch,
 * ESP01, Mini 360 Buck, 16x2 Serial Enabled LCD
 * Function: Reads moisture data from AHT10 sensor and displays it on
 * the 16x2 LCD. Sends data to a remote server via ESP8266-01.
 */

#include <Wire.h>
#include <AHT10.h>
#include <SoftwareSerial.h>

AHT10 aht10;
SoftwareSerial espSerial(2, 3); // RX, TX for ESP8266

void setup() {
  Serial.begin(9600);
  espSerial.begin(9600);
  Wire.begin();
  if (!aht10.begin()) {
    Serial.println("AHT10 not detected. Check wiring.");
    while (1);
  }
  Serial.println("AHT10 detected.");
  espSerial.println("AT");
  delay(1000);
  espSerial.println("AT+CWMODE=1");
  delay(1000);
  espSerial.println("AT+CWJAP=\"SSID\",\"PASSWORD\"");
  delay(5000);
}

void loop() {
  float humidity = aht10.readHumidity();
  float temperature = aht10.readTemperature();
  Serial.print("Humidity: ");
  Serial.print(humidity);
  Serial.print(" %\t");
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" C");
  espSerial.print("AT+CIPSTART=\"TCP\",\"<server_ip>\",<port>");
  delay(2000);
  String httpRequest = "GET /update?humidity=" + String(humidity) +
                      "&temperature=" + String(temperature) + " HTTP/1.1\r\n" +
                      "Host: <server_ip>\r\n\r\n";
  espSerial.print("AT+CIPSEND=");
  espSerial.println(httpRequest.length());
  delay(1000);
  espSerial.print(httpRequest);
  delay(2000);
  espSerial.println("AT+CIPCLOSE");
  delay(1000);
  delay(10000); // Delay between readings
}