17
Wireless Gate System ET 494 Fall 2018 By: Kyle Rudolph, Brandon Gonlag, and Channing Maher Advisor: Dr.Mohammad

csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/Fall_2018/...  · Web viewWhen working on the Arduino first task was to make LED blink. When typing in the four-digit

Embed Size (px)

Citation preview

Page 1: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/Fall_2018/...  · Web viewWhen working on the Arduino first task was to make LED blink. When typing in the four-digit

Wireless Gate System

ET 494

Fall 2018

By: Kyle Rudolph, Brandon Gonlag, and Channing Maher

Advisor: Dr.Mohammad

Professor: Dr.Koutsougeras

Page 2: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/Fall_2018/...  · Web viewWhen working on the Arduino first task was to make LED blink. When typing in the four-digit

Abstract:

This project requires that we build a gate system that wirelessly interfaces with a device

that can control the gate’s operations (opening and closing). For this project we will use a

microcontroller programmed to control a motor, this motor will be used to open and close the

gate. Inputs for the gate system will be handled by an Android based application, this application

will require an initial password to gain full access to the app. Once the phone is in range of the

device, the gate will react to the app, opening the gate.

Introduction and Goals:

This project uses a Bluetooth module with an Arduino Nano and MIT’s App Inventor to

control the gate’s function This is our plans from the beginning of the semester:

● Program the Arduino to communicate through Bluetooth

● Figure out how to implement our module to the gate

● Program an app to function with the Bluetooth module

Design and Materials:

Parts List:

Page 3: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/Fall_2018/...  · Web viewWhen working on the Arduino first task was to make LED blink. When typing in the four-digit

● Arduino Nano ▪ Microcontroller

▪ Manages Logic

▪ Controls all components

● Bluetooth Module HC-06 ▪ Provides a wireless

connection

▪ Communication between

devices

Accomplishments:

1. Deciding on a Microcontroller and Bluetooth Module:

Microcontrollers like the Arduino Uno and Raspberry Pi 3 were all options for this

project, but we felt these were a bit over the top. We concluded that the Arduino Nano was

perfect for the task. It features RX and TX I/Os that will allow us to communication between our

Bluetooth Module and the user’s device. The Bluetooth device will be used to communicate with

the Nano’s RX and TX I/Os.

2. Ordered the Parts for Constructing the Lock:

We worked closely with our advisor to figure out a setup for the lock hardware itself.

After some ideas from our advisor, we started off with a gear rack and pinion as the main drive

Page 4: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/Fall_2018/...  · Web viewWhen working on the Arduino first task was to make LED blink. When typing in the four-digit

component for our lock. After researching, we decided to use a drawer slide for the rack to glide

along. We ended up scrapping the rack and pinion idea and simply fastened the servo motor

itself to the locking mechanism on the deadbolt.

3. Deciding the Combination Implementation:

We originally had planned to use an EPROM and create a logic gate system to act as a

combination lock. This became too complex to complete. The idea has now shifted to the use of

the Arduino Nano. We will program the Nano to act as a combination lock.

4. Developed a Functioning Lock System with Arduino:

Making use of the EEPROM on the Arduino. We have been capable of setting a

password and saving it. Users can reset the password and implementing their own. This is

currently functional with the physical keypad, implementation with Bluetooth is currently in the

works.

5. Created a Functional Deadbolt Prototype:

An Arduino and power supply has been attached to a servo. The servo is fastened on to the

deadbolt lock. Both of which are mounted in a box that will act as temporary housing for the

setup. When a correct password is typed into the keypad, the Arduino tells the servo to rotate to

its zero-degree position. The zero-degree position unlocks the door from its standard ninety-

degree locked position.

6. App Created with App Inventor 2:

Page 5: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/Fall_2018/...  · Web viewWhen working on the Arduino first task was to make LED blink. When typing in the four-digit

An application for Android devices has been developed. The current app is not functional

with the Arduino just yet. Further research into Bluetooth communication is needed to properly

send signals through the HC-06 to Arduino.

7. Redesigning our Project to Work for Gate System

Redesigning our project to work with another system. Since both systems were fairly alike,

this change will not affect our estimated finish date. Thought new scope for the project will be

needed.

Individual Progress:

● Channing - Researched how to use and implement Bluetooth connectivity. Researching

app development. Deciding on a microcontroller.

○ A simple construction of the microcontroller to the Bluetooth device has been

built.

○ Developing an application with App Inventor 2 has made progress. Improvement

for the app is currently planned for next semester.

○ Using block code to program the app to function and deliver wireless signals via

Bluetooth.

○ Code to properly have the app and the Arduino communicating is currently being

developed to work with the already created lock system code.

● Brandon – Created a working deadbolt prototype by fastening a servo motor to the

locking mechanism of a deadbolt lock. Worked with Kyle to get the servo running with

the keypad program. Completed a functional locking mechanism that works with a

microcontroller.

Page 6: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/Fall_2018/...  · Web viewWhen working on the Arduino first task was to make LED blink. When typing in the four-digit

○ Developed a small prototype box to simulate as the inside of the door lock.

○ Helped wire the Arduino to the servo controlling the deadbolts locking system.

○ Working with team to finish goals and improve the project.

(With new project scope)

○ Working on the app

● Kyle – Building the circuit for the wireless door lock and getting the EEPROM to interact

with the keypad. Doing research on the best way to save passwords to EEPROM.

○ Built 3x4 keypad using buttons and OR gates connected to LEDs to be able to

read if the zero to nine is being read. We did this to see what values are being read

to the EPROM.

○ When trying to get the EEPROM working we came across with problems of how

to store the new 4-digit passwords to the EEPROM without programming it.

○ When working on the EEPROM we decide it was taking up too much time and

went to Arduino. When working on the Arduino first task was to make LED

blink. When typing in the four-digit password it would make a green LED blink

three times and pressing the * button to confirm the password. When the four-

digit password was wrong it would make the red LED blink four times.

○ The next task was to be able to change the current password to a new password

and by pressing the # button to change the password. When changing the

password both LED will blink back and forth with each other three time to let the

user know the password was changed. The problem we encounter was when

changing to the new password when turning off the Arduino and turning it back

Page 7: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/Fall_2018/...  · Web viewWhen working on the Arduino first task was to make LED blink. When typing in the four-digit

on it wouldn’t save the new password and when turning it back on it would rest to

the original password that we put into the code.

○ The task now was to find a way to be able to save the new current password to the

Arduino when it turns off. When working on the code we decide to use the

EEPROM library to write the current password word we have and when we

changed the current password. It will store it in the memory of the Arduino so

when it turns off it will turn off and turns back on it will keep the user password.

○ The next thing we did was combine the keypad part and the servo part to see if the

project works together and to see if the servo and lock work together.

(Current task with new project scope)

○ Device integration with gate

Project Timeline:

Page 8: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/Fall_2018/...  · Web viewWhen working on the Arduino first task was to make LED blink. When typing in the four-digit

Project Plans:

Old Plans

1. Further development of the app and combination system.

2. Add a sensor to detected when the door is closed, this will allow for the door to set a lock

timer after a delay.

3. Store user’s information for later access.

Current Plans

1. Develop an app to work with the gate

2. Implement our project with the gate

3. Research longer range wireless connection

Conclusion:

The initial plans for this project is to create a locking system and have it controlled

through Bluetooth connections, but with a new plan presented, our new plans are to control a

gate automatically through wireless application designed for a phone. The project will challenge

us to use our collective thoughts on different methods to achieve this goal. Ideas that fail will

only push us to build new and creative ways of achieving our desired goals. The time we have

spent this semester researching has improved our overall idea of how this project can be created

and improved upon.

Code/Images/Examples Section:

Section 1:

Page 9: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/Fall_2018/...  · Web viewWhen working on the Arduino first task was to make LED blink. When typing in the four-digit

● Bluetooth connection button that once active displays the disconnect button.

Section 2:

Page 10: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/Fall_2018/...  · Web viewWhen working on the Arduino first task was to make LED blink. When typing in the four-digit

● This current version of the app uses a simple line of block code to connect to available

Bluetooth connections.

Section 3:

Page 11: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/Fall_2018/...  · Web viewWhen working on the Arduino first task was to make LED blink. When typing in the four-digit

char data = 0; //Variable for storing received datastatic int dPin2 = 2;static int dPin3 = 3;

void setup(){ Serial.begin(9600); //Sets the baud for serial data transmission pinMode(dPin2, OUTPUT); pinMode(dPin3, OUTPUT);}void loop(){ if(Serial.available() > 0) // Send data only when you receive data: { data = Serial.read(); //Read the incoming data and store it into variable data //All off if(data == '0'){ digitalWrite(dPin2, LOW); digitalWrite(dPin3, LOW); }

//Red LED if(data == '1'){ digitalWrite(dPin2, LOW); } else if(data == '2'){ digitalWrite(dPin2, HIGH); }

//Green LED if(data == '3'){ digitalWrite(dPin3, LOW); } else if(data == '4'){ digitalWrite(dPin3, HIGH); } Serial.println(data); }}

Page 12: csit.selu.educsit.selu.edu/~csit/seniorprojects/SeniorProjects2018/Fall_2018/...  · Web viewWhen working on the Arduino first task was to make LED blink. When typing in the four-digit