Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
  • Women in Engineering

Intelligent Letter Box using Arduino and GSM

By Salman Khan

 

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
 

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.

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!


Featured Tutorials

  • Adjustable 0 to 30V 2A DC Power Supply Circuit (Part 1/13)
  • Adjustable +/- 1.25V to +/-22V 1A Power Supply Circuit (Part 2/13)
  • Adjustable 0 to 15V 1A Mini Power Supply (Part 3/13)
  • Constant 12V Power Supply for LED Circuits (Part 4/13)
  • Constant +/-9V DC Symmetrical Power Supply Circuit (Part 5/13)
  • Making a Circuit Breaker (Part 6/13)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

“ee

“ee

“ee

“ee

“ee

“ee

Recent Articles

  • STMicroelectronics and MACOM announce successful RF GaN-on-Si prototypes
  • Infineon expands its CoolSiC portfolio
  • STMicroelectronics and AWS collaborate for secure IoT connections
  • Pet feeding system using WhatsApp (protocol bridging with MQTT)
  • STMicroelectronics launches new MDmesh MOSFETs

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd ldr led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics Research robot samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • Space Vector PWM Help Needed
  • P-Channel MOSFET always on
  • DIY test leads - source for lead ends?
  • hardcore floquet bloch scattering problem help
  • Limiting variable DC power source

RSS Electro-Tech-Online.com Discussions

  • How to get lots of PCBs made cheap?
  • How do I test amplifier speaker output polarity?
  • XOR Gate Circuit From Diodes
  • 3.3V microcontroller vs 5V relay
  • What is this part on my solar controller
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 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 | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
  • Women in Engineering