fourtressup.files.wordpress.com€¦  · web viewmckenzie wilde (fall team leader) emmanuel sion...

29
DESIGN DOCUMENT Electronic Package Lockbox _________________________________________________________________ _____ University of Portland Donald P. Shiley School of Engineering EE 483A - FALL 2017 Team Members: McKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha Louie Amurao Faculty Advisor: Dr. Joseph Hoffbeck Industry Advisor: Jim Yoder Clients: Jay and Laurie Wilde

Upload: others

Post on 22-Sep-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

DESIGN DOCUMENTElectronic Package Lockbox______________________________________________________________________

University of Portland

Donald P. Shiley School of Engineering

EE 483A - FALL 2017

Team Members:

McKenzie Wilde (Fall Team Leader)

Emmanuel Sion (Fall Webmaster)

Jean Paul Mugisha

Louie Amurao

Faculty Advisor:

Dr. Joseph Hoffbeck

Industry Advisor:

Jim Yoder

Clients:

Jay and Laurie Wilde

Page 2: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

Design Document Team Fourtress 1

Table of ContentsIntroduction............................................................................................................................ 2

High-Level Architecture …...........................................................................................…….4

Component Structure............................................................................................................ 5

Physical Box.................................................................................................................5

Power Supply................................................................................................................6

Microcontroller.............................................................................................................7

Sensors..........................................................................................................................7

Wifi Module..................................................................................................................8

Software Structure.................................................................................................................10

Testing Plan……....................................................................................................................13

Development Plan..................................................................................................................16

Milestones...............................................................................................................................17

Final Budget...........................................................................................................................18

Conclusion..............................................................................................................................18

Page 3: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

Design Document Team Fourtress 2

IntroductionThe following design document will describe the details on how Team Fourtress designed

and constructed an “Electronic Package Lockbox”. An engineering professor at the University of Portland, who emphasized the issue of package theft in their neighborhood, inspired this project. Therefore, the team decided to build a lockbox prototype, illustrated in Figure 1, that is inexpensive and features communication between the lockbox and the owner through Wi-fi. This lockbox will notify the owner whenever a package arrives via electronic message. The lockbox prototype will first detect if a package placed into the lockbox using sensors. When a package is placed into the lockbox, the device will send an electronic message to the owner of the lockbox that they received a package. The owner will then retrieve the package by opening the lockbox door with a key. 

Major design challenges posed by this project include the programming of the Arduino microcontroller to ensure the user receives an electronic message that a package is in the lockbox as well as the physical design of the lockbox. The team plans to use open-source code as a guideline for programming the Arduino microcontroller and debugging to guarantee the program sends a message to the owner that a package is in the lockbox. The team will design and build the physical lockbox to specific package dimensions, which should fit most average-sized packages. Other design challenges include the locking mechanism of the lockbox and the calibration of the sensors. With the help of University of Portland’s Shiley lab technicians and professors, the team will be able to design a working locking mechanism that prevents package theft. The team also plans to calibrate the sensors for the device prototype through multiple test cases that assesses if the sensors are detecting the package in the lockbox.

Figure 1. Device Prototype Diagram

Page 4: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

Design Document Team Fourtress 3

The lockbox prototype will be used like a standard mailbox on a porch. The process begins when a delivery person drops a package into the lockbox through a top door similar to a standard mailbox. The owner will then receive an electronic message describing that a package has been delivered. The package can be retrieved by unlocking the bottom door using a key and the bottom door is locked by the owner (see Figure 2).

This design document will cover the design of the hardware, software, and Macro model of the project. It will elaborate on important design decisions and how they will affect the project. This document includes system test and development plans that explain the development of the system. Finally, it will describe the risks of the project and present the final budget as well as the milestones for the project.

Figure 2. User Interface Diagram

Page 5: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

Design Document Team Fourtress 4

High-Level ArchitectureThe prototype device will be encompassed inside a plexiglass box. This box acts as the

user interface. The lockbox will be sketched with specific dimensions. These sketches will be given to Shiley Lab Technicians and they will construct the box. The box encompasses all the electrical components of the device. Figure 3 shows the major electrical blocks of the device. The green blocks represent the parts of the device users will interact with. The blue blocks represent the electronic blocks.

Figure 3. High-Level Architecture

Page 6: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

Design Document Team Fourtress 5

The box has a top door that the user will open to insert a package. A magnet will sit on the side of the top door. A Hall-Effect sensor will be attached on the inside wall of the box. When the sensor is near the magnet the state is “ON”, meaning the door is closed. The sensor reads “OFF” when the door is opened. The load sensor circuit will be located at the bottom of the box. The load sensor circuit consists of 4 load cells connected in a Wheatstone Bridge configuration. Each load cell will rest on an L-bracket near the corners of the box. A flat sheet of aluminum will be placed inside of the box on top of the load sensors, which is where the packages will be dropped. The load sensors will be connected to the Load Cell Amplifier HX711. The amplifier will be connected to the Arduino. The signal sent by the load sensor will be converted to kg by the Arduino. When the magnetic sensor is tripped, this triggers the Arduino to read from the load sensor. The Arduino will record the weight of the shelf. It will zero the load sensor to compensate for the shelf. The Arduino will determine if the weight has changed indicating a package has arrived as described in the Software Component section on page 10.

Component Structure1. The Physical Box (Figure 4 & 5): This box will contain all the electronic components

and have room for the package. (See figure 4)

Dimensions: 17"x18"x28"

Materials: Plexiglass

Figure 4. Lockbox Top Door and Electronics Space

Page 7: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

Design Document Team Fourtress 6

Figure 5. Lockbox Dimensions Diagram

2. Power Supply (Figure 6): An AC/DC Power Adapter will be used to supply power to the Arduino Uno microcontroller. This power supply has an output voltage of 9V and an output current ranging from 100mA – 1500mA, which is compliant with the Arduino Uno microcontroller that the team will be using.

Figure 6. AC/DC Power Supply (Adapter)

Page 8: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

Design Document Team Fourtress 7

3. Microcontroller (Figure 7): The Arduino Uno microcontroller will be used in controlling all of the electronic components that will be used in this project such as sensors and WiFi module. It will also be able to send a notification to the user once a package is detected. The microcontroller will be powered through a AC/DC power adapter plugged into a wall outlet.

Figure 7. Arduino Uno

4. Sensors: Two different sensors are used to check the presence of a package and the opening of the door. A magnetic sensor to detect when the door of the box is opened by someone and a weight sensor to detect if there is a package that is dropped in the box.

i. Magnetic Sensor (Figure 8): This sensor checks if the door is opened and send a signal to the Arduino. The Arduino doesn't send a notification to the owner of the box until the weight sensor has detected a package

Figure 8. Hall-Effect Sensor

Page 9: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

Design Document Team Fourtress 8

ii. Weight Sensor (Figure 9): This sensor detects the presence of a package in the box by checking if there is a change of weight and send a signal to the Arduino. The Arduino will send a notification to the owner. Once the Arduino has a sent a notification, it will reset the weight sensor that way it can detect a second package if there is any. This sensor will also be connected to a load cell amplifier (Figure 10) to detect change in resistance.

Figure 9. Load Cell Sensor Figure 10. Load Cell Amplifier

5. WiFi Module (Figure 11): This component is responsible for the communication between the user cell phone and the box. Once the package is detected a notification will be sent to the user's cell phone via WiFi.

Figure 11. WiFi Module

Page 10: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

Design Document Team Fourtress 9

Figure 12. Lockbox Circuit Schematic

Page 11: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

Design Document Team Fourtress 10

Software StructureThe program will be written in Arduino’s Web IDE (Integrated Development

Environment). It will use C++/C languages. The project will be using predefined libraries to interface the Arduino with the sensor and WiFi modules. Figure 13 and 14 display the sequence of the program using flowcharts. Table 0 describes the variables used in the program.

Table 0: Variable Descriptions

Variable Name DescriptionCURRENT_WEIGHT Weight read on the load sensor.PREVIOUS_WEIGHT weight recorded before the top door is open.

Stored in Arduino’s EEPROM.TIME_OPEN Counter variable to track how long the top

door has been opened.DOOR_STATUS 0 if top door open. 1 if top door closed.STUCK_MESSAGE FALSE if stuck message has not been sent.

TRUE if stuck message has been sent.

The setup sequence shown in figure 13 sets the variables’ values. It first sets CURRENT_WEIGHT to the value read on the load sensor. Then it checks to see if PREVIOUS_WEIGHT is null. If it is null, it will set PREVIOUS_WEIGHT = CURRENT_WEIGHT then proceed to the main loop. If PREVIOUS_WEIGHT > CURRENT_WEIGHT, the Arduino will send a message to the user saying they received a package while the device was off. After sending the message, it will set PREVIOUS_WEIGHT to CURRENT_WEIGHT then go to the main loop. If PREVIOUS_WEIGHT=CURRENT_WEIGHT, the program will go to the main sequence.

In the main sequence, the program will check to see if the top door is open, determine if there has been a weight change, and then send a message if the weight is heavier than the previous weight. The main loop starts off by reading the magnetic sensor near the top door. When the magnetic sensor reads LOW, this indicates the door has been open. Once open, it sets TIME_OPEN = 0 and DOOR_STATUS = 0. It will then record the load sensor weight to CURRENT_WEIGHT and set PREVIOUS_WEIGHT = CURRENT_WEIGHT. It will check if the top door is closed. If not, it will increment TIME_OPEN by 1 and check if TIME_OPEN > 5 minutes. If TIME_OPEN < 5 then it will continually check if the door is closed. If TIME_OPEN > 5 it will check to see if a stuck message has been sent. If it has not been sent this means STUCK_MESSAGE = FALSE. When this is false it will send a stuck message and set STUCK_MESSAGE= TRUE. If a stuck message has been sent it will continually check if the door is closed. Once the door closes STUCK_MESSAGE = FALSE and DOOR_STATUS = 1. The program will delay for 1 second and then record the load sensor weight to CURRENT_WEIGHT. It will then compare CURRENT_WEIGHT with PREVIOUS_WEIGHT. If CURRENT_WEIGHT <= PREVIOUS_WEIGHT it will set PREVIOUS_WEIGHT = CURRENT_WEIGHT and return to checking if the top door is open. If CURRENT_WEIGHT >

Page 12: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

Design Document Team Fourtress 11

PREVIOUS_WEIGHT a message will be sent to the user indicating a package has been received. It will set PREVIOUS_WEIGHT = CURRENT_WEIGHT and go back to checking if the top door is opened.

Figure 13. Setup Sequence Flowchart

Page 13: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

Design Document Team Fourtress 12

Figure 14. Main Sequence Flowchart

Page 14: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

Design Document Team Fourtress 13

Testing Plan

The tables below outline the steps and results that will be used to thoroughly test the electronics lockbox to ensure its complete functionality. Table 1 shows the "Testing Plan for Receiving Packages of Varying Sizes" that tests the lockbox can accept varying sizes of packages through the top and bottom doors of the lockbox. Table 2 shows "Testing Plan for Sending and Receiving the 'Received Package' Message" that tests whether the message will be sent and received. Table 3 shows the "Testing Plan for Door Opening Detection using Hall Effect Sensor" that tests all cases relating to the door being opened or closed. Table 4 shows the "Testing Plan for Maximum and Minimum Package Weights for Load Sensor" that tests the different cases regarding package weight. Table 5 shows the "Testing Plan for Detecting Multiple Packages Within Initial Detection" that tests the case when receiving multiple packages within the initial detection period. Table 6 shows the "Testing Plan for Detecting Multiple Packages Outside of Initial Detection" that tests the case when receiving multiple packages when outside the initial detection period.

Table 1: Testing Plan for Receiving Packages of Varying Sizes Steps Result

Use test package one, a box sized at 3"x3"x1", and insert it into the lockbox through the top door and retrieve it through the bottom door.

The package will fit through the top door, fall to the bottom of the lockbox, the package received message will be received and the package is retrieved from inside the box.

Use test package two, a box sized at 9"x6"x3", and insert it into the lockbox through the top door and retrieve it through the bottom door.

The package will fit through the top door, fall to the bottom of the lockbox, the package received message will be received and the package is retrieved from inside the box.

Use test package three, a box sized at 12"x9"x6", and insert it into the lockbox through the top door and retrieve it through the bottom door.

The package will fit through the top door, fall to the bottom of the lockbox, the package received message will be received and the package is retrieved from inside the box.

Table 2: Testing Plan for Sending and Receiving the "Received Package" MessageSteps Result

Use test package two and insert it into the lockbox.

The package will fall to the bottom of the lockbox and a message will be sent and received by the user.

Page 15: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

Design Document Team Fourtress 14

Table 3: Testing Plan for Door Opening Detection using Hall Effect Sensor

Steps ResultOpen the top door but do not insert a package. There will be no message sent from the

lockbox to the user. Open top door and insert test package two. The package will fall to the bottom of the

lockbox. Open and close door for 20 seconds before closing the door.

Opening and closing the door will have no effect on the recorded information or the message received by the user

Retrieve test package two from inside the lockbox.

The lockbox should be empty.

Open top door and attempt to insert test package two, but hold door open for six minutes, then close the door.

The package will fall to the bottom of the lockbox and the "Door Obstructed" message will be sent, as well as the package received message afterwards.

Table 4: Testing Plan for Maximum and Minimum Package Weights for Load SensorSteps Result

Use test package four, a box weighted at #BELOWMIN, and insert it into the lockbox through the top door.

The package will fall to the bottom of the lockbox, but not register on the load sensor, as the package is below the lockbox's minimum weight

Use test package five, a box weighted at #MIN, and insert it into the lockbox through the top door.

The package will fall to the bottom of the lockbox, and register on the load sensor, and the lockbox will send a message that a package has been received.

Use test package six, a box weighted at #AVE, and insert it into the lockbox through the top door.

The package will fall to the bottom of the lockbox, and register on the load sensor, and the lockbox will send a message that a package has been received.

Use test package seven, a box weighted at #MAX, and insert it into the lockbox through the top door.

The package will fall to the bottom of the lockbox, and register on the load sensor, and the lockbox will send a message that a package has been received.

Use test package eight, a box weighted at #ABOVEMAX, and insert it into the lockbox through the top door.

The package will fall to the bottom of the lockbox, and register on the load sensor as its maximum load, and the lockbox will send a message that a package has been received but is at its maximum load.

Page 16: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

Design Document Team Fourtress 15

Table 5: Testing Plan for Detecting Multiple Packages Within Initial Detection

Steps ResultUse test package nine, a box weighted at #SMALL, and insert it into the lockbox.

The package will fall to the bottom of the lockbox and register on the load sensor.

Use test package nine, a box weighted at #SMALL, and insert it into the lockbox, the initial detection period, have passed from opening the door.

The second package will fall to the bottom of the lockbox and register on the load sensor, then the lockbox will send a message that a package has been received.

Table 6: Testing Plan for Detecting Multiple Packages Outside of Initial DetectionSteps Result

Use test package nine, a box weighted at #SMALL, and insert it into the lockbox.

The package will fall to the bottom of the lockbox and register on the load sensor, then the lockbox will send a message that a package has been received.

Use test package nine, a box weighted at #SMALL, and insert into the lockbox, the initial detection period, have passed from opening the door.

The second package will fall to the bottom of the lockbox and register on the load sensor, then the lockbox will send a message that a second package has been received.

Table 7: Testing Plan for Detecting Packages After Device Power FailureSteps Result

Use test package nine, a box weighted at #SMALL, and insert it into the lockbox.

Unplug device to power off lockbox.

The package weight will register on the load sensor before device power failure. When device turns on again, the lockbox will send a message that a package is in the lockbox.

Table 8: Testing Plan for Detecting Packages During Device Power FailureSteps Result

Unplug device to power off lockbox.

Use test package nine, a box weighted at #SMALL, and insert it into the lockbox.

When the lockbox is turned on again, the package weight will register on the load sensor. Then the lockbox will send a message that a package is in the lockbox.

Page 17: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

Design Document Team Fourtress 16

Development PlanThis section will go over any changes in the development plan:

Originally, the plan for the physical structure of the lockbox did not include a designated space for the electronics and had them out of the way near the top of the box. Now, there is a shelf at the bottom of the inside of the box that allows the electronics to rest in the bottom of the box without being in danger of being hit by a package. The shelf inside the box acts as the plate for the load sensors to allow them to get an accurate reading of weight while also separating the electronics from the rest of the box.

To help get an accurate and precise reading from the load sensors, a load cell amplifier was included in the circuit. As the load sensors resistance change is extremely small, the load cell amplifier is used to obtain higher numbers that are easier to read and process, which is necessary because the Arduino Uno microcontroller is better able to determine if a change in weight has occurred with larger numbers.

Page 18: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

Design Document Team Fourtress 17

Updated MilestonesThese milestones represent the tasks or designs that must be completed in order to ensure

that the Electronic Lockbox project remain on track to be finished by the end of the year. Each milestone has a title that explains what is to be done, a deadline that tells when the task or design must be finished by and whether the milestone is major or minor. (Table 7)

Table 9. Milestones

Milestone Title Deadline Major/MinorAssigning tasks to team members Weekly MinorFunctional Specification Document V0.9 19 Sept 2017 MajorLaunch of website 28 Sept 2017 MajorFunctional Specification Document v0.95 29 Sept 2017 MajorHave a list of all the needed components 29 Sept 2017 MinorCompleted Design of Exterior Lockbox 2 Oct 2017 MajorPurchase all the parts. 8 Oct 2017 MajorFunctional Specification Document v1.0 9 Oct 2017 MajorTesting of Sensors Completed 27 Oct 2017 MinorDesign Document v0.9 3 Nov 2017 MajorDesign Document v0.95 10 Nov 2017 MajorDesign Document v1.0 1 Dec 2017 MajorFinal Budget 11 Oct 2017 MajorMicrocontroller programming 26 Jan 2018 MajorTesting the sensors 27 Jan 2018 MinorTesting the WiFi module 29 Jan 2018 MinorBox construction 2 Feb 2018 MajorTesting and Debugging 6 March 2018 MajorFinal Report v0.9 9 March 2018 MajorFinal Report v0.95 30 March 2018 MajorFounder's Day 10 April 2018 MajorFinal Report v1.0 20 April 2018 Major

Page 19: fourtressup.files.wordpress.com€¦  · Web viewMcKenzie Wilde (Fall Team Leader) Emmanuel Sion (Fall Webmaster) Jean Paul Mugisha

Design Document Team Fourtress 18

Final BudgetThis section presents the final budget and estimated cost of the project as well as the

different components that will be purchased. (Table 8)

Table 10. Final Budget

Material Description # of parts CostMicrocontroller 1 $60

Wireless Modules 1 $50Sensors 3 $40Lock 1 $40Physical Box 1 $80

AC Power Supply 1 $40Other components Varies $50

Shipping Varies $40 Total $400

ConclusionOverall this design document has discussed the design details needed to successfully

build the Electronic Lockbox project by Team Fourtress. The document provides the details on the design of the Arduino circuit, the software needed to run the Arduino circuit and the physical structure of the lockbox. The testing plan goes through all possible cases to ensure every aspect of the project is working successfully and the shows how the development plan, milestones and budget carried over from the Functional Specifications Document. No major problems have been encountered so far in the design of the Electronic Lockbox project. The Electronic Lockbox project is expected to finish on time and successfully complete all project goals.