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

Arduino UNO and SIM900A Based Smart Home Automation with GSM and I2C LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino UNO and SIM900A Based Smart Home Automation with GSM and I2C LCD Display

Circuit Documentation

Summary

This circuit involves an Arduino UNO microcontroller interfacing with a SIM900A GSM module, a 5V relay, a 16x2 I2C LCD, a rocker switch, an analog meter, and a bulb. The circuit is designed to control the bulb using the relay, display information on the LCD, and communicate via the GSM module. The analog meter is used to measure the AC supply.

Component List

  1. Arduino UNO

    • Description: A microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  2. SIM900A

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

    • Description: An electromechanical switch used to control high voltage devices.
    • Pins: Normally Open, Common terminal, Normally Closed, In, GND, VCC
  4. 16x2 I2C LCD

    • Description: A 16x2 character LCD display with I2C interface.
    • Pins: GND, VCC, SDA, SCL
  5. Rocker Switch

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

    • Description: An AC power supply.
    • Pins: +ve, -ve
  7. Analog Meter

    • Description: A meter to measure electrical parameters.
    • Pins: in +, IN -, Out +, Out -
  8. Bulb

    • Description: A simple light bulb.
    • Pins: GND, power
  9. GND

    • Description: Ground connection.
    • Pins: GND

Wiring Details

Arduino UNO

SIM900A

5V Relay

16x2 I2C LCD

Rocker Switch

Analog Meter

Bulb

Code Documentation

Arduino UNO Code

#include <SoftwareSerial.h>

// Define the pins for the GSM module
SoftwareSerial gsm(10, 11); // RX, TX

void setup() {
  // Initialize the hardware serial port
  Serial.begin(9600);
  
  // Initialize the software serial port for GSM module
  gsm.begin(115200); // Ensure this baud rate matches the A7670C module's requirements
}

void loop() {
  // Check if data is available from the GSM module
  if (gsm.available()) {
    // Read data from GSM module and send it to the Serial Monitor
    Serial.write(gsm.read());
  }
  
  // Check if data is available from the Serial Monitor
  if (Serial.available()) {
    // Read data from Serial Monitor and send it to the GSM module
    gsm.write(Serial.read());
  }
}

This code initializes the Arduino UNO to communicate with the SIM900A GSM module using software serial communication. The data received from the GSM module is sent to the Serial Monitor and vice versa.