Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Arduino UNO Controlled SMS Sender with I2C LCD Feedback

Image of Arduino UNO Controlled SMS Sender with I2C LCD Feedback

Circuit Documentation

Summary of the Circuit

This circuit is designed to interface an Arduino UNO with a SIM900A GSM module and an I2C LCD 16x2 screen. The purpose of the circuit is to send an SMS message when a toggle switch is pressed and display a confirmation message on the LCD screen. The Arduino UNO serves as the central controller, managing the communication between the SIM900A module and the LCD screen. A resistor is used in conjunction with the toggle switch to form a simple input circuit for the Arduino. The DC Source provides a stable 5V supply to the components that require it.

Component List

Arduino UNO

  • Microcontroller board based on the ATmega328P
  • Provides digital and analog I/O pins
  • Used for controlling the SIM900A module and the I2C LCD screen

Toggle Switch

  • A simple switch that connects or disconnects the circuit
  • Used to trigger the sending of an SMS message

I2C LCD 16x2 Screen

  • An alphanumeric liquid crystal display
  • Communicates with the Arduino via the I2C protocol
  • Used to display the status of the SMS message

Resistor

  • A passive two-terminal electrical component
  • Resistance: 200 Ohms
  • Used to form a voltage divider or pull-up/pull-down for the toggle switch

DC Source 5V

  • Provides a 5V power supply
  • Powers the Arduino UNO, LCD screen, and other 5V components

SIM900A

  • GSM/GPRS module
  • Used for sending SMS messages

Sim800l

  • Another GSM/GPRS module
  • Not directly used in this circuit according to the provided net list

Wiring Details

Arduino UNO

  • GND connected to SIM900A GND
  • D4 connected to I2C LCD SCL
  • D3 connected to I2C LCD SDA
  • D2 connected to one end of the Resistor and Toggle Switch Vcc
  • D1 (TX) connected to SIM900A DB9-3 (RXD)
  • D0 (RX) connected to SIM900A DB9-2 (TXD)

Toggle Switch

  • Vcc connected to one end of the Resistor and Arduino UNO D2
  • Sig connected to I2C LCD GND and DC Source 5V GND

I2C LCD 16x2 Screen

  • SCL connected to Arduino UNO D4
  • SDA connected to Arduino UNO D3
  • GND connected to Toggle Switch Sig and DC Source 5V GND
  • VCC (5V) connected to the other end of the Resistor and DC Source 5V VCC

Resistor

  • One end connected to Toggle Switch Vcc and Arduino UNO D2
  • The other end connected to I2C LCD VCC (5V) and DC Source 5V VCC

DC Source 5V

  • VCC connected to I2C LCD VCC (5V) and one end of the Resistor
  • GND connected to I2C LCD GND and Toggle Switch Sig

SIM900A

  • GND connected to Arduino UNO GND
  • DB9-3 (RXD) connected to Arduino UNO D1 (TX)
  • DB9-2 (TXD) connected to Arduino UNO D0 (RX)

Documented Code

/*
 * This Arduino sketch interfaces with a SIM900A module and an I2C LCD screen.
 * When the toggle switch is pressed, the Arduino sends a message via the SIM900A
 * and displays a message on the I2C LCD screen.
 */

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Pin definitions
const int switchPin = 2;
const int lcdSdaPin = 3;
const int lcdSclPin = 4;
const int sim900RxPin = 1;
const int sim900TxPin = 0;

// Initialize the LCD
LiquidCrystal_I2C lcd(0x27, 16, 2);

void setup() {
  // Initialize serial communication for SIM900A
  Serial.begin(9600);
  // Initialize the LCD
  lcd.begin();
  lcd.backlight();
  // Set the switch pin as input
  pinMode(switchPin, INPUT);
}

void loop() {
  // Check if the switch is pressed
  if (digitalRead(switchPin) == HIGH) {
    // Send message via SIM900A
    sendSMS();
    // Display message on LCD
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("Message Sent");
    delay(2000); // Wait for 2 seconds
  }
}

void sendSMS() {
  Serial.println("AT+CMGF=1"); // Set SMS mode to text
  delay(1000);
  Serial.println("AT+CMGS=\"+1234567890\""); // Replace with recipient's number
  delay(1000);
  Serial.print("Hello, this is a test message."); // Message content
  delay(1000);
  Serial.write(26); // ASCII code for CTRL+Z to send the message
  delay(1000);
}

This code is designed to run on the Arduino UNO and handles the logic for reading the toggle switch state, sending an SMS message through the SIM900A module, and displaying a confirmation message on the I2C LCD screen.