Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Project Implementation and Coding: 6.1 Overview of Project Modules

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 16

Chapter 6

Project Implementation and Coding


6.1 Overview of Project Modules

Continuous monitoring of the sensors in the system so that any burglary attempt is detected.
Informing the controller that the sensors have been triggered and necessary safety actions are
due.
Project is divided into the three Parts:
 Sensing and Buzzer: The controller then activates the alarm system through the driver to
dissuade the burglary attempt.

Sensors Controller Buzzer

 Shutter locking: The controller then activates the motor locking down the kiosk and the
culprits are locked inside. Electrical hazards can be monitored and controlled.

Controller Motor Driver Motor

 IOT enabled control operations: The ESP8266 microprocessor processes all the input
data and activates the output devices according to the input. Sensors like temperature,
Sound, vibration and accelerometer are connected to the input pins of the ESP8266. The
relay and Buzzer are connecting to the output pins. The apply voltage for all the sensor
and output devices are 5V. All the values are sends to the dashboard with the help of
IOT.

Hardware Cloud Dashboard


6.2 Tools and Technologies Used
 Micro- Python - MicroPython is a software implementation of a programming language
largely compatible with Python 3, written in C, that is optimized to run on a
microcontroller. MicroPython is a full Python compiler and runtime that runs on the
micro-controller hardware. The user is presented with an interactive prompt (the REPL)
to execute supported commands immediately. Included are a selection of core Python
libraries; MicroPython includes modules which give the programmer access to low-level
hardware. The source code for the project is available on GitHub under the MIT License.
MicroPython was originally created by the Australian programmer and physicist Damien
George, after a successful Kickstarter backed campaign in 2013. While the original
Kickstarter campaign released MicroPython with an STM32F4-powered development
board "pyboard", MicroPython supports a number of ARM based architectures. The ports
supported in the mainline are ARM Cortex-M (many STM32 boards, TI CC3200/WiPy,
Teensy boards, Nordic nRF series, SAMD21 and SAMD51), ESP8266, ESP32, 16bit
PIC, Unix, Windows, Zephyr, and JavaScript. Also, there are many forks for a variety of
systems and hardware platforms not supported in the mainline.

 MQTT:
MQTT (Message Queuing Telemetry Transport) is a publish/subscribe messaging protocol that
works on top of the TCP/IP protocol. The first version of the protocol was developed by Andy
Stanford-Clark of IBM and Arlen Nipper of Cirrus Link in 1999. What makes MQTT faster than
say sending HTTP requests with your IoT device is MQTT messages can be as small as 2 bytes,
whereas HTTP requires headers which contains a lot of information that other devices might not
care about. Also, if you have multiple devices waiting for a request with HTTP, you'll need to
send a POST action to each client. With MQTT, when a server receives information from one
client, it will automatically distribute that information to each of the interested clients.

Why MQTT?
MQTT has unique features you can hardly find in other protocols, like:
 It’s a lightweight protocol. So, it’s easy to implement in software and fast in data
transmission.
 It’s based on a messaging technique. Of course, you know how fast your
messenger/WhatsApp message delivery is. Likewise, the MQTT protocol.
 Minimized data packets. Hence, low network usage.
 Low power usage. As a result, it saves the connected device’s battery.
 It’s real time! That’s is specifically what makes it perfect for IoT applications.

Why not HTTP


 Slower: because it uses bigger data packets to communicate with the server.
 Overhead: HTTP request opens and closes the connection at each request, while MQTT
stays online to make the channel always open between the broker “server” and clients.
 Power consuming: since it takes a longer time and more data packets, therefore it uses
much power.
 Web Technologies:
Internet of things (IoT) was experienced by everyone who has mobile phones, laptops,
wearables, washing machine, smart speaker, and electronic gadgets connected with the
Internet. Many areas that IoT will make changes, which includes Web Design and
Development. It can help us to develop the future effectively. Internet of Things is a
technology that connects the digital world by transforming the UI interactions between
the man and machine. Now IoT entered into the realm of Web Development and make
users more interactive with the websites. And create a smart & significant role in the
development world. It’s immense power of connectivity and computerized sensibility
feature to help to understand the client features and build the right strategies. IoT edge in
web development will make change the front-end interface and user interactions etc. All
users will use this front-end interface to communicate with cameras, sensors, and other
devices on the Internet.

o HTML
Hypertext Markup Language (HTML) is the standard markup language used to
create web pages. A markup language is your way of making notes in a digital
document that can be distinguished from regular text. It’s the most basic building
block you’ll need for developing websites.
o CSS
CSS (Cascading Style Sheets) is the language used to present the document you
create with HTML. Where HTML comes first and creates the foundation for your
page, CSS comes along next and is used to create the page’s layout, color, fonts,
and…well, the style!
o JavaScript
Another MAJOR tool in your front-end developer toolbox is going to be
JavaScript (JS). Where HTML is a markup language and CSS is a style sheet
language, JS is the first language I’ve mentioned that’s a Bonafede programming
language. What’s the difference? Where HTML and CSS determine the
presentation of a page, JS determines the function.

 Arduino Ide
Arduino IDE is an open source software that is mainly used for writing and compiling the
code into the Arduino Module. It is an official Arduino software, making code
compilation too easy that even a common person with no prior technical knowledge can
get their feet wet with the learning process. It is easily available for operating systems
like MAC, Windows, Linux and runs on the Java Platform that comes with inbuilt
functions and commands that play a vital role for debugging, editing and compiling the
code in the environment. A range of Arduino modules available including Arduino Uno,
Arduino Mega, Arduino Leonardo, Arduino Micro and many more.
6.3 Project Code
Controller Code
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,20,4);
#include <WiFi.h>
#include "Adafruit_MQTT.h"
#include "Adafruit_MQTT_Client.h"

#define WLAN_SSID "iot"


#define WLAN_PASS "12345678"

#define AIO_SERVER "broker.hivemq.com"


#define AIO_SERVERPORT 1883
#define AIO_USERNAME ""
#define AIO_KEY ""

WiFiClient client;
Adafruit_MQTT_Client mqtt(&client, AIO_SERVER, AIO_SERVERPORT, AIO_USERNAME,
AIO_KEY);
Adafruit_MQTT_Publish ld = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME
"/atm/ld");
Adafruit_MQTT_Publish ms = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME
"/atm/ms");
Adafruit_MQTT_Publish gy = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME
"/atm/gy");
Adafruit_MQTT_Publish fx = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME
"/atm/fx");
Adafruit_MQTT_Publish lm = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME
"/atm/lm");

void setup()
{
lcd.init();
lcd.backlight();
lcd.setCursor(0,0);
lcd.print("IOT BASED ATM SAFETY &");
lcd.setCursor(0,1);
lcd.print("MONITORING SYSTEM ");
lcd.setCursor(0,2);
lcd.print(“SAPKAL COLLEGE,");
lcd.setCursor(0,3);
lcd.print("-OF ENGINEERING");
delay(5000);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("PLEASE WAIT");
lcd.setCursor(0,1);
lcd.print("CONNECTING TO WI-FI");
lcd.setCursor(0,2);
lcd.print("GETTING READY ...");
lcd.setCursor(0,3);
lcd.print("IT TAKES 10-15 SEC. ");
Serial.begin(9600);
scale.set_scale();
scale.tare();
WiFi.begin(WLAN_SSID, WLAN_PASS);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println();
Serial.println("WiFi connected");
Serial.println("IP address: "); Serial.println(WiFi.localIP());
lcd.clear();
lcd.setCursor(0,0);
lcd.print("CONNECTED SUCESSFULLY");
lcd.setCursor(0,1);
lcd.print("TO NETWORK (WI-FI)");
lcd.setCursor(0,2);
lcd.print("CONNECTING TO CLOUD");
lcd.setCursor(0,1);
lcd.print("~~~~~~~~~~~~~~~~~~~");
delay(5000);
}

void loop()
{

MQTT_connect();
int a = analogRead(36);
int b = analogRead(39);
int c = analogRead(34);
int d = analogRead(35);
ld.publish(scale.get_units(), 3);
Serial.println(a);
ms.publish(a);
Serial.println(b);
gy.publish(b);
Serial.println(c);
fx.publish(c);
Serial.println(d);
lm.publish(d);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("SOUND :");
lcd.setCursor(15,0);
lcd.print(scale.get_units(),2);
lcd.setCursor(0,1);
lcd.print("GYRO- LEVEL :");
lcd.setCursor(15,1);
lcd.print(b);
lcd.setCursor(0,2);
lcd.print("TEMPERATURE:");
lcd.setCursor(15,2);
lcd.print(a);
lcd.setCursor(0,3);
lcd.print("VIBRATION:");
lcd.setCursor(15,3);
lcd.print(d);
delay(5000);

void MQTT_connect() {
int8_t ret;
if (mqtt.connected()) {
return;
}
lcd.clear();
lcd.setCursor(0,0);
lcd.print("NOW CONNECTING TO");
lcd.setCursor(0,1);
lcd.print("CLOUD PLEASE WAIT");
Serial.print("Connecting to MQTT... ");

uint8_t retries = 3;
while ((ret = mqtt.connect()) != 0) {
Serial.println(mqtt.connectErrorString(ret));
Serial.println("Retrying MQTT connection in 5 seconds...");
mqtt.disconnect();
delay(5000);
retries--;
if (retries == 0) {
while (1);
}
}
Serial.println("MQTT Connected!");
lcd.clear();
lcd.setCursor(0,0);
lcd.print("CONNECTED");
lcd.setCursor(0,1);
lcd.print("SUCCESSFULLY... ");
}

Chapter 7
Software Testing
6.1 Types of Testing
Testing is the process of evaluating a system or its component(s) with the intent to find whether
it satisfies the specified requirements or not. Testing is executing a system in order to identify
any gaps, errors, or missing requirements in contrary to the actual requirements.

6.1.1 Manual Testing


Manual testing includes testing a software manually, i.e., without using any automated tool or
any script. In this type, the tester takes over the role of an end-user and tests the software to
identify any unexpected behavior or bug. There are different stages for manual testing such as
unit testing, integration testing, system testing, and user acceptance testing. Testers use test
plans, test cases, or test scenarios to test a software to ensure the completeness of testing. Manual
testing also includes exploratory testing, as testers explore the software to identify errors in it.

6.1.2 Automation Testing


Automation testing, which is also known as Test Automation, is when the tester writes scripts
and uses another software to test the product. This process involves automation of a manual
process. Automation Testing is used to re-run the test scenarios that were performed manually,
quickly, and repeatedly.
6.2 Methods of Software Testing
There are different methods that can be used for software testing. This chapter briefly describes
the methods available.
6.2.1 Black-Box Testing
The technique of testing without having any knowledge of the interior workings of the
application is called black-box testing. The tester is oblivious to the system architecture and does
not have access to the source code. Typically, while performing a black-box test, a tester will
interact with the system's user interface by providing inputs and examining outputs without
knowing how and where the inputs are worked upon.

6.2.2 White-Box Testing


White-box testing is the detailed investigation of internal logic and structure of the code. White-
box testing is also called glass testing or open-box testing. In order to perform white box testing
on an application, a tester needs to know the internal workings of the code. The tester needs to
have a look inside the source code and find out which unit/chunk of the code is behaving
inappropriately.

6.2.3 Grey-Box Testing


Grey-box testing is a technique to test the application with having a limited knowledge of the
internal workings of an application. In software testing, the phrase the more you know, the better
carries a lot of weight while testing an application.

Mastering the domain of a system always gives the tester an edge over someone with limited
domain knowledge. Unlike black-box testing, where the tester only tests the application's user
interface; in grey-box testing, the tester has access to design documents and the database. Having
this knowledge, a tester can prepare better test data and test scenarios while making a test plan.

6.3 Test Cases


6.3.1 Test Cases for Hardware
No. Module Expected Result Actual Result Status
1. Sound Sensor Sensor should detect Sensor is giving data Success
sound of hammering as per requirement.
and cutting activity
2. Vibration sensor Sensor should detect Sensor is giving data Success
vibration. as per requirement.
3. Temperature Sensor Sensor should detect Sensor is giving data Success
temperature more than as per requirement.
peak value.
4. Accelerometer Sensor should detect Sensor is giving data Success
change in x, y and z as per requirement.
direction.
5. Shutter Motor After detecting any Motor is working as Success
intrusion activity per requirements.
shutter motor should
turned shutter off.
6. Solenoid Lock After detecting any Solenoid lock is work Success
intrusion activity as per requirements
Solenoid lock should
turned locked state.

6.3.2 Test Cases for Software


No. Module Expected Result Actual Result Status
1. Signup After entering correct User can create an Success
details user can create account.
an account
2. Login User should login an User can login an Success
account after entering account using
username and username and
password. password.
3. Dashboard All sensor data should User can view data Success
be shown on dashboard after login.
4. Alert After any intruder’s Alert section can show Success
activity alert section alerts
should show an alert.
5. Graph All sensor data should All sensor data can be Success
be shown on dashboard shown on dashboard in
in the form of graph the form of graph and
and chart. chart.
6. Logs All logs should be Log Section is Success
shown in logs section. showing all logs.

Chapter 8
Result
8.1 Outcomes and Results
Chapter 9
Conclusion
9.1 Conclusion

From the above proposed system, various techniques are available to avoid robbery in ATM. We
have proposed different approaches by different researches for ATM monitoring and security.
Generally, in all other papers they use the sensors to monitor the unusual activities by GSM, but
in our project, we update the unusual activities by using IOT. The proposed method reduces the
cost and increases the efficiency with the wide use of internet this system is focused to
implement the internet technology to establish a system which would communicate through
internet for ATM secure monitoring system. Internet of things is expected to rule the world in
various fields.
In future we will be adding features such as metal detection like gun, knife, gas cutter etc. at the
entrance door. Whenever the theft occurs at that time our dashboard user-interface will be
consisting of button by clicking on it. ISP/Telecom company will be receiving the request and it
will send us the information regarding the mobile users and calls made by them.
9.2 Future enhancement
 We will use biometric authentication for ATM like iris or fingerprint scan.
 We will use Raspberry Pi and image processing techniques to detect fraudulent activities
in ATM machine room.
 We will use various scanners to detected tools and weapon carrying by persons

9.3 Applications and advantages


 High security to ATM machines.
 Easily traceable.
 Manpower reduction
 use of sensors to observe the change
 Reduce Fraudulent activities

You might also like