Iris-Covid19 Fighting Bot

Published Jul 22, 2020
 55 hours to build
 Advanced

A voice controlled robot that can pick up the things, switch on the lights, scan temperature of a person without any physical contact.

display image

Components Used

Ultrasonic Module HC-SR04
Ultrasonic module HC-SR04 is generally used for finding distance value and obstacle detection. It can operate in the range 2cm-400cm.
3
ESP8266 WiFi Module
ESP8266 is a system on chip (SoC) which provides WIFI capability for embedded applications. This enables internet connectivity to embedded applications. ESP8266 modules are mostly used in Internet of Things(IoT) applications.
1
MLX90614 Infrared Thermometer
MLX90614 is an inexpensive and reliable infrared thermometer which is used for non-contact temperature measurement.
1
Arduino Nano
Arduino Nano
1
Raspberry Pi 4B
Raspberry Pi 4BRaspberry Pi 4B
1
Relay Module Single Channel
Relay Module Single Channel
1
L293D Driver
L293D Driver
2
Camera Module Raspberry Pi
Camera Module Raspberry Pi
1
Connecting Wire Jumper Wires
Connecting Wire Breadboard wires
2
LED 5mm
LED 5mm
5
AK9753 IR sensor
AK9753 is a low power and compact IR (infrared) sensor module.
1
Resistor 1 kOhms
Metal Film Resistors - Through Hole 1K ohm 1/4W 1%
3
Resistor 220 Ohms
Metal Film Resistors - Through Hole 220 OHM 1/4W 1%
5
Resistor 2 kOhms
Metal Film Resistors - Through Hole 2K ohm 1/4W 1%
3
Metal Chasis for a Mini Robot Rover
Robotics Kits Anodized Aluminum Metal Chasis for a Mini Robot Rover
1
DC Gearbox Motor
Adafruit Accessories DC Gearbox Motor - TT Motor - 200RPM - 3 to 6VDC
4
Wheel for DC Gearbox Motors
Adafruit Accessories Skinny Wheel for TT DC Gearbox Motors
1
Microphone
Microphones microphone, 4 mmx1.5mm, electret condenser, noise cancelling, solder pads, 1 Vdc
1
Raspberry Pi Raspbian(OS)
1
Balena Etcher(software)
1
Robo arm kit or DIY Robo arm design
1
Description

Introduction:

The word is facing a great pandemic i.e. The COVID-19 Virus. Detecting this virus is becoming a great deal. And protecting the people from this virus is also a big deal. Now consider a hospital, I came to know that many of the doctors and other medical workers are getting affected by this disease while taking care of the patients. So to solve this issue, I have come up with an idea of using a voice-controlled robot in the hospitals to protect the spread of disease from patients to doctors. Usage voice-controlled robots can reduce the contact between the doctor and the patient, thus the spread of disease can be controlled. Also, the bot can measure the temperature of a person using the contactless IR temperature sensor and sends the data to the Doctor.

Problems

Now the world is facing a great issue i.e COVID19 virus. Doctors who are struggling with the virus through the spread can't be controlled. Also, doctors are being affected and losing their precious life. We need a solution to protect the doctors as well as the spread of virus from one person to another.

Idea and "Iris":

I've made a raspberry pi based robot named "IRIS" to solve the problem. Iris is a bot that has a rover and robot arm. So the design is a combination of the rover and a robot arm. Raspberry pi is acting as the brain of the robot. The bot can be controlled remotely using voice and through mobile phones. I found robots are rarely employed in hospitals since controlling it manually is a big deal. To make it easier, I'm planning to control the bot through voice, so that the patient as well as the doctors can use the bot to help them as an assistant. Employment of robots is necessary since in this abnormal situation patients and doctors cannot always depend upon a person for assistance. So, to prevent the spread and to protect the lives, the employment of such robots will be helpful to fight against the COVID-19.

CONSTRUCTING THE BOT

Robo Arm:

 

Robo Arm kit which I used(unassembled)
Robo Arm kit which I used (unassembled)

 

The above picture shows the unassembled parts of the robo arm with 4 DOF. You can use any robo arm kit or make your own customized build. And the arm looks like this after the build or assembly.

Robo Arm (assembled)
Robo Arm (assembled)

 

The base of the Bot:

Base kit (unassembled)
Base kit (unassembled)

 

The above picture shows the unassembled parts of the Base with 2 DOF. You can use any base chasis kit or make your own customized build. And the base chasis looks like this after the build or assembly. I'm just using two wheels, for simple operation.

Base for robot (assembled)
Base for robot (assembled)

 

Now, It's time to connect the robo arm and the base. And after connecting the things, the bot will look like this.

Entire Robot (without electronics)
Entire Robot (without electronics)

Arduino UNO and Motor Drivers:

I've used two motor drivers, one is for the base motors and the other is for the robo arm motors. The driver images are shown below.

 

Base motor driver
Base motor driver
Arduino UNO with Motor Driver shield V1(for robo arm)

Here I've used motor driver shield version 1. Any motor driver can be used based on the custom design of the robot.

Since I'm implementing my idea into a realtime application I'm using small and miniature parts to build the bot. When manufacturing it for real time use in hospitals, we can use efficient motors and designs. And don't forget to connect the Arduino uno to the USB port of Raspberry Pi.

Simple Casing for Pi:

I'm just using a simple casing like structure built using acrylic sheets to place the Raspberry Pi in the bot. And using some studs to fix it in a place. The casing looks like this:

Studs and simple casing (or) stand
Studs and simple casing (or) stand

And after fixing it to the bot, the bot looks like this:

Arrangement with Raspberry Pi
Arrangement with Raspberry Pi

The circuit connections are made, the connections are made available in the post. The Arduino Uno with a motor shield is placed under the yellow sheet that you can see in the above image.

MLX90614 IR Temperature Sensor:

I'm using a contactless IR temperature sensor to measure the temperature of the person inside the hospital and person entering into the hospital. The temperature sensor looks like this:

MLX90614 IR Temperature Sensor
MLX90614 IR Temperature Sensor

I'm gonna fix this temperature sensor in a stick. So that the sensor will be at maximum height to read the temperature of the human. Since I'm just making a mini prototype I'm using an extender to hold the IR sensor and the MLX90614 sensor. The IR sensor is used to detect the presence of humans to measure the person's temperature. The design can be customized when designing a bigger robot. And the final arrangement looks like this:

MLX90614 and IR sensor attached to stick
 MLX90614 and IR sensor attached to stick

 

Raspberry Pi 4:

When coming to the brain of the robot, using an embedded Linux platform is the best. I'm using the Raspberry Pi 4. And the Boards look like this:

Raspberry Pi 4
Raspberry pi 4

Setting up the hardware can be found here:

Pi Camera Module:

Next, we're gonna take a look at the pi camera module. The PI camera is used here for monitoring the patient. The video will be live-streamed to the smartphone. I'm using v1.3. But the advanced version also suits well.

Pi camera
Pi camera V1.3

Ultrasonic Sensor:

Ultrasonic Sonic sensors are used for obstacle avoidance of bot. Here I'm using 3 ultrasonic sensors for obstacle avoidance. We can also use rplidar for SLAM and obstacle avoidance while building a bigger advanced bot. Since this is a miniature bot I'm using Ultrasonic sensors. The sensor looks like this:

Ultra Sonic sensor(HC-SR04)
Ultra Sonic sensor(HC-SR04)

I'm using three ultrasonic sensors. Front sensor, Left sensor, Right sensor. These sensors are responsible for obstacle avoidance of the bot.

Wemos Mega:

Wemos Mega will be used for integrating voice-controlled automation with the bot. Wemos Mega is Arduino Mega compatible board plus additional ESP8266 with 32Mb Flash. It allows flexible configurations for connections between ATmega2560, ESP8266, and USB serial. Arduino sketches can be uploaded to ATmega2560 or ESP8266 via USB separately and they can either work together to form a system or independently. The configurations are set by the onboard DIP switches.

Wemos Mega
Wemos Mega

The thing we need to know before starting to work with this board is the DIP switch configuration. Refer to the below picture:

DIP switch configuration
DIP switch configuration

An additional switch configures to which serial port (Serial0 or Serial3) the ESP8266 is to be connected. It is possible to connect USB to RX0/TX0 of ATmega2560 and ESP8266 connects to RX3/TX3 of ATmega2560 at the same time, as follows:

UART selctor switch configuration
UART selector switch configuration

While uploading the esp8266 code, DIP switches-5, 6, 7 should be kept ON and UART switch is to be kept at RXD0-TXD0.

While uploading the Mega 2560 code, DIP Switches 1, 2, 3, 4 should be kept ON and the UART switch is to be kept at RXD3-TXD3

The eighth DIP is NC pin, so it need not be considered.

After successfully uploading both the codes, proceed ahead.

After completing the above procedures we need to install the packages and python libraries for our bot.

Final Hardware Setup:

All connections should be made according to the schematics provided. Don't forget to refer the schematic section before wiring the bot! I'm using DC adapter as power source. A battery can be used as power source while customizing the bot.

After assembling the entire hardware, the bot will look like this:

 IRIS bot

Now let's start working on the software setup.

Setting up the Software:

Before starting to install the required packages and libraries, enter sudo raspi-config in the terminal and in the interfacing options enable VNC, I2C, Serial Console, Camera, etc,.

And the python libraries used here are:

  • speech recognition
  • paho mqtt
  • snowboy
  • pyaudio
  • bluepy
  • Rpi GPIO
  • Flask etc,.

The requirements.txt file can be used to install all the necessary packages required for the operation of the robot. Before that, Don't forget to create a Python3 virtual environment. The Virtual environment can be created by using the following command:

python3 -m venv <your env>          #replace <your env> with your desired name

After creating the event (I named it as Iris), We're gonna install the required packages using the requirements.txt file. The file should be executed as mentioned below to install the necessary packages. The command is:

pip3 install -r requirements.txt       #Don't forget to use "-r"

The above step will install all the necessary python packages needed for the bot. After the above step, we have to install certain Linux packages in order to make the USB mic to communicate with the system properly. To execute the commands in the terminal as follows:

sudo apt-get install libportaudio2 portaudio19-devsudo apt-get install python3-pyaudio soxsudo apt-get install libatlas-base-dev pulseaudiosudo apt-get install libasound2-dev libportaudio-devsudo apt-get install libportaudio0 libportaudiocpp0sudo apt install -y mosquitto mosquitto-clientssudo systemctl enable mosquitto.service

Now execute the following commands in terminal and note down the "card number" and "device number" for mic and speaker respectively.

arecord -l

The above command will show you the list of input devices, note down the card and device number of the USB mic. Then execute this:

aplay -l

This command will show you a list of playback devices. Normally "hw:0, 0" for HDMI. For now, it is ok to use the HDMI port since we will be using the speaker in the future development of bot.

After executing the above commands, We're gonna create a file to make the pi to communicate with the USB mic. Execute the command in the terminal:

nano ~/.asoundrc

And then copy and paste this into the terminal,

pcm.!default {
  type asym
  capture.pcm "mic"
  playback.pcm "speaker"
}
pcm.mic {
  type plug
  slave {
    pcm "hw:<card number>,<device number>"
  }
}
pcm.speaker {
  type plug
  slave {
    pcm "hw:<card number>,<device number>"
  }
}

Change the <card number>,<device number> according to the number found at the above step. After changing, press Ctrl + x and Shift + y and press Enter.

Setting up the camera module:

Connect the raspberry pi camera properly to the Raspberry pi board. And make sure the board is off when connecting the camera to CSI port. Connecting the camera while the board is on can cause the camera to get damaged.

Make sure the camera is enabled using the Sudo raspi-config Command.

Check whether the camera is detected by using the command:

vcgencmd get_camera

If detected successfully. Execute this command in terminal:

raspistill -o cam.jpg

If an image is generated successfully. Great! We're all set!

DON'T FORGET TO CLONE THE GITHUB REPOSITORY BEFORE PROCEEDING ALL THE STEPS!

Running the Scripts:

Start by rebooting the board using the command:

sudo reboot 

Then activate your virtual environment using

source <your venv>/bin/activate

Now, run the script

python Iris_bot.py resources/Iris.pmdl 

And in another tab start the server by executing

python Iris_server.py 

After the execution of the script starts, go to your browser and type the URL in the format:

<PI's IP ADDRESS>:8000 #8000 is port

Here we go! You can see Iris Dashboard! now we can see the bot in action! You can add the execution command on the system's bash file to run the scripts automatically at the next boot.

 

Conclusion:

Hope you all found this write up useful. I made this project on keeping every doctor who is sacrificing their lives and happiness for us. Let's fight this covid19 together and let's make a better world. I'm planning to deploy autonomous navigation and some other special features in the bot. So, stay tuned! And Don't forget to share this and If you enjoyed my write up drop a like! Let's Stay Home Stay Safe! Thank You!

Codes

Downloads

pi_motor Download
uno_motor Download
PI_cam Download
wemos_automate Download
pi_sonic_IR_MLX90614 Download
Comments
Ad