Wiznet makers


Published September 22, 2022 ©

19 UCC


0 Contests


0 Following

Original Link

[AIoT] Smart Office Automation detecting Human Presence

A Smart Office Automation System that can detect human presence inside a room and can turn ON and OFF any electrical components.

COMPONENTS Hardware components

WIZnet - W5100S-EVB-Pico

x 1

x 1

x 1

x 1

x 1

Software Apps and online services

Arduino - Arduino IDE

x 1

PyCharm - Pycharm

x 1


Project Description

In this project, we'll create a Smart Office Automation System that can detect human presence inside a room and the electrical components inside the room can be turned OFF and ON. All the detection, processing, and coordinate mapping is done by opencv and python. The bulbs are connected to the Pico board. The Picoboard receives the status of the room; this response is used by the Picoboard to turn off and on the lights inside the room.

Things used in this project


  • Wiznet Pico board
  • Jumper wires
  • 1-Channel Relay
  • Bread Board
  • Web Cam
  • Bulb
  • Electric Wires


  • Arduino IDE
  • Python
  • Libraries Included in Python : cv2, numpy, serial, time


There is a huge wastage of energy in our daily life, which can be saved if we turn off the electronic devices when not in use. Unfortunately we humans are so busy that we forget to turn them off. So to solve this problem, we thought of Automating the electric bulbs inside an office room.

In this project we will make our existing office room/cabin/classroom a smart one. The light bulbs are turned ON automatically when the door is opened. The Ultrasonic sensor senses the movement of opening the door and sends a signal to the AI module. Upon receiving the signal from the Sensor, the AI Module starts the camera and starts to scan the room for detecting the human presence in the room. Every Alternate minute the Camera and Scanning takes place and the status of the bulb is changed to OFF only when there is no human presence inside the room for an entire 1 minute.

Circuit Diagram

Circuit diagram Explanation

VCC, GND pins of the ultrasonic sensor and the 1-channel relay module are connected and coloured by the same colors[pins 36 and 38]. The 1- channel relay module has a connection to the bulb and switch that makes the external AC connection possible. The data pin of the relay module is connected to the pin 1of PicoBoard. The TRIG and ECHO pins of the ultrasonic sensor are connected to [pins 19 and 20].

AI Integration

How to integrate AI ?

In this project OpenCV and YOLOV3 were used to detect the human presence inside the cabin room. If the presence of the human is detected then the current state of the system is continued and it scans for checking the human presence in regular intervals of time. If the presence of the human is not detected inside the cabin the AI module will send the turn off message to the PicoBoard and the PicoBoard then turns off the light and also the camera module is turned off. It then waits for the response from the ultrasonic sensor again to turn off the light. The messages that we sent between the systems are in ‘utf-8’ encoded format.

Arduino Code Explanation

The code starts from line number 1, which assigns the pins number for the TRIG pin and ECHO pin for the ultrasonic sensor; they are specified earlier because the distance is calculated from those pins. After that we start with the void setup() and void loop() functions where the actual code execution takes place.In the setup file the ultrasonic sensors and the bulbs are connected and their pins are specified, Serial is enabled at baudrate = 115200 and a time out of 1 millisecond is given for the incoming serial data. A string variable ‘incomingdata’ is specified so that we can pass the message between the systems. We are calculating the distances between the objects and we have used a condition in which if the inches is less than 4 the lights are turned on.

After that condition we have written the code for the AI response code that is to make the bulb continue its state and if no human presence is detected then turn off the lights. The conditions incomingdata are ON and OFF. The on and off messages are sent and received in the ‘utf-8’ format.The final line of code is a calculation of distance between the object.


Python: Real Time Object Detection (Image, Webcam, Video files) with Yolov3 and OpenCV

https://www.arrow.com/en/research-and-events/articles/ultrasonic-sensors-how-they-work-and-how-to-use-them-with-arduino#:~:text=Ultrasonic%20sensors%20work%20by%20emitting, return%20after%20hitting%20an%20object.


  • Smart Office Automation

Comments Write