Name | NetID | Course |
---|---|---|
David Medina | davidrm3 | ECE 120 |
Aleksai Herrera | aleksai2 | ECE 110 |
Matthew Ma | xingzhi5 | ECE 110 |
Xiangrui Deng | xd8 | ECE 110 |
- Statement of Purpose
Our project is focused on dorm security using the internet of things(iot). The goal of this project is to protect a student’s valuables from malicious roommates or anyone who is looking to steal from the room. We feel that having one lock on a drawer is not enough security, however, using technology can resolve this issue. Our dorm security project will consist of two main aspects, hardware, and software. The hardware will include a microcontroller and mechanics of the detection system, and software will focus on the code and app. At first, we will start off with a drawer alert system that, when forced open, will sound an alarm and alert the user. This would be the most useful application of our project since most students store their valuables in a drawer. The software involved would utilize Arduino C++ and connect to the user’s phone through Blynk. We want the user to have full control of the drawer when they are away. Once this step is completed, we will move onto other aspects of securing the user’s room. We hope to move onto other systems such as a closet alert system. This system will be the most effective in offering our consumers the best security at UIUC.
Background Research: Initially we had thought about doing some security for our dorms, such as Ring doorbells that are used for our homes, but that’s expensive. Browsing the internet, we found many home security projects utilizing Arduino or Raspberry Pi to control custom door locks or cameras. However many of these ideas were for people who owned the property. In a dorm, drilling holes indoors to install a custom smart would not pass unless we prove that it works. Since we are new, we wanted to hone in on something more simple. A drawer is something that is overshadowed in the examples we found since if you secure your house, you don’t need to secure your drawer. We found that many of the drawers lock that we did find using a keypad and ran continuously. Adding in a phone control to our device will separate us from the competition and move us closer to an IoT dorm system with NETID’s. With this information, we hope to move forward with inspiration from other projects that have on-off sensing.
2. Design.
B. System overview
System overview
Software: Arduino software will be used to code for the microcontroller. The app Blynk will work as a controller for the device. It works on android and has documentation on how to use it.
ESP32 NodeMCU: Another circuit that might be used since it has built-in WIFI and allows us to connect to the blink app.
Drawer Circuit: A circuit that is going to be in the drawer and will detect when it is opened, afterward sounding off the alarm.
Buzzer will supply the audible noise if the alarm is tripped.
Alarm: Noise is made to ward off intruders and alert others of a break-in. Signal will also be sent to the Blynk app.
Limit Switch: It is what is used to detect if the drawer is closed.
3.
Parts | Unit Price | Quantity | Total | Voltage | Link |
---|---|---|---|---|---|
110-style Limit Switches | Rented from HL Inventory | 2 | N/A | ECE Inventory | |
Female to Male Cables | Rented from HL Inventory | 30 | N/A | N/A | ECE Inventory |
Breadboards | Rented from HL Inventory | 2 | N/A | N/A | ECE Inventory |
ESP8266 NodeMCU | $12.99 | 1 | $12.99 | 3.3v | |
3v Buzzer | Rented from HL Inventory | 1 | $6.28 | 3.3v |
4. Possible Challenges
One possible challenge will be getting the hardware, the actual circuit, and the sensing system to work. As beginners, ensuring this works will allow continuing to expand our project. Also, the sensing system by the end should be able to be controlled by the user’s phone. Coding of this level is new to us and will require effort on our part. We fear that our project will be too complicated and won’t be able to finish on time. To meditate this, we chose something simple for now.
Final Design
Introduction and Background
Have you ever had the experience where you opened the drawer to find an important document but it went missing? Are you afraid that your roommates open your drawer intentionally and take a look at your secrets? Those experiences can be annoying to every college student. In order to change the situation, our group decides to design a circuit that can alert you with the noise of buzzers and warning messages on your phone when someone attempts to intrude your drawer. Our project consists of two main aspects, the hardware, and the software. The hardware is made up of a microcontroller and mechanics of a detection circuit, while the software mainly includes Arduino and the Blynk application. For the hardware part, we use a ESP 8266 module, limit switches, several male to female cables, and a buzzer. When the drawer is forced open, the buzzer will make a loud noise. For the software, we are going to connect the Blynk app to our circuit, so that when we click on the buttons on the app, the circuit will function as what we want.
Our project will mainly benefit UIUC students who live in University housing because the drawers there can not be locked. It will enhance the dorm security on campus. One of the main features of our project is that the users can be alerted on their phone when their drawer is forced open. Also, they can control the electronic components in the circuit on their Blynk app. We hope that we can extend our system to other uses for future projects, such as the closet security or door security, to contribute to building a ‘Safer Illinois’.
Design
A. Flow chart:
B. System overview
For the software part of our design, Arduino software will be used to code for the microcontroller. The app Blynk will work as a controller for the device. It works on android, and we studied the documentation provided to learn how to use it. The hardware part of this project contains ESP8266 NodeMCU, which has built-in WIFI and allows us to connect to the blink app. Then it’s the drawer circuit, which is the circuit that is going to be in the drawer and will detect when it is opened using the limit switch, afterward sounding off the alarm. The Buzzer will supply the audible noise if the alarm is tripped. Lastly, when a noise is made to ward off intruders and alert others of a break-in. Signals will also be sent to the Blynk app.
The general design revolved around the user turning on the circuit with the Blynk app. The way this works is by setting a virtual button to a pin on the ESP and turning it on or off. It was used to control all the power to the circuit. From here, a prebuilt WIFI connect template was used and modified to detect if the limit switch was turned on or off. The buzzer was hard-wired in with the limit switch to not sound when closed and sound when the limit switch is on. Unfortunately, the buzzer was damaged and only a faint noise can be heard.
Understanding our parts was essential, the ESP8266 NodeMCU had a different pinout than what the Arduino IDE software recognized. We used this graphic to translate the ESP8266 NodeMCU pinout into IDE. Anything with a blue asterisk is a built-in LED. This was a lifesaver in testing out the limit switch and Blynk app since LED’s weren’t available.
The limit switch did not have any documentation on its behavior. So in order to properly utilize it, we had to understand what each terminal did. After some testing, it was determined that the bottom terminal acted as ground and the other two act as positive terminals. The signal from a pin would go through the positive terminal and if closed, the signal will go through the ground terminal. A resistor was also needed at the negative terminal because we had to bring down the signal strength.
The coding aspect relied on a prebuilt Blynk program on Arduino IDE that worked only to connect the ESP8266 NodeMCU to the WiFi. Coding with the Arduino was straightforward because our project relied on the logic of the limit switch. While coding for this behavior with another sensor would have worked as well, the limit switch was more functional than the other sensors we had in mind. Iterative constructs were used to check for a signal from the limit switch. The Blynk append allowed for widgets to be added, in our code we used a button for power and notification alert widget. All that had to be done was to input the correct pin.
Results
In the end, the Blynk program worked as expected and sent out messages if the limit switch was not closed. We had achieved some of our desired results, with the first one being creating a simple circuit that allowed the buzzer to go off if the drawer was opened. The limit switch being connected in series with the buzzer allowed for a simple design for the buzzer turning on when the switch was pressed, meaning that any one trying to open your drawer would already be faced with an alarm. Ideally, a louder buzzer or speaker would be more ideal if our project were to be used commercially, but this would simply be resolved by switching out the 5V buzzer for another component.
Problems and Challenges
Initially, there were many problems when figuring out how exactly to design the contraption. One of the main requirements of the project that we had set was that the project needed a way to sense that the cabinet or drawer was being opened. After brainstorming and several discussions, there were multiple ideas on the table such as using different types of sensors. At first, we had thought of utilizing an ultrasonic sonar sensor or even a laser that would be blocked if the drawer were opened. However, building a circuit that incorporated several sensors for the laser would be a lot more complicated than the option we finally agreed to. One of the mentors had recommended using a limit switch. This in fact did work well because we are able to place it in the drawer such that when it is opened the switch is closed, which connects the circuit to the buzzer allowing it to function. Upon receiving the main circuit components, the limit switch, the buzzer, and the ESP8266, our unfamiliarity led to some issues. At first, connecting the limit switch in a simple circuit with the buzzer had the opposite effect of the goal, the buzzer was on when the battery was connected and would turn off when the switch was pressed, which essentially would make our project useless. Fortunately, this was a simple fix. The limit switch has points to attach the wires of the circuit, and switching the input to the other point fixed the problem. Another problem faced was that while attempting to attach the ESP8266 and test the overall circuit, one of the buzzer's legs broke off, causing us not to be able to attach this component. The solution that allowed us to continue testing was that an LED would function in the circuit in an almost identical way, meaning that if the switch was closed the LED would light up, which would be akin to the buzzer making noise when it had current flowing through it.
In addition, there were many issues with regards to getting the ESP8266 to function correctly when attached to the circuit. This type of hardware was rather new and took some time adjusting to. To begin utilizing the ESP8266 module it was necessary to connect the device to one of our laptops using a USB to micro USB cord, which, fortunately, is what most phone chargers are. A specific challenge was getting the code to work correctly as it required certain steps to even get started. After downloading the Arduino program, we needed to download the board managers for ESP8266 modules, which initially presented problems as ESP32 was downloaded on accident causing the code not to work.
Also, the amount of preparation that the ESP8266 NodeMCU dulled our efforts. Libraries had to be downloaded in order to even get started. The board gives off a certain comment when the code is uploaded. This “reset” alert was seen as a bug. After researching, we found out that this is normal behavior and that it is a bug with the Arduino IDE software. Along with this, the pinout on the board didn’t line up with the GPIO of Arduino. This was a bit confusing at first because we’d get the two mixed up.
A big issue rose when the board suddenly stopped working and refused to take in code.
This issue made one of the USB ports not work. This was concerning because the board also got very hot. After changing computers and reconfiguring the drivers, the USB port issue was fixed.
Unfortunately, we did not manage to squeeze the limit switch into a drawer and see if it worked. Many of the drawers would require drilling to see and properly place the limit switch.
Future Plans
In the future, we can replace the limit switch with a sonar sensor we used in the ECE lab to detect how close the person is away from the drawer or closet. The current design only contains the limit switch that can only detect if the drawer is open or closed, but the sonar sensor can actually detect people before the closet was being opened therefore protecting unwanted people from seeing what’s inside the drawer. We can also add a laser sensor to the design; the functionality is the same as the sonar sensor but more precise and covers more distance compared to the sonar sensor (the max distance of the sonar sensor is 4 meters). Furthermore, this design cannot only be used on drawers but also on wardrobes and doors, and the design is suitable for them with minimum modifications.
References
[1] Open Green Energy. "Arduino Wireless Home Security System," YouTube, Aug. 3, 2014.[Video File]. Available: https://www.youtube.com/watch?time_continue=213&v=VJaL1Nfm7PQ&feature=emb_logo. (accessed: Sept. 17, 2020)
[2] Open Green Energy. "ARDUINO WIRELESS HOME SECURITY SYSTEM." Website. https://www.instructables.com/id/ARDUINO-WIRELESS-HOME-SECURITY-SYSTEM/ (accessed Sept. 17, 2020)
[3] H. Shettima Lawan. "Motion Detection Alarm System." Website. https://create.arduino.cc/projecthub/hassanshettimal/motion-detection-alarm-system-c5fdd5 (accessed Sept. 17, 2020).
[4] Boguszj1. "Home Security With Raspberry Pi." Raspberry Pi. https://www.instructables.com/id/Home-Security-With-Raspberry-Pi/#:~:text=%20Home%20Security%20With%20Raspberry%20Pi%20%201,parts%20exactly%20as%20presented%20on%20the...%20More%20 (accessed Sept. 17, 2020).
[5] K. Alam. "Intelligent Door Lock". Arduino Project Hub. https://create.arduino.cc/projecthub/taifur/intelligent-door-lock-f9b7c3?ref=tag&ref_id=home%20security&offset=3 (accessed Sept. 17, 2020).
[6] Lightbluecrab. “Blynk with ESP8266.” Instructables circuits. https://www.instructables.com/Blynk-With-ESP8266/ (accessed Dec 1, 2020)
[7]DroneBot Workshop. "Introduction to ESP32- Getting Started," YouTube, Apr. 2, 2020. [Video File]. Available: https://www.youtube.com/watch?v=xPlN_Tk3VLQ&ab_channel=DroneBotWorkshop(accessed: Oct. 17, 2020)
[8] Smartswitchsio. “Programming Languages for ESP 32 &ESP 8266.” Electronic DIYs. https://www.electronicdiys.com/2018/11/programming-languages-for-esp32-esp8266.html (accessed: Nov 2, 2020)
[9] Techtutorialxs. “ESP8266: Controlling a buzzer.” https://techtutorialsx.com/2016/05/07/esp826-controlling-a-buzzer/ (accessed: Nov 2, 2020)
Attachments:
image2020-10-22_12-21-30.png (image/png)
New video.mp4 (video/mp4)