Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

2021 International Electrical Engineering Congress (iEECON2021)

March 10-12, 2021, Pattaya, THAILAND

Smart Street Lamp System using LoRaWAN and


Artificial Intelligence PART I
Natthaporn Saokaew Nuttapol Kitsatit Thanadol Yongkunawut
Department of Electrical Engineering Department of Electrical Engineering Department of Electrical Engineering
Faculty of Engineering, KMUTT Faculty of Engineering, KMUTT Faculty of Engineering, KMUTT
Bangkok, Thailand Bangkok, Thailand Bangkok, Thailand
2021 9th International Electrical Engineering Congress (iEECON) | 978-1-7281-9584-1/20/$31.00 ©2021 IEEE | DOI: 10.1109/iEECON51072.2021.9440337

Email: Natthaporn.sn@mail.kmutt.ac.th Email: Nuttapol.k@mail.kmutt.ac.th Email: Thanadol.tnd@mail.kmutt.ac.th

Piyasawat Navaratana Na Ayudhya Ekkachai Mujjalinvimut Tirasak Sapaklom


Department of Electrical Engineering Department of Electrical Engineering Department of Electrical Engineering
Faculty of Engineering, KMUTT Faculty of Engineering, KMUTT Faculty of Engineering, KMUTT
Bangkok, Thailand Bangkok, Thailand Bangkok, Thailand
Email: Piyasawat.nav@mail.kmutt.ac.th Email: Ekkachai.muj@kmutt.ac.th Email: Tirasak.sap@kmutt.ac.th

Preecha Aregarot Jakkrit Kunthong


Office of Building and Ground Department of Electrical Engineering
Management, KMUTT Faculty of Engineering, KMUTT
Bangkok, Thailand Bangkok, Thailand
Email: preecha.are@kmutt.ac.th Email: Jakkrit.kun@kmutt.ac.th

Abstract— This paper presents the design of a smart several kilo bytes per second) and consume low
street lamp system around a football field at King power [2]. LoRaWAN is therefore often referred to
Mongkut's University of Technology Thonburi as the best technology in the Internet of Things (IoTs)
(KMUTT). The system utilized the LoRaWAN wireless applications where low speed remote communication,
communication protocol transmit at a distance over 500
low energy, high link budget, and superior resistance
meters between multiple LoRa nodes (Heltec Cubecell
HTCC-AB01 boards) and a LoRaWAN gateway. By to interference is required [3].
combining LoRaWAN, cloud computing server and According to the World Energy Outlook
Artificial Intelligence technologies. The smart street organization, overall energy demand is set to drop by
light system is able to detect 4 object classes (pedestrian, 5% and as much as 10% in some regions globally in
bicycle, motorbike, and vehicle) and control street the year 2020 due to Covid-19. However, there are
lamps around the KMUTT football field at night. some exception to this forecast including Thailand
Multiple IP cameras were place around the football where the country’s energy consumption is rising by
fields and a Nvidia Jetson nano AI board process 1.8% according to the Energy Policy and Planning
images information. When AI is detected at least one
Office (EPPO). With increase energy demands, the
object class, the smart street lamp will increase the
lamp’s brightness to 100%. If no object is detected for a need to save energy is more important than ever. By
period of time, the lamp’s brightness decreases 50% to deploying LoRaWAN wireless technology in
save the energy unless more object is detected. conjunction with Artificial Intelligence (AI) image
processing algorithm, smart street lamps, an energy
saving system is presented in this paper. The system
Keywords— LoRaWAN, AI, Cloud Computing, Smart consisted of multiple LoRaWAN nodes, a LoRaWAN
Street Lamp, IP Camera, Nvidia Jetson Nano, KMUTT gateway, an AI processing unit (NVidia Jetson
Nano), IP cameras, a Node-red software and a Cloud
I. INTRODUCTION computing server.
WiFi and Bluetooth wireless communication It is noted that this article will be focusing on the
technologies are very popular since they are LoRaWAN communication datalink and the street
ubiquitous and easy to use. One drawback for these lamps brightness control. The next paper (part II) will
communication technologies however is the focused on the intelligence (AI) – image processing,
communication range [1]. LoRaWAN or Long- the underline decision making algorithm and the
Range Wide Area Network is a wireless cloud computing server software process.
communication technology that consume low energy
while offering extremely long range when compare to II. System Description
many other wireless technologies such as WiFi, A. System Overview
Bluetooth, Zigbee, Z-Wave, LTE-M and NB-IoT.
The system overview is summarized by Fig. 1
With these advantages, LoRaWAN is perfectly
below and the LoRaWAN node deployed in this
suitable for long distance remote wireless
project is the Heltec Cubecell HTCC-AB01 board (as
communications (many kilometers) that do not
shown in Fig. 2) attached to the street lamp driver
require high speed communication (data rate up to
circuit to control the lamp’s brightness. These street

978-1-7281-9584-1/21/$31.00 ©2021 IEEE


189

Authorized licensed use limited to: Univ of Calif Santa Barbara. Downloaded on July 01,2021 at 04:05:29 UTC from IEEE Xplore. Restrictions apply.
2021 International Electrical Engineering Congress (iEECON2021)
March 10-12, 2021, Pattaya, THAILAND

lamps were installed around the university’s football It can be seen that various information as show
field. Each LoRaWAN node continuously listening in Fig. 3 must be included in the arduino code before
for commands from the LoRaWAN gateway located it can be programmed into the LoRaWAN nodes.
on top of the class room building 4 (CB4) at a Unique parameters such as deviceEUI, AppEUI and
distance of approximately 500 meters away. AppKEY are require for the node to communicate
with the gateway [4]. The same deviceEUI, AppEUI
and AppKEY must be preprogrammed into the
gateway and the nodes. Any mismatch information
will result in both devices will not be able to
communicate to each other. Since the node units are
powered by an AC power supply, the LoRaWAN
class can be set either class A or C. LoRaWAN class
A will consume more energy since both devices
(gateway and nodes) are on all the time. LoRaWAN
class C is essential for a battery operation. Since
LoRaWAN class C require the least power when
compare to the class A and B due to both gateway
and nodes only transmit and receive at a pre-
Fig. 1. System Overview determine period [5].

The system helps save electricity energy by C. Smart Street Light On/Off and Brightness Control
setting the street lamp brightness at 50% when the AI The smart street lamp brightness control is based
image processing detecting no pedestrian, bicycle, on the lamp’s driver, a Bipolar Junction Transistor
motorcycle and vehicle around IP camera looked out (BJT) circuit, and the Pulse Width Modulation
areas. As the camera detected the objects (people, car, (PWM) in the LoRaWAN node. To turn on or off the
bicycle and motorcycle), the LoRaWAN gateway lamp completely, a small 5A relay is used.
transmits a command set to the LoRaWAN node to The smart street lamp’s driver input voltage
brighten the street lamps to 100% for a period of time range from 100-277 V, current rating of 0.33 A, rated
before the lamp’s brightness return to 50% to save power 70 W, and 0.95 power factor. The lamp’s
energy. This cycle continues all night to ensure the controller has 5 connections: L (line), N (Neutron),
pedestrians’ safety and security while saving energy. ground, Dim+ and Dim-. To control the lamp’s
brightness, a BJT driver circuit is needed to connect
B. Setting up LoRa nodes and a Gateway to both Dim+ cable and Dim- cable.
In order for LoRa nodes (Heltec Cubecell HTCC- The Fig. 4 shows an arduino IDE PWM control
AB01 board) and the gateway to communicate to code to be programmed into the LoRa nodes. Using a
each other, an arduino code is needed to be BJT circuit in Fig. 5 to drive the PWM signal on
programmed to the LoRa nodes. Dim+ and Dim- pins.

Fig. 2. LoRa node - Heltec Cubecell HTCC-AB01 Fig. 4. BJT circuits for simulation
To perform calculations for the above BJT circuit
design, based on the calculation equation (1)
VB = VIN – VCE (SAT) (1)
The value VB = 2.6V, and by selecting RB =
10kΩ, IB = 2.6x10-4 A, according to the BJT
datasheet, the bata value β = 250 for the bc337
transistor. Because IC = βIB, the calculated IB = 0.065
A and the value of a resistor at the transistor’s
collector (Rc), Rc = 143.07Ω. In practice, one will
choose the closest resistance available in the market
which is 180Ω.

Fig. 3. An arduino code for the LoRa node

190

Authorized licensed use limited to: Univ of Calif Santa Barbara. Downloaded on July 01,2021 at 04:05:29 UTC from IEEE Xplore. Restrictions apply.
2021 International Electrical Engineering Congress (iEECON2021)
March 10-12, 2021, Pattaya, THAILAND

III. EXPERIMENT
There were five different tests performed before B. LoRaWAN data transmission test
the final system was to be deployed in the field to This test determined how much LoRaWAN data
ensure the system robustness and reliable operations. rate effected by many factors including distance
These testes would include LoRaWAN distance vs between transmitter and receiver, Spreading Factor
Received Signal Strength Indicator (RSSI), data (SF) value, and each node’s Signal to Noise Ratio
transmission, lamp’s on/off control, lamp’s brightness (SNR). Fig. 7. and Fig. 8. revealed the RSSI, SNR and
control, and the Node-Red software control system data rate at the gateway.
integration tests.
A. LoRaWAN Distance vs Received Signal Strength
Indicator (RSSI)
It could be observed that radio signal strength
depends on distance between the transmitter and the
receiver. The signal strength of the receive decreases
as the distance from the transmitter increases. This
phenomenon obeys the “inverse square law” of radio
propagation. In this experiment, a transmitter
(gateway) was kept stationary and receivers (nodes) Fig. 7. LoRa Server webpage
moved to different locations in the KMUTT campus.
The results showed that the RSSI decreased as the
distance increased as shown in the Fig. 5.

Fig. 5. LoRaWAN RSSI level at various distances


Although LoRaWAN link budget can be as high Fig. 8. Display RSSI, SNR and Data-rate while
as 151 dB and the communication distance can reach connected
up to 800 km under optimal conditions [6]. To ensure After uploaded the running code to the LoRaWAN
the LoRaWAN radio link reliability under extreme nodes (Heltec Cubecell HTCC-AB01) using an
attenuation due to bad weather and severe Arduino IDE software platform, it can be seen that the
interferences. The signal strength at the receiver node nodes automatically connected (joined) to the gateway
of the smart street lamp system will not be lower than and started sending and receiving data packages
-121 dB at any given time. Fig. 6. shows multiple within a few milliseconds of the nodes boot up time.
sensors placed on the KMUTT campus.
C. Lamp On/Off test
The smart street lamp can be switched on and off
using a small 5A relay controlled by a digital (ADC)
pin D3 of the LoRaWAN node as shown in Fig. 9.

Fig. 9. LoRaWAN node turning lamp on and off

As the ADC pin is set to low, the relay will not


operate and the lamp will turn off but when the ADC
Fig. 6. Multiple sensors on campus pin is set to high, the relay will operate and the lamp
will turn on.

191

Authorized licensed use limited to: Univ of Calif Santa Barbara. Downloaded on July 01,2021 at 04:05:29 UTC from IEEE Xplore. Restrictions apply.
2021 International Electrical Engineering Congress (iEECON2021)
March 10-12, 2021, Pattaya, THAILAND

D. Lamp Brightness Control


The LoRaWAN node control the brightness of the IV. RESULTS AND CONCLUSIONS
smart street lamp driver by deploying Pulse Width The design of the smart street lamp using
Modulation (PWM) technique through a BJT circuit. LoRaWAN communication and Artificial Intelligence
The LoRaWAN node (Heltec Cubecell HTCC-AB01) was presented in this paper. Since the Artificial
is connected to the lamp’s driver board pin dim+, dim- Intelligence part was in the developing stage, a Node-
through the BJT circuit. Red software package was used to mimic the AI
image processing and decision making algorithm.
As the result, the system was able to perform as
designed. The gateway was able to transmitted
downlink commands to the LoRaWAN receiver node
to turn on/off and control the lamps brightness
Fig. 10. Lamp brightness with PWM 0 % and 100 % reliably at a distance over 500 meters.
Multiple IP cameras, a Nvidia Jetson Nano
Fig. 10. shows how bright of the lamp when the board and an AI image processing – decision making
node sent PWM 0 % and PWM 100 % respectively. It algorithm is responsible of detecting 4 object classes
is noted that the lamp will not turn off completely as it (human, vehicles, bicycles and motorcycles) on the
received PWM 0% due to the lamp driver board street at night around the football field in KMUTT
default setting, to turn off the lamp, a relay is required campus. As the AI algorithm detected any of these
as described in the previous section. classes, it will summit the detection results to the
cloud computing server. The server will then save the
E. Node-Red Software Control System Integration test detection results into a database (MySQL) and send a
To test the operation of the complete system, each MQTT message request to the gateway. The gateway
sub-system must be integrated. The AI system that will transmit downlink commands to the receive
transmits data to the gateway is part of another LoRaWAN nodes (Heltec CubeCell HTCC-AB01
working group. It is therefore outside the scope of this board) through LoRaWAN communication Protocol
paper and will not discussed in detail here. A Node- to turn on/off or change the lamp’s brightness
Red software was used mimic the AI – Image accordingly. It has been expected that the smart
processing and decision making algorithms of the
lighting system will help the university save energy,
project. This software was able to transmit command
in term of data packets using MQTT protocol from the increase the lamp’s operation life and increase safety
cloud computing server to the gateway. The gateway and security of pedestrians, bicycles, motorcycles,
then transmitted the control commands over radio and vehicles for many years to come.
wave (923MHz – AS923 band) using LoRaWAN REFERENCES
protocol to the nodes. When sending command from
the gateway to the nodes, one would refer this process [1] A. Zourman, N. W. Sheng, A. L. K. Hing and M.
AbdulRenman, “Human Counting and Indoor Positioning
as LoRaWAN “downlink”. System Using WiFi Technology”, Automatic Control and
Intelligent System Shah Alam, pp.142-147, October 2018.
[2] A. Lavric, V. Popa, “Internet of Things and LoRa TM low-
power wide-area networks challenges”, 2017 9th International
Conference on Electronics, Computers and Artificial
Intelligence, December 2017.
[3] A. Zourman , C. W. Hung, A. L. K. Hing and M.
AbdulRenman, “Internet of Things (IoT) using LoRa
technology”, 2019 IEEE International Conference on
Automatic Control and Intelligent System, September 2019.
[4] M. Jovanovic, M. Koprivica, N. Neskovi, “Implementation of
IoT System for Securing Telecommunications Infrastructure
Based on LoRaWAN Operator’s Network”, 2019 IEEE
EUROCON 2019 – 18th International Conference on Smart
Technologies.
Fig. 11. Node-Red flows to control lamp brightness [5] D. M. Lbrahim, “Internet of Things Technology base on
LoRaWAN Revolution”, 2019 10th International Conference
Fig. 11. shows a simple but effective Node-Red on Information and Communication Systems (ICICS),
flows installed on a cloud computing server. By December 2019
pressing the on and off buttons, the relay at the lamp [6] E. Sisinni, P. Ferari, D. F. Carvalho, S. Rinaldi, P. Marco, A.
will turn on/off according to the commands. Same Flammini, A. Depari, “LoRaWAN Range Extender for
Industrial IoT, 2020 IEEE Transactions on Industrial
idea applies to the 50% and 100% buttons, whereas Informatics, Vol. 16, Issue 8, 2020
the lamp brightness will change due to the node’s
PWM output.

192

Authorized licensed use limited to: Univ of Calif Santa Barbara. Downloaded on July 01,2021 at 04:05:29 UTC from IEEE Xplore. Restrictions apply.

You might also like