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

ESP32 and SIM900A IoT Meter with LCD Display and Relay Control

View and Edit Project In Cirkit DesignerImage of ESP32 and SIM900A IoT Meter with LCD Display and Relay Control

Circuit Documentation

Summary

This document provides a detailed overview of a circuit that includes an ESP32 microcontroller, a toggle switch, a 16x2 I2C LCD, a 5V 2-relay module, a SIM900A GSM module, a 5V battery, a 12V power supply, and a resistor. The circuit is designed to interface these components to create an IoT meter project.

Component List

  1. Toggle Switch

    • Description: A simple toggle switch used to control the circuit.
    • Pins: Vcc, Sig, Gnd
  2. ESP32 (30 pin)

    • Description: A powerful microcontroller with built-in Wi-Fi and Bluetooth capabilities.
    • Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, Vin, D23, D22, TX0, RX0, D21, D19, D18, D5, TX2, RX2, D4, D2, D15, 3V3
  3. Resistor

    • Description: A resistor used to limit current in the circuit.
    • Pins: pin1, pin2
    • Properties: Resistance: NaN Ohms
  4. 5V 2-Relay JD-VCC

    • Description: A relay module used to control high voltage devices.
    • Pins: JD-VCC, VCC, GND, IN1, IN2, NO, COM, NC
  5. 5V Battery

    • Description: A 5V battery used to power the circuit.
    • Pins: positive, negative
  6. 16x2 I2C LCD

    • Description: A 16x2 character LCD with I2C interface.
    • Pins: GND, VCC, SDA, SCL
  7. 12V Power Supply

    • Description: A 12V power supply used to power the SIM900A module.
    • Pins: +, -
  8. SIM900A

    • Description: A GSM module used for communication.
    • Pins: GND, DB9-3 (RXD), DB9-2 (TXD), 5V, 3VR, 5VR, 3VT, 5VT, VCC, Ring, RESTART, RESET, STATUS

Wiring Details

Toggle Switch

ESP32 (30 pin)

Resistor

5V 2-Relay JD-VCC

5V Battery

16x2 I2C LCD

12V Power Supply

SIM900A

Code Documentation

ESP32 Code

#include <LCD-I2C.h>

LCD_I2C lcd(0x27, 16, 2); // Default address of most PCF8574 modules, change according

void setup() {
    // If you are using more I2C devices using the Wire library use lcd.begin(false)
    // this stop the library(LCD-I2C) from calling Wire.begin()
    lcd.begin();
    lcd.display();
    lcd.backlight();
}

void loop()
{
    lcd.print("IOT METER PROJECT"); // You can make spaces using well... spaces
    lcd.setCursor(5, 1); // Or setting the cursor in the desired position.
    lcd.print(" TEST!");
    delay(500);

    // Flashing the backlight
    for (int i = 0; i < 5; ++i)
    {
        lcd.backlight();
        delay(50);
        lcd.backlightOff();
        delay(50);
    }

    lcd.backlight();
    lcd.clear();
    delay(500);
}

5V 2-Relay JD-VCC Code

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

}

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

}

16x2 I2C LCD Code

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

}

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

}

This documentation provides a comprehensive overview of the circuit, including component descriptions, wiring details, and the code used in the microcontrollers.