• Sonuç bulunamadı

View of Safety Features and Inventory Management for Vending Machine Using IoT

N/A
N/A
Protected

Academic year: 2021

Share "View of Safety Features and Inventory Management for Vending Machine Using IoT"

Copied!
11
0
0

Yükleniyor.... (view fulltext now)

Tam metin

(1)

Research Article

Safety Features and Inventory Management for Vending Machine Using IoT

Sazly Anuar1, Danial Mirza Madrawi2, Farah Hana Mukhtar3

1,2,3Universiti Kuala Lumpur Malaysia France Institute, Section 14,JalanTerasJernang,43650 Bandar Baru

Bangi,Selangor, MALAYSIA

sazly@unikl.edu.my1, danial.madrawi12@s.unikl.edu.my2, farahhana@unikl.edu.my3

Article History: Received: 10 November 2020; Revised: 12 January 2021; Accepted: 27 January 2021; Published online: 05 April 2021

Abstract: Security features and inventory management for vending machines using IoT is a project which focus mainly on IoT implementation. Although IoT is no stranger to vending machine, the project takes different approach of IoT. It is not just about the inventory management, but also the security features. Since IoT requires internet connection and cloud storage, it requires a microcontroller that supports wireless connection. Therefore, all the operations including controlling the vending machine will be done using ESP32 microcontroller. Anything that are recorded from the vending machine such as the number of product left, the amount of money and the condition of it will be uploaded to the cloud storage, Blynk. Blynk app and cloud storage are easy to use without need of professional knowledge. The inventory management is done by monitoring the amount of the money and items. The safety features will be done using accelerometer and gyroscope, which will be detecting force on the body.

Keywords:Security, inventory, IoT

1. Introduction

Vending machine is an automated machine that sells goods such as foods, drinks, and cigarettes. Its principles are very simple, the customer makes the payment to the machine, then the good is retrieved either by released by the machine or need to be released by customer himself. Since these machines operate automatically without human monitoring, meaning they are vulnerable against various of crimes such as theft and vandalism. Both usually comes in physical form. The owners who placed their machines where the security level is low to none suffer thousands of ringgits of losing their machines and items. Most security features from vending machines are just structural features that absorbs the physical abuse from vandalism and just delaying the theft from being completed. Conventional method such as using CCTV does not protect the vending machine physically and need constant human monitoring. For security purpose, an embedded system needs to be created that integrates all sensors such as accelerometer, gyroscope, and GPS as security IoT system that protects vending machine from theft and vandalism. The system will be used as the real- time notification to alert the owner if such attempts is happening. An inventory management system (Patent No. 5207784, 1993), (Patent No. 6181981, 1996), (Patent No. 5706976, 1998) must be created that manage the inventory of the vending machine with IoT to solve such issue(S.V. Manikanthan et al, 2020). The system also will be used for notification on real- time situation to help the owner aware and manage the inventory.

Vending machine also is being neglected in having proper inventory management. Most vending machines in Malaysia are traditional vending machine that are incapable for real time inventory monitoring. Vending machine owners waste more time and resources maintaining their machine inventory without foreseen it in real time (Ben Black, 2018). Vending machine items usually refilled based on schedule, without knowing the amount of money left, what type and number of items need to be refilled and without. The remainder of this paper is organized into four sections: 1) literature review, 2) materials and methods, 3) results and discussion, and 4) conclusion.

2. Literature Review

Three areas have been reviewed for this paper, which are security, inventory management, and data analyzation.

2.1. Security

Theft is the biggest concern for any vending machine given it is an automated that often left to operate itself. In 2019, Royal Malaysia Police successfully captured “Gedegang Gang” (Fuad, 2019), which consists of four men age from 23 to 29. The group is responsible for ten robberies in Klang Valley. The police seized a car, a drilling machine and six vending machines from them. Two of them were vending machine operators. The group

(2)

the machine received a very huge physical force to remove them using power tools. Therefore, detection of those forces can help prevent theft on vending machine.The propose of accelerometer and gyroscope sensor can help to detect the event, hence the owner can act based on the real-time status sent by the machine.

Vandalism is another common crime happens on vending machine. Alpine School District in Orem, Utah in 2019 reported to Orem police that the vending machine from Timpanogos High School was vandalized (Thomas, 2019), and the money was stolen. According to the CCTV, the man use crowbar to conduct his crime by prying open the vending machine. He is suspected to be responsible for six similar cases in Alpine School District alone. Police estimated about $8,000 were stolen and the damage worth about $20,000. Act of vandalism on vending machine will result a huge force exerted on them, resulting the machines to be damaged. Therefore, CCTV itself is not sufficient to help monitoring the vending machine.

2.2. Inventory Management

One of the most available way of implementing IoT using smartphone is using Blynk platform. An example is a work done byAlharbi in 2019. Fahd Alharbi from King Abdulaziz University, Kingdom of Saudi Arabia develop a liquid level monitoring and control system by implementing IoT. The system scope is developing an IoT system to monitor and control liquid from a distributed tank system. His prototype uses ultrasonic sensor to monitor the liquid level water pump to control it, Arduino board as the controller, and ESP8266 as wireless Wi-Fi module. The system is monitored and controlled over the internet via the Blynk platform. Since the platform has shown a very promising result, the same method will be implemented for this project.

2.3. Data Analyzation using Thingspeak

ThingSpeak is IoT platform developed by MathWorks, the developer of MATLAB. It allows the user to store and collect any data into their cloud and server. Kumar, Jilani, Hussain, & Raju.K, (2015) developed a project by collecting data from MPU6050 and upload it to ThingSpeak. This project used Raspberry Pi 3B+ to transmit a data and used Python for the processing. The project’s aim is to send the readings of 3 axes accelerometer and 3 axes gyroscope by various hand gestures to ThingSpeak. Considering the efficiency of the software, the same method will be applied.

3. Materials and Methods

There are two section that need to be designed before the actual implementation can be made, which are the software and the hardware.

Based on Figure 1, LED, buzzer, LCD monitor, servo motor, ESP32, MPU6050 and push button, are group together as they are the main components used to build the vending machine. All components will be controlled by ESP32 microcontroller. The ESP32 then will send the data to Blynk. From Blynk, the data will be sent to ThingSpeak for data analysis.

(3)
(4)

Figure 3.Flow chart for inventory management

A solution needs to be designed for security features and inventory management, since the project focused on these two features.Based on Figure 2, the security feature starts by turning on the MPU6050. The MPU6050 accelerometer then will read the linear acceleration. If the acceleration is more than parameter set, it will sound the alarm and send the data to ESP32, ESP32 will send notification to Blynk and the data will be sent to

(5)

ThingSpeak.Whenemergency button from Blynk interface is pressed, the vending machine operation will stop and not in operational. Once it is released by the owner by pressing the button from Blynk interface, the machine will operate just as usual.On the other hand, based on Figure 3, once the vending machine is turned on, it will wait for coin to be inserted, once the coins reached total RM1.00 or more, the products can be selected. After a product is selected, it will be dispensed and the inventory such as amount of money and items will be updated to Blynk and the data will be sent to ThingSpeak. If the inventory is updated from the Blynk, the amount of inventory will be updated in the vending machine.

The selection of hardware that will be used for this project is based on the literature review, the availability, and the success rate that they can give. The MG996R servo motor with a maximum stall torque of 11 kg/cm will be used since the library is compatible with the ESP32 microcontroller. Apart from that, the MPU6050 sensors module, or the Micro Electro-Mechanical Systems (MEMS), which consists of a axis Accelerometer and 3-axis Gyroscope will also be implemented in this project to detect the force done on the vending machine. For the microcontroller board, the Espressif ESP32 DevKitC by Espressif which supports Wi-Fi and Bluetooth connection and has higher memory, storage and clock speed compared to Arduino Uno and NodeMCU ESP8266 is selected for the project design and implementation. Other than that, buzzer, LED, push buttons and LCD screen are also going to be used to mimic the alarm siren and light, to drive away the criminal from continuing stealing or vandalizing the vending machine, to imitate coin dispenser of vending machine, and to display commands of coin dispenser. The Push buttons in this project will be divided into 3 groups; to insert the amount of money, to select the product, and to reset the values of vending machine inventory. The LCD screen will emulate the function of display monitor of a real vending machine as visual interface between the machine and the customer.

Mostly, the software is based on the selection of the hardware used. The primary focus is to ensure the workability of the hardware, the integration, and the result that it can produce. The main software that is going to be used is Arduino IDE. It is used to program the ESP32 because of its compatibility with all the hardware used in this project. Most of programming for the hardware can be downloaded from Arduino libraries and plenty of tutorials are available. Next, Blynk is the most popular IoT platform designed to connect devices to the cloud, design mobile and web apps to control them, and manage thousands of deployed products. To use Blynk in this project, Blynk library specifically BlynkSimpleEsp32 is used. Blynk app also need to be installed to a smartphone to make an UI for the owner and the project. The design of vending machine for this project will be made in SolidWorks. SolidWorks is Computer Aided Development (CAD) software that can create 2D and 3D models. It is very easy to use and regarded to be more user- friendly than other CAD software. The dimensions of the project and the components’ positions are also determined in SolidWorks. For the circuit design and simulator, EasyEDA software will be used. It is a web based electronic design automation software. Unlike Proteus, it needs an account and connected online to store any project made. EasyEDA is used instead of Proteus because it has more component libraries. Finally, the open-source IoT platform known as ThingSpeak is used to receive the data from Blynk, which is transmitted from ESP32. Data will be collected is the number of alarms, the amount of money paid, amount of money stored, amount of item 1 and amount of item 2.

4. Results and Discussion

4.1. Security features

MPU6050 required 5V power source to operate. This sensor only can be used using I2C communication. Buzzer and LED was set up as usual as using Arduino Uno. If any of the acceleration X, Y and Z from MPU6050 exceeds 0.2, buzzer and LED will be turned on. Figure 4 shows the LED and the buzzer turned on after the acceleration reached 0.2.

Using MPU6050_tockn (Takuto Sato, 2019), the acceleration of X, Y and Z axes can quickly be obtained, then it can be uploaded to Blynk. The ESP32 was programmed to send alarm notification to Blynk once the readings reached certain parameters, the parameters set for Acceleration X, Acceleration Y and Acceleration Z were 0.2 m/s. When the readings reached their parameters, the owner will automatically be notified by Blynk app using Notify function. Figure 5 shows Blynk app GUI for security feature and Figure 6 shows the Notify function displayed “VENDING MACHINE COMPROMISED” text.After being notified, the Emergency Button can be pressed by the owner to freeze the vending machine function and turn off the LCD screen. The purpose of freezing the machine function and turn off the LCD was to deceive the criminals that the machine was not operational.

(6)

Figure 4.Alarm turned on

(7)

Figure 6.Blynk notify function to user

4.2. Inventory management

There were five push buttons, divided into three groups. Group A; yellow and green push buttons for coin numbers, Group B; blue and white push buttons for item picking and Group C; red push button for resetting amount of money and items. Figure 7 shows the push buttons for vending machine.The LCD at first will display “Insert money” and “Amount of money:“texts. The “Amount of money:” text shows the amount of money inserted by the customer. Once the amount of money reaches RM1.00, the LCD will display “Pick an item”. If the blue button is pressed, LCD will display “Item 1 picked” and if the white buttonis pressed, “Item 2 picked” will be displayed. After 2 seconds, the screen will restart back to the beginning. Figure 8 shows LCD monitor after selecting an item.There were two servo motors for each Item 1 and Item 2. The motors were attached to a large spring and items will be put between the helices. When blue button is pressed, motor 1 will be rotated and when white button is pressed, motor 2 will be rotated.

The amount of money and items stored in the vending machine can be monitored by the owner through the data received from ESP32. The data such as the amount of money being paid, the amount of money stored, the number of item 1 and 2 can be displayed using many value displays. Figure 9 shows the Blynk UI for inventory management. If the amount of money stored reaches RM10.00 and either amount of item 1 or 2 reaches 1, Blynk will notify the owner as reminder for refilling. Figure 10 shows the notification function. The owner can stop the machine from being used by customer for maintenance purpose. The LACK can be pressed to stop the machine from operating and the LCD monitor will display “Under maintenance”, as shown in Figure 11.

(8)

Figure 8.LCD monitor displays "Item 1 picked"

Figure 9.Blynk UI for inventory management

(9)

Figure 11.LCD monitor displays "Under maintenance"

4.3. Data analysis

The readings from ESP32 can be displayed in Blynk app using SuperChart function. TwoSuperChartwere made, first was for the number of alarms triggered and second was for the inventory management. Figure 12 shows the SuperChartfor inventory management. Blynk must use Webhook function and send it to ThingSpeak using API key provided by ThingSpeak for uploading the data. In this project, there were fiveThingSpeak fields for five readings; Field 1 was for the number of alarm triggered, Field 2 was the amount of money being paid, Field 3 was the amount of money stored, Field 4 was for the amount of item 1 left and Field 5 was for the amount of item 2 left. Figure 13 shows ThingSpeak Field for 3 graphs.

Figure 12.Blynk UI for inventory management

Figure 13.Field 4 shows the amount of item 1

ThingSpeak has a feature to export the data in form of CSV file. The data was sort in time set by the user. Since there were five channels used in this project, there will be five columns in the CSV that can be analysed. Below tables were made by calculating the data from the CSV file. Table 1 shows the sum of each field. Based on Table 1, the vending machine makes the most revenue in March by RM8402.70 profit and item 1 was more

(10)

popular than item 2 with item 1 sold for 8509 units than item 2 with 5857 units. Table 2 shows the number of alarms based on time in each month.

Table 1.Sum of each field

sum field 1 sum field 2 sum field 3 sum field 4 sum field 5

March 3320.3 2967.5 4574.9 5031 2398

April 353 73 3431.9 2442 2537

May 155 0.3 1.3 95 94

June 4040 33.6 694.6 941 828

Total 7868.3 3074.4 8702.7 8509 5857

Table 2.Amount of alarms triggered based on time

24hours 0800 to 1200 1200 to 1600 1600 to 2000 2000 to 0000 0000 to 0400 0400 to 0800 March 114 170 0 3036.3 0 0 April 177 40 0 165 0 0 May 155 0 0 0 0 0 June 332 40 0 165 0 0 Total 778 250 0 3366.3 0 0

Based on Table 2, the machine experience highest amount of alarm triggered between 8p.m. to 12a.m., which means in those time the machine was in the most vulnerable time and the operator must be on the highest caution to receive the alarm from that time. Table 3 shows the sum of money being paid sorted into 6-time frames.

Table 3.Amount money paid based on time 24hours 0800 to 1200 1200 to 1600 1600 to 2000 2000 to 0000 0000 to 0400 0400 to 0800 March 52.1 85.7 0 2829.7 0 0 April 12.6 68.8 0 137.4 0 0 May 0.3 0 0 0 0 0 June 6.7 26.9 0 0 0 0 Total 71.7 181.4 0 2967.1 0 0

The higher amount of money paid means the higher usage of the vending machine by the user. Based on Table 3, the machine was least used during 4p.m. to 8p.m., 12a.m. to 4a.m. and 4a.m. to 8a.m., this shows those time were the moment the machine was least busy and suitable for refilling. While the machine experience highest usage between 8p.m. to 12a.m., which was not a suitable time for refiling.

5. Conclusion

It is concluded that this project achievedall its objectives. The security features and inventory management features were completed. The testing shows by detecting the amount of force exerted on the vending machine, the machine can be protected from theft and vandalism. The best speed of accelerometer that resembles human aggression is 0.2, by setting the MPU6050 to detect the force, the machine can now avoid from being harmed. Using Blynk app together with a microcontroller that supports Wi-Fi connection, the vending machine inventory can be managed using IoT (Hussain et al. 2020). Each function in vending machine such as inserting money and dispensing items were programmed to give their input into the app, and they are also can be controlled from the app.

The ESP32 and Blynk was able to upload the data to ThingSpeak for both security feature and inventory management from the vending machine. The process is done via Blynk app. Each data was able to be displayed in ThingSpeak and can be downloaded in CSV form. This way data can be analysed for further study related to vending machine such as the sales of the items, the security of the vending machine location and the least busy time of the vending machine operation.

There are a lot of improvements can be done to this project. The sensor used for force detection needs to be more responsive but maintaining more accurate reading. The sensor needs to be able to detect such abnormal force but not too sensitive that it alerts the alarm in inappropriate condition. For inventory management, more functions need to be put to the vending machine so it can resemble a real vending machine better. This way the

(11)

inventory management can be proved to be working in real life. The data uploaded to ThingSpeak needs to be more accurate for better data analysis. This can be done by refining the program or by uploading it to a local server.

References

1. Alharbi, F. (2019). Wireless Tank Control And Monitoring Using IoT. International Journal of Mechanical Engineering and Technology, 10(11), 192–198.

2. BEN BLACK. (2018). Making Money With Vending Machines(Not how you think) - Dynastus. Retrieved on May 21, 2020, from https://www.dynastus.com/making-money-with-vending-machines/ 3. Floyd Purkey, J. (1998). Patent No. 5706976. Retrieved on May 21, 2020, from

https://doi.org/US005706976A

4. Fuad, F. (2019). Kumpulan Gedegang tumpas. Retrieved on October 2, 2019, fromhttps://www.bharian.com.my/berita/kes/2019/05/564913/kumpulan-gedegang-tumpas

5. Hussain, A., Manikanthan, S.V., Padmapriya, T., Nagalingam, M. (2020). Genetic algorithm based adaptive offloading for improving IoT device communication efficiency. Wireless Networks, 26 (4), pp. 2329-2338.

6. Kumar, M. R., Jilani, S. A. ., Hussain, S. J., & Raju.K, P. R. R. (2015). An Automated ThingSpeak System representing MPU6050 Sensor data using Raspberry PI. International Journal of Engineering Trends and Technology, 29(1), 29–34.

7. Schwartzendruber, W. (1993). Patent No. 5207784. Retrieved on May 21, 2020, fromhttps://doi.org/US5207784A

8. Shea, P. (2002). ATM Security, Part 1: Protecting against brute force theft. Retrieved on October 24, 2019, from https://www.atmmarketplace.com/articles/atm-security-part-1-protecting-against-brute-force-theft/

9. S.V. Manikanthan, T. Padmapriya. An Efficient based Routing Protocols in Forecast Model for MANET – IoT. Solid State Technology. Vol. 63 No. 3 (2020).

10. Takuto Sato. (2019). GitHub - tockn/MPU6050_tockn: Arduino library for easy communication with MPU6050. Retrieved on May 21, 2020, from https://github.com/tockn/MPU6050_tockn

11. Thomas, E. (2019). Man targets vending machines, causing $20,000 worth of damage in string of school break-ins. Retrieved on October 24, 2019, fromhttps://fox13now.com/2019/01/03/man-targets-vending-machines-causing-20000-worth-of-damage-in-string-of-school-break-ins/

12. Varga, S., Eagle, B., Desmarais, R., Cowling, R., D. Lemieux, M., & Hall, J. (1996). Patent No. 6181981. Retrieved on May 21, 2020, fromhttps://doi.org/US6181981B1

Referanslar

Benzer Belgeler

[r]

se*"7enbi Koç kadar uzun süre "1 num aralı işa d a m ı” unvanını sürdür­ memiş; onun kadar değişik alanlarda büyük şirketler kurmamış; onun kadar

Hepimiz bu mesut günün arefesini yaşarken Adananın temiz si­ ması altında bir kültür kalesi gibi yükselecek olan Halkevi ve Parti binasının memlekete vereceği maddi

Tarih ve dil konulannda yazılmış Türkçe ki­ taplar üzerine de Atatürk işa­ retler ve notlar koymuş, beğen­ diği cümlelerin altını çizmiştir.

27 Nisan 2020 tarihi: Türkiye’de ilk kez, günlük iyileşen hasta sayısı, o günkü vaka sayısının iki katını geçerek, iyileşen toplam hasta sayısı

Kafetsios (2003) çalışmasında toplam duygusal zeka puanları ve duygulardan yararlanma, anlama, duyguları düzenleme gibi faktörler ile güvenli bağlanma arasında orta

Tipografi jenerik kısmında bilgi aktarımı sağlayarak bir jeneriğin olmazsa olmaz unsuru haline gelmiştir.” Film afişleri ise, grafik tasarımın olanaklarının sinema

In a study exploring the impact of core lower extremity strength exercises on the dynamic balance of basketball players, it was established that the balance skills