IoT Based Notification System Using Android App

IoT Based Notification System Using Android App

Presented here is a smart notification system for a door sensor, motion detector, fire alarm and doorbell using Raspberry Pi (RPi) and Pushover app. The project triggers an event through various sensors and sends notifications to your smartphone. Sensors used in this project include a magnetic reed switch for a door or window, PIR sensor for motion detection and NTC thermistor for fire alarm.

The issue of security is becoming more prevalent. The Internet of Things (IoT)-enabled home security solutions like this use sensors to collect and share data from multiple edge devices. If an attacker gains access to these smart systems through malicious means, the underlying functional logic of control systems can alert the owner. Connected home security systems offer a myriad of features including door and window sensors, motion detectors, fire alarms and so on, all connected via the Cloud to a mobile device or the Web.

Block diagram of the smart alert notification system using Android app is shown in Fig. 1.

Fig. 1: Block diagram of the IoT based notification system

Pushover is a service on the Web and an app for your phone or tablet that acts as a gateway for notifications. It can alert you to anything, including job postings, status of rain, emails from important people or a sensor activated in your home. Pushover lets you set up as many noise-free time periods as you like, using a feature called Quiet Hours. You can access alarm indications from anywhere in the world.

Circuit diagram of the smart notification system using RPi is shown in Fig. 2. Hardware includes Raspberry Pi, Android phone, PIR sensor, reed switch, NTC thermistor, doorbell and a few other components.

Fig. 2: Circuit of the IoT based notification system using RPi

The PIR sensor connected across CON1 detects the presence of people through changes in infrared radiation from the human body in front of the door. It outputs around 3.3V high signal whenever it detects radiation change and correspondingly sends alert signals to your Android phone.

The magnetic reed switch connected across CON2 is usually installed on the frame of an exterior door or window. When the door or window opens, it moves away from the frame, magnetic field around the switch gets removed and corresponding alert signal is sent to your Android phone.

NTC thermistor connected across CON3 is used as the temperature-cum-fire sensor. Resistance of the NTC thermistor decreases with increase in temperature.

At room temperature, transistor T2 conducts. When temperature of the sensor goes above 70°C [depending on thermistor constant (K)], T2 stops conducting. When T2 stops conducting, an alert signal is generated in RPi, which is sent as a push message to the Android phone.

Most doorbells produce pulse-wave modulation waves while ringing. You need to hack the doorbell so that it produces at least 2V (pulse-wave modulation with low-pass filter) output signal. You may use this signal as an interrupt signal to drive RPi pin and generate an alarm log in your Android phone. Door-bell signal is fed to RPi through CON4.

When someone rings the doorbell, you will get a notification on your phone. Various alert notifications received on Android smartphone are shown in Fig. 3.

Fig. 3: Alert notifications in Android mobile

Pushover makes it easy to get real-time notifications on your smartphone. Follow the steps given below to activate Pushover app on your Android device.

1. On your mobile device, open Pushover app and log into your account. You will be asked to register your device by providing a name for it.

2. Visit https://pushover.net on your computer and log into your account. You should see your devices listed in a section called Your Devices, a little way down the page. Verify that the devices you have registered are on this list and are enabled.

3. Note down your user key (like, uyaa3u82r6rw853a2zhwj7afyxq4ba) as shown in Fig. 4. You will need it for your Python code.

Fig. 4: Typical user key generated on Pushover app

4. To get API key, click on Your Applications (doorbell) and note down your API token/key (like, au3kybdp4bmv3xs3qp1prku7pcrp9r) as shown in Fig. 5.

Fig. 5: Typical API key

5. Under Settings in Pushover, you can set an audio alert for quiet hours, etc for your mobile as per your requirement.

Open Pushover app on your Android mobile. Open appliance.py file on the terminal in RPi. Change user_key and application_key in the code with your keys obtained as shown in Figs 3 and 4. Run the following command:

$ sudo python appliance.py

With the server connected to RPi, you will get ‘Appliance Server Started’ message in the terminal and ‘Appliance Started’ message on your mobile. As per the interrupt signal received from the input sensors (motion, door break, fire, doorbell, etc), the corresponding alert notification will be received on your Android phone through Pushover app.