ELECTRONIC INSTRUMENTATION MINI PROJECT

MAILBOX NOTIFICATION SYSTEM


Mini project constructed by:
1) Huda Aqilah
2) Hani Farisha 
3) Khairul Arifah
4) Nor Amirah Sofea
5) Siti Nur Aisyah

Figure 1.0 Connection for the system


REQUIRED COMPONENT

  • NodeMCU 32s
  • Jumper wire
  • IR sensor

OBJECTIVE

1. Create a low-cost mailbox notification system with mailbox notification.

2. To incorporate the model's design into the mailbox notification system.

3. To determine whether the mailbox notification system is completely operational.

INTRODUCTION

    Mailbox Notification System was created to address the issue that people today face when they are unable to monitor their postage in their daily lives. The project was chosen because the majority of inhabitants, whether they live in an apartment, townhouse, or home, are irritated when they go to the mailbox to check for mail and it is empty. We are inspired to create a technology that will make our lives easier in a variety of ways. A mail notification system will send a notification message to both the home and mobile phone to notify the homeowners that there is something in their mailboxes.

    For this project, the electronic technology or the internet of things (IOT) was applied to overcome this problem. This project is constructed with esp32-s and secured with an infrared (IR) sensor. Once the embedded sensor in the project detects the receipt of a document/letter/postage, it will automatically send an alert signal through smartphone notification. This initiative also makes people's lives easier by sending brief message notifications to tell the user of the receipt of postage or a letter, saving time spent checking the mailbox every day.

PROBLEM STATEMENT

   Most users are unaware of this fact when they receive a new letter or package in their mailbox. They should periodically and speculatively review the contents of their mailboxes. Usually, default users check their mailboxes. This can sometimes result in someone not knowing the important letters and causing them to suffer greatly. Due to the central mailbox placement, most high-rise structures, including flats, condos, office buildings, only allow users to check or retrieve their mail on certain trips.

    Overcoming traditional ways of checking mailboxes, users find it easy to monitor the mail they receive. Customers are looking for a better solution that allows them to be alert every time a letter is sent because the use of official letters and high confidentiality is growing on a global scale. This traditional mailbox offers medicines in the form of advanced electrical technology. By tying a user's mailbox to the Blynk service and Nodemcu module can be integrated to allow users to receive notifications each time a new letter is sent.

    When a letter is sent to the user's mailbox, the system will immediately notify and send it via Blynk, usually with information about the exact time of mailing. By telling users about significant new messages in their mailbox through Blynk, the system aims to make life easier for everyone. This may be a fast-growing application for Blynk services and short orders.

LIMITATION OF WORK

Because the notification will be delivered to the user when the project connects to the home wireless network, this project will only work in a wireless network connection to send the notification. The battery is the only source of electricity for this project.

LITERATURE REVIEW

1.     Related works

1.1        Real-Time Sms Alert System For Centralize Mail Compartment.

    The article [1] mail compartment alert system will work via SMS notification. In mailboxes, two infrared (IR) sensors will be mounted, one for transmitter and one for reception. The circuit will automatically transmit a signal to the programmable logic controller (PLC) control systems once a mail is entered into the mailbox and cuts the IR signal. The PLC will then send the preprogrammed message to the user's phone via GSM modem.

1.2        Smart Pigeonhole System By Sending Notification Through Short Messaging System

    Smart Pigeonhole Using Short Messenger System is the title of the article [2]. This system is a piece of hardware that uses an Arduino Yun, an infrared sensor, and an adjustable sensor to notify the user of mail that has fallen into the pigeonhole. Every email that falls into the pigeonhole will send a message to the user's phone. The device is constructed with an infrared sensor that functions as a detector to detect the arrival of letters. The IR sensor is mounted on the mailbox's roof. It is placed in a good position to ensure that it can accurately detect mail arrivals every time the mailman inserts the mail. This is a sensor that can be adjusted. The transmitter and receiver can be adjusted by the user. User can adjust the transmitter and receiver. It will be mounted to the board and will be connected with the Arduino Yun board.

1.3        Address Digitization and Smart Mailbox With RFID Technology.

    This article [3] describes a project that combines sensors, cameras, locks, RFID readers and tags, and an Arduino board to create a smart mailbox. The goal of this project is to investigate the concept of address digitization (storing addresses using RFID tags) and incorporate it into a mailbox that can communicate wirelessly with the homeowner to provide mail status updates and home security footage via digital photographs. The RFID Reader can be used in this project to secure the mailbox. This article [3] can be used to reference this project.


METHODOLOGY

1. FLOWCHART

Figure 2.0 Flowchart

The accompanying flowchart just illustrates how the mailbox notification system operates. The sensor must be activated by inserting a tangible object or email into the mailbox before anything can be detected. Then, the IR sensor will identify whether or not there is email present. Once an email is detected by the IR sensor, the user will receive alerts informing them of how much fresh mail has been added to their inbox. This system will no longer function once the notice is given unless the user promptly goes to pick up the mail. The journey of how this email notification system works goes from the start to the finish and back again until a new email is added to the mailbox.


2. COMPONENT FOR PROJECT (HARDWARE & SOFTWARE)

Figure 3.0 IR sensor


A sensor that measures and recognises infrared radiation in its surroundings is known as an infrared (IR) sensor. Due to its larger wavelength than visible light, infrared is invisible to the human eye (though it is still on the same electromagnetic spectrum). Infrared radiation is released by everything that produces heat, which is to say, anything with a temperature higher than around five degrees Kelvin. Active and passive infrared sensors are the two different types. Infrared radiation may be detected and produced by active infrared sensors. LEDs and receivers make up the two components of active IR sensors. The infrared light from the LED is reflected off of an item as it approaches the sensor, and the receiver can detect this reflection. In obstacle detection systems, active IR sensors are frequently employed since they serve as proximity sensors. In this project, an infrared sensor is employed to find mail. 

Figure 4.0 ESP 32

Espressif Systems developed the ESP32 using several low-cost, low-power SoC (System on a Chip) and module combinations. It replaces the well-known ESP8266 with the new ESP32. Along with having built-in WiFi, the ESP32 also has Bluetooth and Bluetooth Low Energy. High-level integrations like antenna switches, RF control baluns, power amplifiers, low noise reception amplifiers, filters, and power management modules are all present in the compact ESP32 package. A built-in Hall effect sensor and touch-sensitive pins are also included with the ESP32, which can be used to "wake up" the device from deep sleep mode.

There are 34 digital pins in the ESP32 in total. These pins are comparable to the Arduino digital pins and let us add LED displays, OLED displays, sensors, buttons, buzzers, and other components to our designs. The majority of these pins also allow for the usage of internal pull-up, pull-down, and high impedance status. This makes them perfect for connecting buttons, matrix keyboards, and for using well-known Charlieplexing LED control methods. The 25 GPIO pins of the ESP32 WROOM module are all input pins, pins with input pull-ups, and pins without internal pullups. As with analogue pins on an Arduino board, some of the pins specified in the pinout diagram can be used to communicate with analogue sensors. For this, the ESP32 has an 18-channel, 12-bit (with a resolution of 0–4096, meaning that when the maximum voltage, such as 3.3 volts, is observed, the value increases to 4096), analog–to–digital converter, allowing you to read data from up to 18 analogue sensors. Even when using multiple analogue sensors, this enables you to create very small connected applications.

Figure 5.0 Blynk App


The IoT platform Blynk allows users of iOS or Android smartphones to remotely operate devices like the Arduino, Raspberry Pi, and NodeMCU. By compiling and giving the required address on the accessible widgets, this programme is used to construct a graphical interface or human machine interface (HMI). The Internet of Things was the focus of Blynk's design. It has several amazing features, like remote hardware control, sensor data display, data storage, data visualisation, and many more. In this method, Blynk is utilised to be alerted when an email is received and will send a phone notice.

Figure 6.0 Arduino IDE


It is simple to write code and upload it to the board while offline using the Arduino Software (IDE). Users with slow or no internet connections are advised to use it. With any Arduino board, this software is compatible. The code or programme had to be created and embedded into the ESP32 in order to carry out the system's functions. The programme code is entered using the Arduino Integrated Development Environment (IDE) software. This sub-topic will walk readers through each step of creating the programme code needed to create this intelligent mailbox monitoring system. Looking at some references allowed us to edit and modify the coding we used for this project. Some studies and referring had to be done to some of previous projects to learn how to edit and modify the coding based on desired process in the making of the monitoring system for the intelligent mailbox.


3. CIRCUIT CONNECTION SCHEMATIC

Figure 7.0 Schematic of circuit connection



4. CIRCUIT CONNECTIONS

IR SENSOR

NODEMCU

VCC

3V

GND

G

OUT

GPIO22


5. BLOCK DIAGRAM

Figure 8.0 Block Diagram

The block diagram above shows the mailbox notification connection and how it works. There are 3 blocks where, the infrared sensor block is the input, the NodeMcu 32s block is for data processing and the Blynk app block is the output.

            On the infrared sensor block, when there is a letter put into the mailbox. infrared sensor will detect the letter and send the data to Nodemcu 32s. Next, at block of Nodemcu 32s. data from input will process and the data will send to the output which is Blynk Application. At Blynk Application, it will send a notification shows that there is a letter in the mailbox. 

6. CODING DEVELOPMENT AND EXPLANATION

For this mini project, we used the arduino.cc software to generate coding and simulate the project, is mailbox notification. For coding development, I create the coding for my final year project at Arduino.cc, to ensure this project can function properly, this coding generate at Arduino.cc then the coding will be uploaded to the Nodemcu 32s.

First, we need to define the libraries that we use to program the code. For this mini project the libraries that use is BLYNK_PRINT serial. Wifi.h and BlynkSimpleEsp32.h

BlynkTimer timer mean to set the function to sends Arduino’s up time every second to Virtual Pin, which is we can define how often to send data to Blynk App. After that, “char auth” use to connect the hardware to phone. It knows as auth token which is the identifier that need to connect the hardware to phone. This project based on IOT (internet on Thing) so, this project needs the wifi/hotspot to connect the mobile phone, then “char ssid” and “char pass” is use in coding to connect ESP32 board to Blynk App. “const int IR=22” means that the variable will read only at the infrared sensor at pin 22. 

Figure 9.0 Arduine IDE

To ensure that the infrared sensor can function properly, we need to create a function to notify the sensor which is the code is “void notifyOnIR()”. It also to check for a condition button pressed and flag on that basis. Along with this, it updates the text on Blynk App to alert that we received the mail. The code is “Serial.println("You received mail in the mailbox");  Blynk.notify("Alert : You received mail in the mailbox");”

 

Figure 9.1 Arduino IDE

After that, to setup this program, we need to define pinMode first, pinMode that we use in this project is IR for the sensor and INPUT_PULLUP for monitor to start establishes and communication with Blynk App.  The code “void loop ()” to simply run the time interval and notifyOnIR function for getting output.

Figure 9.2 Arduino IDE

7. FULL CODE USED IN THIS PROJECT

// BLYNK LIBRARY 

// ESP32 LIBRARY 

// IR Sensor Connect to GPIO22 PIN 

 #define BLYNK_PRINT Serial 

 #include <WiFi.h>

 #include <BlynkSimpleEsp32.h> 

 BlynkTimer timer; 

 char auth[] = "gfC2IuFDk3Tg00sFMMe00tMg-lOxTar4"; //Auth code sent via Email 

 char ssid[] = "abcde"; //Wifi name 

 char pass[] = "1234"; //Wifi Password 

 const int IR = 22;

 

 int flag=0; 

 int val = 0;

 void notifyOnIR() 

 { 

  int isButtonPressed = digitalRead(22); 

  if (isButtonPressed==1 && flag==0) { 

   Serial.println("You received mail in the mailbox"); 

   Blynk.notify("Alert : You received mail in the mailbox"); 

   flag=1; 

  } 

  else if (isButtonPressed==0) 

  { 

   flag=0; 

  } 

 } 

 void setup() 

 { 

 Serial.begin(9600); 

 Blynk.begin(auth, ssid, pass); 

 pinMode(IR,INPUT_PULLUP); 

 timer.setInterval(1000L,notifyOnIR); 

 

 

 } 

 void loop() 

 { 

  Blynk.run(); 

  timer.run(); 

 }

RESULT


    The video shows that when the mail is inserted to the mailbox, a notification from the Blynk App will pop up on the user's device. This device will help the user to be alert of the presence of new mails. The user can get notified about the presence of new mails via Wi-Fi connection through Blynk app that will be installed to the user's mobile phone.

    

Figure 10.0 IR sensor detection

    Assuming the book is the envelope. When the envelope is placed in front of the IR sensor, the sensor's light will flash, signalling that the sensor is sensing something. 


Figure 11.0 Notification from Blynk App

    When the IR sensor detects the existence of mail, it sends a notification to the user's mobile phone via the Blynk application. When the IR sensor detects the existence of mail, a notification is sent to the user.

CONCLUSION & FUTURE WORK

            In conclusion, all connections must be made because every port that is connected has been output. The connection wire or jumper wire's conductivity needs to be evaluated. Due to the fact that some outputs may generate incorrectly or not at all when the current is blocked. The Arduino Software should then be reviewed. This is owing to the fact that the microcontroller will receive the resulting encoding and execute the command using it. In order to get the right output, the correct encoding needs to be programmed first. The effort must prosper and overcome all challenges. This is so that you may learn a lot from challenges even if you don't comprehend them.

A few things can be added to this project's gadget for future work. People nowadays like to buy items online, therefore one adjustment that can be made to the mailbox is to enhance its size and durability, as well as to add a larger door that can be used to insert parcels. A larger and stronger mailbox can withstand the size and weight of the parcels, and a larger door can be created to ensure that parcels are entered into the mailbox rather than being left outside and potentially stolen.

Apart from that, an ESP32 camera can be used as a package monitor, allowing the user to predict the type of parcel they will receive. This camera may also display the status of the cargo to the user by transmitting a photo via a mobile phone application. As a result, the user will be notified of impending deliveries and will not have to worry about the quality of the delivery because it can be monitored using the camera.