You are on page 1of 4

XIV Международная научно-техническая конференция АПЭП – 2018

Development of a Sound Recognition System Using


STM32 Microcontrollers for Monitoring the State of
Biological Objects
Vali Kh. Abdrakhmanov1, Renat B. Salikhov 2, Konstantin V. Vazhdaev1,2
Physical-Technical Institute, Bashkir State University, Ufa, Russia1
Architectural and Construction Institute of Ufa State Petroleum Technological University, Ufa, Russia2

Abstract – The analysis of the main trends in the development of II. PROBLEM DEFINITION
automation in the field of beekeeping, in particular the use of
modern network technologies, sound recognition technologies Judging by the publications in the network, it can be noted
for monitoring the state of bee-families. Considered the main that automation in the field of beekeeping in European coun-
existing recognition technologies, requirements for the hard- tries is widely introduced. This is due to the fact that bee-
ware of monitoring systems. The possibility of implementing a keeping develops mainly not only for the products of bee-
prototype based on the Arduino platform with Wi-Fi modules keeping, but because of the need for pollination of agricul-
ESP8266, advantages and disadvantages of this solution was tural plants, in addition bees play an important role in main-
considered. As a result, the conclusion of the feasibility of using
the 32-bit STM32 microcontroller with a core ARM Cortex-M4,
taining the stability of the entire biosphere. There are known
and for developing a prototype device - the foreign developments in monitoring systems of bee colonies:
STM32F4DISCOVERY evaluation board. The features of de- for example, Apis - the development of Portuguese beekeep-
velopment of projects on STM32, a choice of software for devel- ers [1], which allows you to monitor the status of hives re-
opment are also considered. motely, directly from your smartphone. This system can sig-
nificantly facilitate the life of both a beginner beekeeper and
Index Terms – monitoring the state of bee families, algorithms a professional, and the main thing is to significantly reduce
for artificial neural networks (neuronet), algorithms for fast the physical interference in the life of the bees themselves.
Fourier transform (FFT), speech recognition technology, Ar- The Apis monitoring system aims to make a "smart hive"
duino Due, IoT, ARM Cortex-M4, STM32F4DISCOVERY,
STM32Cube, CooCox IDE.
from each hive with a built-in temperature and humidity sen-
sor, bee counter and weights. All-important statistical data is
sent to a computer, smartphone, or tablet. In addition, the
I. INTRODUCTION European Union is completing the development of a device
for remote monitoring of the health of bees by monitoring
Automation in beekeeping would help solve several prob-
the sounds produced by them in the hive. The initiators of
lems. Let's consider the main relatively easily solved prob-
this project were the University of Trent (UK) and the Asso-
lems. Diagnosis of the state of beekeeping by sounds pro- ciation of Farmers of Great Britain (BFA). For the imple-
duced by a bee hive. In the summer period, you can deter- mentation of the project from the EU budget allocated 1.4
mine the different stages in the life of the hive: calm state,
million euros [2].
ventilation, singing of the uterus, swarm output, flying bees,
There are also domestic developments [3], where it is pro-
etc. Especially important is the ability to recognize the sing-
posed alongside monitoring, to realize also the regulation of
ing of the uterus; during the swarming period, the probability temperature and humidity in the hive (by installing an elec-
of bee-losses and beekeepers during this period are forced to tric heater in the hole of the lower tap) during wintering, and
constantly monitor the apiary, not having the opportunity to
also in the spring-summer period prior to the beginning of
go off for a while somewhere. In addition, many experienced
June Moment, when stable warm weather is established in
beekeepers carry out various measures to eliminate swarming
the central part of Russia) - at this time there is a sharp tem-
(make so-called layers, etc.), which can be quite labor-
perature drop, which requires large energy costs from the bee
intensive. During the wintering period, it is also possible to colony. The main element of the monitoring and diagnostics
determine the condition of the bee-family by sounds, for ex- device is the Atmel microcontroller. It is connected to digital
ample, to determine the situation of lack of food, disease of
temperature sensors DS1620, humidity HIH4000 and electret
bees, violation of the temperature regime in the winter hut,
microphone SG72.
increased humidity, etc., which require intervention by the
To diagnose the condition of bee families by sounds, you
bee-fisherman. To monitor the condition of the bee family, in
can use known and widely used speech recognition technolo-
addition to the sound signals of the hive, it is also advisable gies, with two fundamentally different recognition methods:
to remove the temperature in the hive, because The increased T2SI (text-to-speaker-independent, "person-independent",
temperature during the wintering of the whitefish reveals the
anyone can be speaking) and SD (speaker -dependent, the
disturbance of the bees. Also, the humidity in the hive is im-
one who taught the system should speak). Obviously, in our
portant - a change in humidity can also be an alarm.
device, the more easy to implement SD method will be more
170
978-1-5386-7054-5/18/$31.00 ©2018 IEEE

Authorized licensed use limited to: Monash University. Downloaded on August 29,2020 at 01:40:59 UTC from IEEE Xplore. Restrictions apply.
2018 14th International Scientific-Technical Conference APEIE – 44894

appropriate. The possibility of using a free voice recognition humidity in the spring-summer period will be too time-
service from Google servers such as Google ASR or Yan- consuming (it is necessary to tie the wires across the whole
dexSpeechKit [4] was considered, but this requires a constant apiary) for widespread introduction, but the ability to deter-
network connection, that for a battery device with Wi-Fi mine the state of swarming (the so-called singing of the uter-
modules ESP8266 [5], known for their high power consump- us) will be called for by beekeepers - After the swarm period,
tion, is unacceptable. the modules can be disabled and completely removed from
In addition, it must be said that these programs use a more the apiary. We also consider excessive and laborious control
complex "human-independent" T2SI method, whereas in our of the weight of the hive.
case, SD (speaker-dependent) is sufficient. Thus, it is clear For recognition, it is proposed to use algorithms of artifi-
that Google ASR or YandexSpeechKit speech recognition cial neural networks (ANN) [10], with a preliminary expan-
services can not be adapted to recognize the sounds of bees, sion of the frequency spectrum, for which use the algorithms
and it would be necessary to develop their own service with for Fast Fourier Transform (FFT) - there are libraries of 8-bit
their server. It is possible to refuse the transfer of all data to conversion [11]. Thus, we propose to implement monitoring
the server. The operating system for mobile devices Android on the sounds of the bee-family and the temperature in the
4.1 allows this, because there is a system of offline - speech hive.
recognition; Internet access is not required. Moreover, the It is proposed to periodically extract small samples of the
quality of recognition is reduced. But in our case, using An- signal from the microphone module, digitize it using an Ar-
droid - the device will be redundant and expensive, in this duino board, and only if a change in the state of the bee-
case it is desirable to avoid redundancy, because first of all. family is detected (for example, the singing of the uterus has
you need to minimize power consumption. been fixed) to include a Wi-Fi module. This will minimize
EasyVR Shield 3.0 speech recognition software [6] (shown the power consumption of the device, which is especially
in Fig. 1) was also considered, but this is too expensive a important due to the use of autonomous power. In view of
solution for beekeeping (price 50 Euro). the fact that large volumes of RAM are required for selec-
tion, high processing speed is suggested to be used by Ar-
duino Due [12] based on the 32-bit ARM Cortex-M3 86MHz
ARM, 512K flash + 96K RAM. Clones Arduino Due from
Chinese manufacturers can cost relatively under-the-go -
from 15USD. The use of the Arduino platform is usually due
to the low cost and a large number of ready-made modules
with libraries for their connection. In addition, you can easily
Fig. 1. EasyVR Shield 3.0
find a lot of information on devices already implemented on
this base. The lack of hardware support for digital processing
III. PROPOSED IDEAS FOR DEVELOPMENT of signals, support of operations for floating-point numbers,
the need for large computing power with low power con-
After analyzing the state of the problem, it is possible to sumption leads to the decision about the advisability of using
propose a fairly budgetary solution using the Arduino plat- 32-bit microcontrollers with the ARM Cortex-M4 core.
form, with the Wi-Fi module ESP8266 [5], the microphone The emergence and wide distribution of sufficiently budget
module [7], the Micro SD card [8] needed to store the sam- 32-bit microcontrollers STM32 with the ARM Cortex-M4
ples (shown in Fig. 2), the DS18B20 digital temperature sen- core, which differs by the built-in instructions for Digital
sor. The sampling frequency for the audio signal is usually Signal Processing (DSP) and Floating Point Unit (FPU) ,
taken at 48 kHz, but for the sounds of the hive it is sufficient allows them to be used for our development. And, despite the
to take the frequency band of 70..600Hz [9], and then it is high power and speed due to the peculiarities of the timing
obvious that the requirements for the microphone module system in ARM microcontrollers, it is possible to significant-
bandwidth are low - for the electret condenser microphone ly reduce power consumption. Particularly convenient for
CZN used in the microphone module [7] 20Hz..14kHz. Also, developing a prototype device is the STM32F4DISCOVERY
the sampling frequency of the signal can be reduced, which board [13] (shown in Fig. 2), based on the
will reduce the memory and speed requirements of the con- STM32F407VGT6 microcontroller [14] (Cortex M4,
troller in comparison with the known task of speech recogni- 168MHz, flash 1MB, RAM 192Kb). Of course, the presence
tion, for example. of DSP and FPU is especially valuable, which will speed up
the processing of sound, but also significantly higher clock
frequency, a large amount of RAM, as well as the presence
of a board-based digital microphone (ST MEMS sensor
MP45DT02).
In addition, there is an audio DAC with an amplifier of
Fig. 2. Wi-Fi module ESP8266-07, microphone module, SPI - reader mod- class D, which you can try to use to reproduce pre-recorded
ule for micro SD card. in memory samples of the uterus sounds in a calm state in
Thus, we propose to implement monitoring on the sounds order to calm, while digging, for example. Thus, it becomes
of the bee-family and the temperature in the hive. We believe possible to investigate the influence on the behavior of bees
that the implementation of the regulation of temperature and with the help of standard uterus sounds, which could possi-

171

Authorized licensed use limited to: Monash University. Downloaded on August 29,2020 at 01:40:59 UTC from IEEE Xplore. Restrictions apply.
XIV Международная научно-техническая конференция АПЭП – 2018

bly stop the swarming or slow it down. It is also possible to REFERENCES


use the ST MEMS LIS302DL motion sensor on the board
[1] Apis is a system for monitoring the health and activity of your bees.
and the outputs of the digital accelerometer in three axes for [Online]. Available: http://rodovid.me/pchelovodstvo/apis-sistema-
registration to change the position of the hive in space, some monitoringa-zdorovya-i-aktivnosti-vashih-pchel.html
vibrations and shock loads. This can be useful for recording [2] Monitoring the well-being of bees at a distance. It's already coming!
the fall or inclination of a hive when colliding with large [Online]. Available: http://bashkirskimed.ru/medovi-spravochnik/428-
animals, which can happen. For example, during a summer kontrol-samochuvstviya-pchel-na-rasstoyanii-eto-uzhe-gryadet.html
migration, and also for recording the torture of penetration [3] V.V. Semenov, A.R. Ganeev Automatic monitoring and management of
into the hive of rodents, which can occur in the winter when the family's state // Beekeeping, №9 2011. С.50
the hive is in the hibernation. It is also important that the [4] SpeechKit Speech Technology: Speech Recognition and Speech Syn-
controller has a controller module 10/100 Ethernet MAC, thesis. [Online]. Available: https://tech.yandex.ru/speechkit/
which will allow you to connect to the global network Inter- [5] ESP8266 Module WIFI for Arduino. [Online]. Available:
http://www.ebay.com/itm/ESP8266-Receive-AP-STA-Hot-Wireless-
net and display all current information - on the smart back-
Send-Transceiver-Module-WIFI-For-Arduino
ground of the beekeeper, for example. This connection is [6] EasyVR Shield 3.0 per Arduino Modulo Riconoscimento Vocale -
good for using the module in the hibernate, and for working Speech recognition. URL:http://www.ebay.com/itm/EasyVR-Shield-3-
in the summer conditions, of course, it is more convenient to 0-per-Arduino-Modulo-Riconoscimento-Vocale-Speech-recognition-
use wireless connection with Wi-Fi modules ESP8266 [5] /121925584067?_ul=RU
widely used in the Internet of things (IoT) and the "Smart [7] Microphone Sensor AVR PIC High Sensitivity Sound Detection Mod-
House" [15-18]. ule For Arduino. [Online]. Available:
When choosing a microcontroller for development, often http://www.ebay.com/itm/201414878181
follow the experience of its previous developments on 8-bit [8] Micro SD Storage Board. [Online]. Available:
widespread AVR and PIC [19] or Arduino platform[15,18]. http://www.ebay.com/itm/Micro-SD-Storage-Board-Mciro-SD-TF-
At the same time, for developing software, it is convenient Card-Memory-Shield-Module-SPI-For-Arduino-UR
[9] Sounds of bees. [Online]. Available: http://ep-
for beginners to get acquainted with the STM32 family by
z.ru/stroitelstvo/paseka/zvuki-pchyol
using the newly developed program - the CubeMX initializa-
[10] Artificial neural networks. [Online]. Available:
tion code generator [20] from STMicrorlectronics manufac- http://robocraft.ru/blog/algorithm/558.html
turer for setting (initializing) the core and peripherals, con- [11] Modified 8bit FFT. [Online]. Available:
necting libraries, generating an empty project. After the pro- http://forum.arduino.cc/index.php?topic=38153.msg282965#msg28296
ject is generated, you can transfer it to a convenient devel- 5
opment environment for the CooCox IDE [21]. Thus, it is [12] Arduino Due. [Online]. Available:
relatively easy to read and start working with STM32. https://www.arduino.cc/en/Main/ArduinoBoardDue
[13] STM32F407VG. High-performance foundation line, ARM Cortex-M4
core with DSP and FPU, 1 Mbyte Flash, 168 MHz CPU, ART Accelera-
tor, Ethernet, FSMC. [Online]. Available:
http://www.st.com/en/microcontrollers/stm32f407vg.html
[14] STM32F4DISCOVERY. [Online]. Available:
http://www.st.com/en/evaluation-tools/stm32f4discovery.html
[15] Development of automation tools using WI-FI-modules ESP8266 and
LPWAN-technologies. Abdrakhmanov V. Kh., Vazhdaev K. V.,
Salikhov R. B. Electrical and data processing facilities and systems.
Fig. 3. STM32F4DISCOVERY
2017. T. 13. № 4. P. 98-108
[16] Salikhov R. B., Abdrakhmanov V. Kh., Vazhdaev K. V. System of
IV. CONCLUSIONS monitoring and remote control of temperature conditions, climate and
heat consumption. In Actual Problems of Electronics Instrument Engi-
The analysis of the main trends in the development of au- neering (APEIE), 2016 13th International Scientific-Technical Confer-
tomation in the field of beekeeping is done, in particular the ence on (Vol. 3, pp. 171-174). IEEE.
use of modern network technologies, sound recognition [17] Intelligent system of living areas on the basis of information-measuring
technologies for monitoring the state of bee-families. The control systems. Vazhdaev K.V, AbdrakhmanovV.Kh., Salikhov R.B. /
main existing recognition technologies, requirements for the Electrical and data processing facilities and systems. - 2016. - No. 2. - T
hardware of monitoring systems are considered. The possi- 12. - P. 70-75.
[18] Research into the possibility of applying information and measurement
bility of implementing a prototype based on the Arduino
technologies and the Internet of things (IoT) in the agro-industrial com-
platform with Wi-Fi modules ESP8266, advantages and dis- plex. Abdrakhmanov V. Kh., Vazhdaev K. V., Salikhov R. B. Electrical
advantages of this solution were considered. As a result, the and data processing facilities and systems. 2017. T. 13. № 2. P. 85-95
conclusion was made about the advisability of using 32-bit [19] Abdrakhmanov V. Kh., Bikbaev N. N., Salikhov R. B. Development of
microcontrollers STM32 (shown in Fig. 3) with the ARM low-cost electronic training boards based on universal microcontroller.
Cortex-M4 core, and for developing a prototype device - the In Actual Problems of Electronics Instrument Engineering (APEIE),
STM32F4DISCOVERY evaluation board. Also features of 2016 13th International Scientific-Technical Conference on (Vol. 1, pp.
development of projects on STM32, a choice of software for 319-325). IEEE.
development are considered. [20] STM32Cube initialization code generator.
URL:http://www.st.com/en/development-tools/stm32cubemx.html

172

Authorized licensed use limited to: Monash University. Downloaded on August 29,2020 at 01:40:59 UTC from IEEE Xplore. Restrictions apply.
2018 14th International Scientific-Technical Conference APEIE – 44894

[21] CooCox IDE. Free/open ARM Cortex-M Development Tool-chain.


[Online]. Available: http://www.coocox.org/

Vali Kh. Abdrakhmanov in 1998 he was graduated


from Ufa State Aviation Technical University
(UGATU). In 2003 defended his Ph.D. thesis in the
USATU, then worked as an assistant professor at
the Department of Industrial Electronics at the
Faculty of Aviation Instrumentation of the USATU.
Now he works as an assistant professor of the
Department of Info communication Technologies
and Nanoelectronics at the Physics -Technical
Institute of the Bashkir State University, Ufa. His
field of scientific interests is automation and
control systems.

Renat B. Salikhov graduated in 1981 National


Research Nuclear University NNRU. In 1987, he
defended his Ph.D. thesis in the field of solid-state
physics. He was the head of the laboratory of fiber-
optic transducers OKB "Charger" in the 1990s,
assistant professor of general physics at the Bashkir
State Pedagogical University in the 2000s. At
present, he is the head of the department of info
communication technologies and Nanoelectronics
of the Physical and Technical Institute of the
Bashkir State University. Area of interest in re-
search and development - condensed matter phys-
ics, nanotechnology and electronics.

Konstantin V. Vazhdaev was graduated from Ufa


State Aviation Technical University (USATU) in
1998. In 2003 defended his Ph.D. thesis in the
USATU. Then he worked as an assistant professor
at the Department of Information and Measurement
Technology of the Faculty of Aviation Instrumenta-
tion UGATU. Currently, he works as an assistant
professor of the Department of Infocommunication
Technologies and Nanoelectronics at the Physico-
Technical Institute of the Bashkir State University,
city of Ufa. His field of scientific interests is
information and measurement technology.

173

Authorized licensed use limited to: Monash University. Downloaded on August 29,2020 at 01:40:59 UTC from IEEE Xplore. Restrictions apply.

You might also like