Skip to main content
. 2021 Feb 3;21(4):1038. doi: 10.3390/s21041038
Algorithm 1 The Pseudo-Code of Air Conditioner Energy Control Based on IoT
1: Capture the image by the camera
2: Resize the image
3: Input the image data to the YOLOv3 model
4: Do the recognition process by the YOLOv3
5: Publish the number of detected persons by MQTT protocol
6: Do data analysis by Contact elements for IoT
7:  if the number of persons ≥ 1
8:   Send signal “1” by MQTT protocol to the air conditioner microcontroller
9:   Connect the power of the air conditioner
10:   Present the number of persons on the IoT dashboard
11:   Record event of air-conditioned “on”
12:  else
13:   Send signal “0” by MQTT protocol to the air conditioner microcontroller
14:   Disconnect the power of the air conditioner
15:   Present the number of persons on the IoT dashboard
16:   Record event of the turn off the air conditioner
17:  end if
18: Record all events and data on the system database for any further analysis