Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Intelligent Letter Box using Arduino and GSM

By Salman Khan September 23, 2014

 

In the days of technology postman still comes to our house for delivering the letters, couriers and parcels. Because some things like courier, parcels can’t sends via email and by using any other electronic media. So for getting notification of our letter delivery in our mail box here we design an intelligent mail/letter box, which provides notification of delivery of letters in our mail box via message to our mobile phones.

Prototype of Arduino and GSM GPRS Modem based Intelligent Letter Box

Fig. 1: Prototype of Arduino and GSM GPRS Modem based Intelligent Letter Box

Image of box used as letter box in the prototype model

Fig. 2: Image of box used as letter box in the prototype model

In this system an IR pair is used for sensing incoming letter in mail box and a GSM module for sending message to our phone. And a 16×2 LCD display for displaying time and letter box status (empty or not), delivery time, date and a real time clock circuit also is used in this system. And a LED is also configured for indication for letter box empty or not. When post man or any other person insert any letter in mail box IR sensor sense the letter (obstacle) and then Arduino sends commands to GSM module for sending notification message to specified phone number. Now we can collect our letter at that time if possible. At the time we collect letters we have to press a reset button which clears all the entries of letters.And in this system an additional feature is also added in whichdata will not lose after electricity failure. Because in this system Arduino’s EEPROM is used for save/store the delivery time and dates. This system is designed to save only 6 delivery reports of letters. But it may be extend. You can try it yourself. And enjoy this at your home or college. It is assumed that the reader has gone through the project how to get started with the arduino and Interface LCD with arduino.

Block Diagram of Arduino and GSM GPRS Modem based Intelligent Letter Box

Fig. 3: Block Diagram of Arduino and GSM GPRS Modem based Intelligent Letter Box

Circuit Description

Circuit of this intelligent mail/letter box system is very common and easy. Here four major part in this system

1.      Sensing circuit: sensing circuit is a comparator circuit build by using lm358 ic. Output of comparator is directly connected to the digital pin number 3.In this circuit both of IR transmitter and receiver places in letter box in same direction when any obstacle or letter inserted in to the mail box comparator detects the obstacle and send signal to Arduino.

Image of IR Transmitter and Receiver Module used in Intelligent Letter Box

Fig. 4: Image of IR Transmitter and Receiver Module used in Intelligent Letter Box

Image of LM358 IC based Sensor Module used in Intelligent Letter Box

Fig. 5: Image of LM358 IC based Sensor Module used in Intelligent Letter Box

 

2.      Controller Circuit. After getting signal from comparator Arduino sends command to GSM module for sending a notification message to specified number.

Image of Arduino based Controller Circuit used in Intelligent Letter Box

Fig. 6: Image of Arduino based Controller Circuit used in Intelligent Letter Box

Image of SMS alert received from Intelligent Letter Box

Fig. 7: Image of SMS alert received from Intelligent Letter Box

 

3.      GSM module: Rx and Tx pins of GSM module are directly connected with Tx and Rx pin of Arduino respectively. And ground pins of both modules should be connected with each other.

Image of GSM GPRS Module used in Intelligent Letter Box

Fig. 8: Image of GSM GPRS Module used in Intelligent Letter Box

 

4.      Real Time Clock: this RTC clock is used here for running the time and when delivery if letter occurred, letter delivery time of RTC is saved in EEPROM of Arduino.

Image of RTC Module used in Intelligent Letter Box

Fig. 9: Image of RTC Module used in Intelligent Letter Box

Components & Programming

Program description: program of this intelligent mail box system is simple. In this we configured GSM module in text mode by using command below:

Screenshot of Arduino Code used to send SMS alert by Intelligent Letter Box

Fig. 10: Screenshot of Arduino Code used to send SMS alert by Intelligent Letter Box

And delivery time and dates are saved in arduino’s EEPROM by using EEPROM Function given below:

Screenshot of Arduino Code used to store time of letter dropped on EEPROM

Fig. 11: Screenshot of Arduino Code used to store time of letter dropped on EEPROM

 

 

Components Used:

1.      Arduino

2.      GSM Module

3.      IR pair

4.      Lm358

5.      DS1307 RTC

6.      16×2 LCD

7.      10 K pot

8.      10 K resistor

9.      220 ohm resister

10.  Connecting wires

11.  Power supply

12.  SIM card

Project Source Code

###


#include<LiquidCrystal.h>
#include <Wire.h>
#include <RTClib.h>
#include<EEPROM.h>
 
LiquidCrystal lcd(7, 6, 5, 4, 9, 8);
RTC_DS1307 RTC;
 
#define sensor 2
#define indication 13
 
int HOUR, MINUTE, SECOND, DATE, MONTH, YEAR;
int leter,year1,year2;
 
int add[6][7]={   
                 {0,0,0,0,0,0,0},
                 {10,11,12,13,14,15,16},
                 {17,18,19,20,21,22,23},
                 {24,25,26,27,28,29,30},
                 {31,32,33,34,35,36,37},
                 {38,39,40,41,42,43,44} 
              };
 
 
void setup() 
{
  lcd.begin(16,2);
  Serial.begin(9600);
  Wire.begin();
  RTC.begin();
  pinMode(sensor, INPUT);
  lcd.setCursor(0,0);
 lcd.print("  Intelligent   ");
 lcd.setCursor(0,1);
 lcd.print(" Letter Box by  ");
 delay(2000);
 lcd.clear();
 lcd.setCursor(0,0);
 lcd.print("  Saddam Khan   ");
 lcd.setCursor(0,1);
 lcd.print("Engineers Garage");
 delay(2000);
// attachInterrupt(0, sense, LOW);
 attachInterrupt(1, reset, LOW);
 
 if(!RTC.isrunning())
 {
 RTC.adjust(DateTime(__DATE__,__TIME__));
 }
  
}
 
void loop() 
{
   while(1)
   {
    leter=EEPROM.read(9);
    for(int i=0;i<100;i++)
     {
      time();
       if(digitalRead(sensor)==0){sense();delay(5000);}
        delay(10);
     }
 
    if(leter==0)
    {
     digitalWrite(indication, LOW);
     lcd.setCursor(0,0);
     lcd.print("Your Letter Box ");
     lcd.setCursor(0,1);
     lcd.print("   is Empty     ");
     check();
    }
     
     else
     {
      digitalWrite(indication, HIGH);
      inbox();
     }
}
}
 
 
void send_sms()
{
    Serial.println("AT+CMGF=1");
    delay(10);
    Serial.println("AT+CMGS="9610126059"");
    delay(10);
    Serial.println("You Have Letter in your Letter Box.");
    Serial.println("Please Check it Out. ");
    Serial.println("Have a Good Day ");
    Serial.write(26);
}
 
void reset()
{
  leter=0;
  EEPROM.write(9, 0);
  digitalWrite(13,LOW);
}
 
void time()
{
  DateTime now = RTC.now();
    lcd.clear();
 lcd.setCursor(0,0);
 lcd.print("Time:");
 lcd.setCursor(6,0);
 lcd.print(HOUR=now.hour(),DEC); 
 lcd.print(":");
 lcd.print(MINUTE=now.minute(),DEC);
 lcd.print(":");
 lcd.print(SECOND=now.second(),DEC);
 lcd.setCursor(0,1);
 lcd.print("Date: ");
 lcd.print(DATE=now.day(),DEC);
 lcd.print("/");
 lcd.print(MONTH=now.month(),DEC);
 lcd.print("/");
 lcd.print(YEAR=now.year(),DEC);
 delay(10);
}
 
void sense()
{
  digitalWrite(indication, HIGH);
  time();
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("   New Letter   ");
  lcd.setCursor(0,1);
  lcd.print("   Delivered    ");
  send_sms();
  delay(2000);
  delay(10);
  leter=EEPROM.read(9);
  leter=leter+1;
  EEPROM.write(9, leter);
  EEPROM.write(add[leter][0], HOUR);
  EEPROM.write(add[leter][1], MINUTE);
  EEPROM.write(add[leter][2], SECOND);
  EEPROM.write(add[leter][3], DATE);
  EEPROM.write(add[leter][4], MONTH);
  year1=YEAR/100;
  year2=YEAR%100;
  EEPROM.write(add[leter][5], year1);
  EEPROM.write(add[leter][6], year2);
}
 
void check()
{
   for(int i=0;i<100;i++)
      {
         if(digitalRead(sensor)==0)
          {
            sense();
            delay(5000);
          }
          delay(20);
      }
}
 
void inbox()
{
   lcd.clear();
   lcd.setCursor(0,0);
   leter = EEPROM.read(9);
    lcd.print(leter);
    lcd.print("  Letters in Ur");
    lcd.setCursor(0,1);
    lcd.print("   Letter box");
   check();
   lcd.clear();
   lcd.setCursor(0,0);
   lcd.print("Please check it ");
   lcd.setCursor(0,1);
   lcd.print("It may be Urgent");
   check();
   lcd.setCursor(0,0);
   lcd.clear();
   
   for(int i=1;i<leter+1;i++)
   {
      lcd.clear();
      lcd.print("Delivery Time ");
      lcd.print(i);
      lcd.setCursor(0,1);
      lcd.print(EEPROM.read(add[i][0]));
      lcd.print(":");
      lcd.print(EEPROM.read(add[i][1]));
      lcd.print(":");
      lcd.print(EEPROM.read(add[i][2]));
      check();
      lcd.setCursor(0,0);
      lcd.clear();
      lcd.print("Delivery Date ");
      lcd.print(i);
      lcd.setCursor(0,1);
      lcd.print(EEPROM.read(add[i][3]));
      lcd.print("/");
      lcd.print(EEPROM.read(add[i][4]));
      lcd.print("/");
      lcd.print(EEPROM.read(add[i][5]));
      lcd.print(EEPROM.read(add[i][6]));
      Serial.print(EEPROM.read(add[i][5]));
      Serial.print(YEAR);
        check();
}
}

 

 

 

###

 

 


Circuit Diagrams

Circuit-Diagram-Arduino-GSM-GPRS-Modem-Based-Intelligent-Letter-Box

Project Video


Filed Under: Electronic Projects
Tagged With: Arduino, gsm, letter box
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Permittivity and Permealibility in CST
  • Testing 5kW Grid Tied inverter over 200-253VAC
  • Single ended measuring ports and balanced antenna
  • Thermal modelling of repetitive power pulse
  • Redundant XORs

RSS Electro-Tech-Online.com Discussions

  • Can I make two inputs from one??
  • Beats Solo 4
  • Behlke swich
  • Is AI making embedded software developers more productive?
  • Simple LED Analog Clock Idea

Featured – LoRa/LoRaWan Series

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication
  • How communication works between two LoRa end-node devices

Recent Articles

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe