Wednesday, July 17, 2024

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages

UV Robot

ashwiniSanitizing hospital rooms with human effort is not an easy task. It increases the chances of contracting infection, leading to further spread of harmful microorganisms

The UV sanitization robot uses the power of UV rays to kill germs and bacteria. The robot can also give a live video stream of its surroundings. With the help of WiFi, we can control the robot and its GUI allows us to drive the robot inside a hospital room without physically being there. All this enables us to sanitize the hospital room as per our requirements. By killing the germs, the UV light restricts their multiplication by destroying their reproductive system.

Bill of Materials


Raspberry Pi Motor Driver
VCC ENABLE 1 and 2

- Advertisement -


Hope you have upgraded your Raspberry Pi with the latest Raspbian OS and VNC viewer, and have access to the desktop window. Now open the Linux terminal and install the required library for Python that we will use in our project. Here we need to create a GUI, for which we need to install a GUI library for Python. Install the guizero library using the following syntax:

sudo pip3 install guizero

 Next we need to control the GPIO to run the robot. For that, we need to install the gpiozero library. You can do so using:  

- Advertisement -

sudo pip3 install gpiozero

After installing the libraries, let’s create the GUI to control our robot.

Making the GUI

First of all, import the guizero library module and the gpiozero robot control module into the code. After that, set the GPIO pin numbers to control the robot. Here we are using  

Next, create the buttons for GUI and set their functions. Here we have created 5 buttons to operate the robot.

Setting Cam Stream

Next, we need to create the code for capturing live video from a Raspberry Pi camera and display it on the Raspberry Pi window. For that, we will use OpenCV for taking the video from the Pi camera and displaying it frame-by-frame on the Raspberry Pi desktop.

Then install the VNC server in the Raspberry Pi and VNC viewer in PC or smartphone. Go to the Raspberry Pi desktop, open the VNC and check the IP address to view the Raspberry Pi screen from remote PC or smartphone.



Assemble all the components on the robot chassis and then fix the UV light on top of the robot (as shown in pic)

Place the Raspberry Pi in front of the robot in such a way that the camera can clearly view what is in front it.


Now after getting everything ready, power the Raspberry Pi and wait for its bootup. After that, open its screen on a remote desktop or smartphone using the VNC and then run the GUI and video camera Python code. Now wait for a few seconds. An app with live video camera footage will then become visible on your screen. At the same time, an app with control buttons will also appear on the screen. Switch on the UV light and put the robot in a closed room of the hospital. You will be able to control the robot from outside and thus stay away from being exposed to the UV light.

Now you will be able to control the robot’s movement and see its current position for properly sanitizing the room.

Download Source Code

Ashwini Sinha
Ashwini Sinha
A tech journalist at EFY, with hands-on expertise in electronics DIY. He has an extraordinary passion for AI, IoT, and electronics. Holder of two design records and two times winner of US-China Makers Award.


    • Might be a version error. Try o check the right OpenCV 2 or 3 version and also check the camera interface is on in raspberry pi and the camera works fine. If error still comes then try to find it on the net you get the cause and soln.


Unique DIY Projects

Electronics News

Truly Innovative Tech

MOst Popular Videos

Electronics Components