SUGISAKAMASANORI

Journal of Advances in Artificial Life Robotics
Vol. 1(3); December (2020), pp. 158–162
ON LINE ISSN 2435-8061; ISSN-L 2435-8061
https://alife-robotics.org/jallr.html

Research Article

Automatic Classification and Recovery System of Beverage
Bottles Based on STM32
Fengzhi Dai1,2, Yuqi Yan3, Longyu Gao1

Tianjin University of Science and Technology, China
Tianjin Tianke Intelligent and Manufacture Technology CO., LTD, China
3
Wuhan University of Technology, China
12

ARTICLE INFO
Article History
Received 25 October 2019
Accepted 17 August 2020
KeywordsClassification
Mini programWebIntegrals

ABSTRACTAt present, the problems of environmental pollution and resource waste in China need to be solved.
The existing beverage bottle recycling system in the market has the problems of high cost,
imperfect function and inflexible rebate mode. Based on the sensor detection technology, the WiFi
wireless communication and software development technology, this paper designs acomprehensive system of beverage bottle classification and recycling, which includes intelligent
classification and recycling machine, Mini Program and Web remote monitoring platform. The
system can automatically identify and classify metal bottles and plastic bottles, and can give users
integrals, which has certain environmental protection significance.

© 2022 The Author. Published by Sugisaka Masanori at ALife Robotics Corporation Ltd.
This is an open access article distributed under the CC BY-NC 4.0 license(http://creativecommons.org/licenses/by-nc/4.0/).

1. Introduction

maintenance cost is high, the function is not perfect, therebate mode is not flexible enough, and has not been
widely promoted in the market. Therefore, it is necessary
for the society and the market to develop a set of beveragebottle automatic classification and recycling system whichis easy to promote.

At present, due to people's weak awareness of garbage
classification, a large number of recyclable resources are
put into the garbage system, resulting in the waste ofrecyclable resources. According to statistics in 2017,
discarded beverage bottles accounted for up to 30 to 40
percent of household waste. Waste beverage bottles havehigh recycling value, such as waste plastic bottles can bemade into elastic fiber, textiles and fuel after being
correctly processed, while waste cans can be recycled
100% to rebuild new cans. It can be seen that the waste
beverage bottles that seriously pollute the environment areactually valuable resources in the wrong place, andeffective measures must be taken to recycle them.
At present, the recycling rate of waste beverage bottles
in China is far lower than that in other developed countries.
The beverage bottle recycling system in the market canrealize the round-the-clock recycling function, which
improves the resource recovery to a certain extent, and also
brings economic benefits to investors. But its cost and2. Overall design scheme of the system
According to the actual application scenarios and market
demand, combined with sensor detection technology, WiFi
wireless communication technology and softwaredevelopment technology, this paper designs an automatic
beverage bottle classification and recycling system basedon STM32, including intelligent classification andrecycling machine, WeChat Mini Program and Web
remote monitoring platform.
The intelligent sorting and recycling machine canidentify and classify the plastic and metal bottles
automatically, which avoids the secondary pollution
caused by users' mixed throwing, and reduces theCorresponding author’s E-mail: daifz@tust.edu.cn, URL: www.tust.edu.cn158

3.1. Main control chip

maintenance cost in the later stage. The recovery machineis also equipped with automatic counting, voice prompt,
overflow alarm and the detection of ambient temperatureand humidity and other functions, and through wirelesscommunication to upload all data information to the server
in real time.
User can use the WeChat applet to scan the code of theequipment on the recycling machine and then place thebeverage bottles. The system will return the corresponding
points according to the material and number of thebeverage bottles. The method of using WeChat Mini
Program to get points is more flexible than the traditional
method of swiping IC card to get points, which effectively
improves the user experience. The Web remote monitoring
platform can monitor the running state of the intelligent
recycling machine in real time. The administrator canreceive the automatic alarm information of the recyclingmachine and take measures in time. The overall structureof the automatic classification and recycling system ofbeverage bottles based on STM32 is shown in Figure 1.

In this system, STM32f103vet6 is selected as the core
controller of the hardware control system, which is mainly
used to realize the functions of data acquisition andanalysis, motion control of executive components, etc. The
processor of STM32f103vet6 is Arm Cortex-M3 highperformance kernel, with the maximum working
frequency of 72mHz, flash memory of 512KB, SRAM of64KB, and packaging form of lqfp64. Its peripheral
configuration is powerful, supporting SPI interface, I2Cinterface, USB interface, USART interface and othercommunication interfaces, as well as ADC, timer and otherperipheral devices [1].
3.2. Voltage stabilizing module
The power supply module is responsible for power supply
for each module of the system. The power supply voltage
required by each module of the system is different: thepower supply voltage required by the actuator is 12V, thepower supply voltage required by MCU and Esp8266 WiFi
module is 3.3V, and that of peripheral modules such as
sensors is 5V. Therefore, the main power supply of thesystem is 12V DC power supply, and the voltage
stabilizing module adopts Ams1117 series voltage
stabilizing chip to stabilize the voltage, so as to meet all
power supply requirements.
Ams1117 voltage regulator chip belongs to linear
voltage regulator chip (LDO), and the pressure difference
between input and output shall not be less than 1.3V. This
series of chips have two versions: adjustable voltage
stabilizing output and fixed voltage stabilizing output. Thissystem uses Ams1117-5.0 and Ams1117-3.3 chip tostabilize voltage, and its package form is SOT-223 chippackage. As ripple may occur during power supply and thepeak voltage may cause the main control chip to burndown, it is necessary to filter the output voltage, and thecontrol voltage amplitude is within 5%. When using
Ams1117 voltage stabilizing chip, a capacitor shall beconnected in parallel at the input and output terminals
respectively for filtering. The voltage stabilizing circuit ofAms1117-5.0 and Ams1117-3.3 is shown in Figure 2.

Fig.1. The overall structure of the automatic classification andrecycling system of beverage bottles based on STM32

3. Design of hardware control system
In this system, STM32F103 single-chip microcomputer isselected as the core controller, and the control system
functions are realized by combining the peripheral
modules. The hardware control system mainly includes:
core controller, power module, WiFi communication
module, each sensor module and other peripheral modules.
The following describes the parts of the hardware control
system.

159

bottle is close to the magnetic field, it will absorb theenergy of the alternating magnetic field, which will cause
the vibration attenuation and stop. The changes ofoscillator oscillation and stop oscillation are processed by
the subsequent circuit and converted into a switch signal.
The physical drawing of metal sensor is shown in Figure
4.
Fig.2. 5V and 3.3V voltage stabilizing circuit

3.3. Motion actuator
The actuator of intelligent sorting and recycling machineis zsm14k12 steering gear. The working voltage of thesteering gear is 9.5V-12V, the electrical standard of thecontrol signal is 5.0V TTL signal, and the maximum
working angle is 270o. Zsm14k12 actuator works fast andhas stable performance. Its control mode can be serial
control or PWM control. The actuator can quickly respondto the movement command of the system, and transfer
different kinds of beverage bottles to the corresponding bin.
The appearance of the steering gear is shown in the Figure3.

Fig 4 Physical figure of metal sensor

3.5. Wireless communication module
Esp8266 wireless communication module is selected tosend the data collected by the hardware terminal to theserver. The Esp8266 module provides a complete WiFi
network solution with a built-in 32-bit low-powerprocessor. Because of its low cost, high performance andsmall size, the module is widely used in smart home,
wearable electronic equipment, wireless positioning andother fields.
TCP is a link oriented and reliable protocol. It needs towait for the confirmation of the receiver to establish aconnection [2]. It is safe and reliable and can ensure dataintegrity. In this system, the esp8266 module uses TCP
protocol to set the WiFi application mode of Esp8266 assta mode and select TCP connection through at command,so as to realize the function of establishing data connection
with ECS. The Esp8266wifi module is shown in Figure 5.

Fig.3. The appearance of the steering gear

3.4. Material identification module
Material identification is an important function of thehardware control system of the intelligent sorting andrecycling machine. The function of material identification
depends on the metal sensor module. The system candistinguish the metal bottle from the plastic bottle throughthe metal sensor. LJ18A3-8-Z/B type metal sensor is usedin this system. The sensor has the advantages of fast
response, strong anti-interference, waterproof andcorrosion resistance, and very stable performance. It is
often used in automatic assembly line, intelligent hardware
and security system.
The working voltage of the sensor is 6-36vdc, which iscomposed of high frequency oscillation circuit, detection
circuit, amplification circuit and output circuit.
After the normal power supply of the sensor, the oscillator
generates an alternating electromagnetic field on thedetection surface of the sensor. When the metal beverageFig.5. ESP8266 Profile Diagram

4. System server design
This paper selects Alibaba cloud server and builds a Wamp
framework for server development, providing services
such as communication management, data storage andprocessing, logical analysis, API interface, etc. for thewhole system. The applet is configured with the relevant
domain name, and the self-built server can be accessed
through HTTPS protocol to realize communication. The
developed web management platform is deployed to the160

Acknowledgements

ECS, and the administrator can log in to the web
management platform with a browser to remotely monitor
the real-time running status of the recycler.

The research is partly supported by the Project of Tianjin
Enterprise Science and Technology Commissioner toTianjin Tianke Intelligent and Manufacture Technology
Co., Ltd (19JCTPJC53700). It is also supported by theIndustry-University Cooperation and Education Project(201802286009) from Ministry of Education, China.

4.1. Socket network communication
This system selects the Alicloud server as the TCP server,
and designs the TCP console software according to thesocket communication principle. Socket is in the form of(host IP address: port number), which is located between
the application layer and the transport layer of TCP/IP
protocol [3]. Using socket can quickly and stably establish
the communication connection between TCP client andserver.
The ECS waits for and accepts the TCP connection
request from the hardware terminal by running thesocket.py file. The data collected by the intelligent sorting
and recycling machine is stored in the database.
4.2. WAMP framework
The common Wamp application framework is selected forthe server development of this system, which is composedof windows, Apache, MySQL and PHP. Windows is theoperating system. Apache is the website server. MySQL isthe relational database. PHP is the backgrounddevelopment script language. They are independent inthemselves, but they are often combined to build the server
due to their good compatibility [4].

References
1.Honghua Liao, Hao Fu, Weichuang Yu, et al. Design andImplement of Pyroelectric Energy Harvester Experimental
Measurement System Based on STM32F103VET6. Sensors &Transducers. 2016, 196(1): pp.69-74.
2.Joonhyouk Jang, Jinman Jung, Yookun Cho, el at. Design of aLightweight TCP/IP Protocol Stack with an Event-Driven
Scheduler. Journal of information science and engineering: JISE,
2012, 28(6): pp.1059-1071.
3.Mehmet S. Unluturk, Mehmet H. Ozcanhan, Gokhan Dalkilic.
Improving communication among nurses and patients. Computer
Methods and Programs in Biomedicine, 2015, 120(2): pp.102112.
4.Yasir Shoaib, Olivia Das. Web Application Performance
Modeling Using Layered Queueing Networks. Electronic Notes
in Theoretical Computer Science, 2011, 275: pp.123-142.
5.Bhaskar Kumar, Kumar Abhishek, Akshay Deepak, M. P. Singh.
Implementation of Interactive Real Time Online Co-shopping
Using Push AJAX. Procedia Computer Science, 2016, 89:
pp.473-482.
Authors Introduction

5. Client development
Dr. Fengzhi DaiThis project uses the Wechat developer tools to develop
mini programs based on Mina framework. After the user
logs in to the applet, click the scan code button on thenavigation bar at the bottom of the main page to scan theQR code of the device on the recycling machine. After thescanning, user can enter the throwing page. After the user
throws the drink bottles, the system will send thesettlement by itself and return the corresponding points tothe user's account. The function of small program scanning
QR code mainly depends on calling wx. Scancode ( )interface.
The web management platform of intelligent
classification and recycling system is developed based on
B/S mode, and Ajax technology is used to realize
asynchronous request operation of web pages. Ajax
implementation does not load the entire page, the part ofthe content of the page is updated quickly [5]. After
logging into the website, the administrator can enter thedynamic monitoring interface, which can remotely
monitor the operation status of the intelligent sorting
reclaimer in real time.

He received an M.E. and Doctor ofEngineering (PhD) from the Beijing
Institute of Technology, China in 1998
and Oita University, Japan in 2004
respectively. His main researchinterests are artificial intelligence,pattern recognition and robotics. He
worked in National Institute ofTechnology, Matsue College, Japan from 2003 to 2009.
Since October 2009, he has been the staff in Tianjin
University of Science and Technology, China, where he iscurrently an associate Professor of the College of Electronic
Information and Automation.

161

Mr. Yuqi Yan

reading and so on.
Mr. Longyu Gao

He majored in mechanical engineeringin Wuhan University of Technology，China, majoring in mechanical design
andmanufacturing,automatic
programming and other related courses.
During his study, he learned relevant
knowledge of STM32 microcontroller
and conducted relevant experiments,
involving motor control, sensor data

He majored in automation in college ofElectronic
Information
andAutomation, Tianjin University of
Science and Technology. He learned
SCM and data crawler and otherrelated knowledge, and achieved
certain results in relevant professionalcompetitions.

162