Project Theia is a low-cost, low-connectivity IoT platform designed for developing countries with minimal healthcare infrastructure, disrupted (or substandard) telecommunications networks, and a limited real-time national health data system. Often the countries with the most limited healthcare systems are also those with the smallest real-time health data, which could allow them to spend their limited healthcare resources where they are most needed. Using long-distance IoT radios, modern data collection and analytics frameworks, and low-cost components, Theia creates an immediate, on-the-ground emergency health network that offers a national level, if simplistic, real-time health data layer. When implemented, Theia would allow a developing countries healthcare system to make more intelligent decisions on where to deploy, enabling a country to triage its COVID-19 response effectively, focusing on the belief that 'something is better than nothing' in light of a global pandemic involving countries with far too little real-time health data mapping.
We are Karakoram, a global, distributed, volunteer developmental innovation team that disrupts conventional thinking and builds solutions to the world's toughest challenges. We use rapid prototyping and Agile production methods to create everything from physical and digital platforms, organizational design, and experimental policy. Over the past three months, our team has designed Project Theia as a multiple product IoT platform that both detects individual temperatures on the ground with a fully developed contactless smart thermometer and FLIR camera paired a custom IoT analytics and reporting hub.
This platform functions by having one, or more, of the Theia Thermometers in use throughout a community that may be at risk within a developing country, capturing data points of the local population while checking for fevers on the ground. While a single temperature reading is not indicative of COVID-19, with several unrelated reasons that a person might have a fever, a change in the mean average of an entire community is indicative of a more infectious disease circulating amongst the target group. Each thermometer has a built-in 'LoRa' (Long Range) IoT radio capable of sending data over 2km to the Hub.
The Theia Hub listens for data transmissions in the particular unlicensed, LoRa radio spectrum in each location, and writes anonymous data points to a database within the Hub itself. The data is then analyzed and interpreted by the Hub and served by a self-hosted web front-end.
Our project-theory is that with the use of multiple Theia Thermometers and Theia Hubs, a developing country with limited healthcare services would have the necessary real-time data on where average mean temperatures are increasing nationally. Project Theia offers the ability to distribute limited healthcare services intelligently, without the need for established telecommunication networks (3G/4G/WiFi, etc.) or traditional track and trace methods.
Insight & Problem Definition:We designed Theia to address several observed deficiencies in some developing countries COVID-19 strategy:
- A limited healthcare system cannot be everywhere at once.
- A lack of critical infrastructure for nationwide analytics and observation of viral blooms would direct where the limited healthcare teams are urgently needed.
- A limited budget to purchase expensive and expansive traditional testing, which would otherwise give a 'gods eye view' of the countries COVID-19 health.
- Limited communication networks, including 3G/4G/WiFi that could be used by other solutions to detect viral blooms.
- Limited healthcare budget for the acquisition of trace tools such as contactless thermometers.
- Restrictions on out-of-country supply chains that make it difficult to source ready-build products.
We feel that the Theia system addresses our insight in the following ways:
- The Theia platform monitors individual temperature readings from across the community and averages the values into a single 'Community Temperature' mean value, giving a unified view of whether the average community temperature is above average, and trending upwards or downwards.
- The 'Community Temperature' can automatically trigger alerts if trending upward, signaling that an infectious disease affects the community, warning the national health system to relocate services to this area.
- The Theia platform monitors a 2km radius of land with a single Theia Hub, using the IoT framework LoRa. Each Theia Hub only needs the most basic of either hard-wired ethernet or low-speed WiFi connections to the internet to report the data to a national hub, which can monitor health from a national level in the country as a tapestry of 2km circles.
- The platform is built primarily with basic 'Commercial-Off-The-Shelf' components and parts, open-source PCB designs released for free by team Karakoram, and product shells that can easily be 3D printed and assembled in nearly any location.
- This basic nation-level view would allow even the most strained health systems to quickly deploy where they are most needed, effectively triaging the country with the most limited health service.
The Theia platform is comprised of the following components:
1.Theia Contactless Thermometer:
- Low-cost design
- Ease of production and high durability
- Long battery life (average 14-16 hrs)
- Designed around a common Adafruit Feather 32u4 development board
- Elegant but rugged design (operational in any environment)
- Can be assembled without screws or glue
- Clips together with innovative fastening features
- Embedded 2km LoRa radio
2.Theia Hub:
- Designed to listen / record & process submitted data points from any Theia Thermometer in the area.
- Wireless receiver via a LoRa radio chip
- Fully operational (up to 2km radius)
- Uses a python script to record data points to an InfluxDB database.
- Self-hosted Grafana web interface for the front-end
- Wireless consolidation of data points from the smart thermometers
- No requirement for Bluetooth, WiFi, 3G/4G, etc
3.Theia Platform:
Contactless thermometers, while useful placebos for emotional security during a pandemic, are largely inaccurate for detecting COVID-19 due to the high number of other reasons that someone might have a fever. However, a sudden shift in the mean average temperature of a community body temperature would be an interesting metric for an outbreak of an incredibly infectious disease such as COVID-19 that could cause a change in the average temperature of a sample group (such as a village or community). Therefore the software running on the Theia Hub, the Theia Platform, is a software stack that enables the capture and basic computation of 'Community Temperature Averages', which do indicate changes to community health at a macro level.
Here is a link to a data reading from our dashboard after an evening of capturing lots of temperature metrics and having the hub calculate an average: https://snapshot.raintank.io/dashboard/snapshot/EoFXgk3VQFDwi0iBqA2MWdkdxspF5LX9
To begin, ensure you have all the components you need. You can either look at the EBOM attached to this tutorial, or for a slightly more fun way of looking over our components, watch the following video:
Step 2. Theia Thermometer Electrical AssemblyKarakoram'Theia'Daughterboard:
Much of the Theia Thermometer electronics revolve around how they connect into the Adafruit Feather mainboard. While it is possible to solder all of these connections onto a perf or stripboard, we've made it significantly easier by creating a custom PCB for a daughterboard that can easily be printed by professional PCB manufacturers and either assembled by the pros (PCBA) or shipped back unassembled (PCB) and through-hole mount assembled by you. Ours were manufactured by PCBWay, who offered to sponsor the production of our boards and were fantastic partners on this project. Not only because they were kind enough to support us for this challenge, but also because their printing is some of the best I’ve seen in a while, I'd recommend them for this type of project!
If you go the route of ordering the PCB printed and assembled, here is how you through-hole mount the parts:
We've included a link to the daughterboard GERBER file for PCB printing in our schematics link, but you can also find this here: https://github.com/zingomarket/project-theia/tree/master/theia_GERBER
If you go the route of manual assembly on a perf or stripboard (which we would not advise), here is a Fritzing diagram and connection table. We've also included our Fritzing diagram in the components section.
Now that you have your Adafruit Feather & Karakoram Daughterboard paired, there is a small amount of work to be done to prepare our smart thermometer to be assembled.
- We need to run power and data lines from the Adafruit Feather to the external case by splicing a generic micro-USB cable to the female USB breakout board. After completing this, plug the male end of the spliced micro-USB cable into the feather.
- Solder the positive and negative jumper wires to the positive and negative toggle switch
- Cut out and create the momentary push-button PCB,
The next part of our platform build is to create the Theia Hub, which receives LoRa radio transmission, records them, and hosts a front-end for calculating and distributing signs of a viral bloom. The critical parts for this build are:
- A Raspberry Pi Model B+ or newer
- Geeekpi DIY Proto-Hat Shield
- SX1278 16-pin LoRa Module
- LoRa Antenna
Warning: Always use your SX1278 LoRa module with the correct MHz antennas; else the module might get damaged, e.g I use a 433MHz antenna with my 433Mhz SX1278 because 433Mhz is the unlicensed LoRa spectrum in the UK where I live.
You can use the below connection table and Fritzing diagram to see how the connections to the Geeekpi DIY Proto-Hat Shield work.
Now that you have completed your Theia Hub electronics, it's time to assemble the parts into its physical enclosure.
We have built the Theia Thermometer as both a contactless thermometer and a low-cost FLIR camera. However, V1 of the software does not include the thermal camera FLIR functionality due to current incompatibilities in the firmware needed for RadioHead RH95.h LoRa radio library and SPIxx.h, the accelerated SPI library needed for interpolating pixels in the thermal camera. We aim to release a V2 software in the coming month that allows for both FLIR camera and RadioHead functionality. In V1 we have therefore turned off the FLIR functionality in order to focus on mission-critical functionality including accurate contactless temperature capture and transmission to the Theia Hub over LoRa.
- Initial Setup:
- Download the Arduino IDE from: https://www.arduino.cc/en/main/software
- Download theia_thermometer directory from: https://github.com/zingomarket/project-theia
- Ensure you download the full directory, not just the.ide file.
- You will need some 3rd party libraries, most of which you can download using the Arduino Library Manager. From the Arduino “
Sketch
” menu, select “Include Library
” then “Manage Libraries…
” - Type “
gfx
” in the search field to find and installAdafruit_GFX.h
. - Using the same method, search for
Adafruit_ST7735.h
,
RH_RF95.h
, andAdafruit_MLX90614.h
- Compile the code by clicking the checkbox in the upper left corner. It should compile with no errors.
- Plug in the completed Theia Thermometer and from the “
Tools
” menu, select “Board
” and “Board manager
”. - Click on the category drop-down menu on the top left-hand side of the window and select Contributed. Search for “
Adafruit AVR Boards
”. - Quit and re-open the Arduino IDE.
- From the “
Tools
” menu, select “Board
” and “Adafruit Feather 32u4
”. - From the “
Tools
” menu, select “Port
” and ensure the Feather is selected. - Upload the code to the Theia Thermometer by clicking Upload in the upper left corner.
- That’s it, the Theia Thermometer is now complete! You should be able to turn the thermometer on and start capturing temperatures. Next, we need to install the software in the Theia Hub in order to listen and record readings.
- Initial Setup:
- Download the latest Raspbian Lite (operating system) image from raspberrypi.org
- Get your 8GB or larger (maximum size, 32GB) SD card
- Flash the Raspbian operating system to the SD card using the methods outlined on raspberrypi.org. Depending on whether you are using Windows, Mac, or Linux, these install instructions are different.
- After flashing the OS to the SD card, re-mount the card on your main computer by physically removing and re-inserting it. Next, create an empty directory called
ssh
at the root of the SD card - this enables SSH access which we’ll need later to connect remotely to the Pi. - Insert the SD card into the Pi, connect to your router via ethernet and power on.
- Determine the auto-assigned IP address of the Pi by logging in to your router interface (see a guide on finding your router IP address: here) and navigating to LAN / DHCP settings. The pi should be named
raspberrypi
. - SSH into the Pi using the IP address you have determined:
ssh pi@<yourip>
. The default password is raspberry. - Update the password for the pi user now by running
passwd
. - Housekeeping:
- The first thing we should do before installing the Hub software to the Raspberry Pi is making sure that all the currently installed packages are up to date. We can upgrade all installed packages by running the following two commands.
sudo apt update
sudo apt upgrade
- Install Python3, which is needed to run our Theia.py script.
sudo apt-get install python3-pip
- The next thing we need to do is prepare the Pi to use the LoRa chip on the shield.
sudo raspi-config
- Navigate to
interfacing options
and select enable theSPI interface
. - Save the changes and get back to the terminal window and then install the RPi.GPIO package using the following command.
pip install RPi.GPIO
- Install the spidev package using the following command. Spidev is a python binding for Linux which can be used to perform SPI communication on Raspberry Pi.
pip install spidev
- Next lets install the pyLoRa package using the following pip command. This package installs the Radio models associated with LoRa.
pip install pyLoRa
- Next lets install Screen, in order to keep our python code running in the background:
sudo apt-get install screen
- Next lets install Git so we can easily get code from the Karakoram Github repo.
sudo apt-get install git
- Now with all our libraries and housekeeping installs done, on to our software installs.
- Install InfluxDB:
- The first bit of software we’re going to install is InfluxDB. This is our database that will house all of the data points from the Theia Thermometer.
- First we add Influx repositories to apt:
wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add -
source /etc/os-release
echo "deb https://repos.influxdata.com/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
- Update apt with the new repos, & install.
sudo apt update && sudo apt install -y influxdb
- Then set it to run at boot. The first command we use unmasks the influxdb service file. Unmasking the service ensures that we can enable and start the service as a masked service is unable to be started. The second command enables the influxdb service. This command will tell the service manager to keep an eye on the influxdb.service file and setup the service based on its contents.
sudo systemctl unmask influxdb
sudo systemctl enable influxdb
- Now that everything has been set up, we can now proceed to start up InfluxDB on our Raspberry Pi.
sudo systemctl start influxdb
- Set up InfluxDB for Theia Hub
- Launch up Influx’s command-line tool. You don’t have to worry about specifying an address to connect to as the tool will automatically detect the local installation of InfluxDB. By default, InfluxDB has no users setup. Launch the command-line tool with:
influx
- Our first step is to create a database for storing our thermometer data.
CREATE DATABASE Theia
- Before we can start modifying this database, we must tell the Command Line Interface to “use” it. Using a database is as simple as running the following command.
USE Theia
- Adding Authentication to InfluxDB
- If you’re not already in the command-line tool, launch it by typing:
influx
(you should still be in it from the previous step, but just in case you exited out for some reason) - Within this interface, we can create a user that will have full access to the database. This user will act as our admin account. To create this admin user, run the following command within InfluxDB’s CLI tool. Make sure that you replace
<password>
with a secure password of your choice.
CREATE USER admin WITH PASSWORD '<password>' WITH ALL PRIVILEGES
- You now have a new user called ‘
admin
’ with your chosen password with all privileges. With that done, you can now exit out of InfluxDB by typing inexit
and pressingENTER
. - Our next job is to modify the InfluxDB config file to enable authentication. We can begin editing the file by using the command below.
sudo nano /etc/influxdb/influxdb.conf
- Within this file, use
CTRL + W
to find the[HTTP]
section and add the following options underneath that section.
auth-enabled = true
pprof-enabled = true
pprof-auth-enabled = true
ping-auth-enabled = true
- Once added, save the file by pressing
CTRL + X
, thenY
, followed byENTER
. - Now, as we have made changes to InfluxDB’s configuration, we will need to go ahead and restart the service by using the following command:
sudo systemctl restart influxdb
- From this point forward, as you’ve set a user name and password, in order to access the Influx command-line, you’ll use:
influx -username admin -password <password>
- Our next step is starting writing data to set up our newly created InfluxDB database with the
Theia.py
script. - Theia.py
Theia.py
is the software that listens for transmissions from the Theia Thermometer and writes them to InfluxDB.- Create a Theia directory on the Pi by typing :
mkdir Theia
- Go into the directory by typing:
cd Theia
- We need the get the
Theia.py
and a dependent library called SX127x to control the LoRa radio chip on the Pi. - Clone the
Theia.py
andSX127x
LoRa library from GitHub with:
git clone https://github.com/zingomarket/project-theia/tree/master/theia_hub
- Make
Theia.py
executable by typing:
chmod +x Theia.py
- Most of the script is ready to go out of the box, but there are a few lines you need to update in Theia.py in order to make it work with your details and LoRa transmission frequency. You can change this in your favorite code editor, or even on the Pi with nano Theia.py
- Modify the following lines to reflect your Influx DB information:
# Configure InfluxDB connection variables
host = 'localhost' # default host
port = 8086 # default port
user = 'admin' # the user/password created earlier, with write access
password = 'password' # your password we created earlier
dbname = 'Theia' # the database we created earlier
interval = 60 # Sample period in seconds
- Set the configuration of our LoRa module. The code works out of the box at 433/434MHz (the default) which is the LoRa spectrum frequency in the UK where I live.
# BASIC LoRa SETTINGS.
# Defaults:
# f = 434.0MHz
# Bw = 125 kHz
# Cr = 4/5
# Sf = 128chips/symbol
# CRC on 13 dBm
# LoRa.set_pa_config(pa_select=1)
LoRa.set_pa_config(pa_select=1)
# ADVANCED LoRa SETTINGS. Uncomment out lines to change frequency, output power, etc. If in the US, for instance, uncomment out LoRa.set_freq(915.0) in order to change frequency to the US LoRa spectrum frequency of 915MHz.
# # f = 915 MHz
# # Bw = 125 kHz
# # Cr = 4/8
# # Sf = 4096chips/symbol
# # CRC on. 13 dBm
# LoRa.set_freq(915.0)
# LoRa.set_pa_config(pa_select=1, max_power=21, output_power=15)
# LoRa.set_bw(BW.BW125)
# LoRa.set_coding_rate(CODING_RATE.CR4_8)
# LoRa.set_spreading_factor(12)
# LoRa.set_rx_crc(True)
# LoRa.set_low_data_rate_optim(True)
- Now exit out of the code editor by typing
Ctrl + X
and thenY
to save the file when prompted (if editing in Nano). - Launch
Theia.py
by typing:
python3 Theia.py
- Now whenever the Theia Thermometer captures a reading, it should automatically print the temperature to screen, as well as record the reading into InfluxDB.
- Exit the program by typing
Ctrl + C
once you verify that everything is working. - Start a new screen by typing screen bash which will open what looks like a new terminal window. Navigate to your Theia directory by typing
cd Theia
. - Launch
Theia.py
by typing:
python3 Theia.py
- Detach from the screen by typing
CTRL + A
and thenD
. You should return to the main shell and now haveTheia.py
running in the background! - If you need to reattach to the screen for some reason, list the current screens by typing
screen -ls
. Reattach to whatever you find by typing:screen -r <screen name>
. - Grafana Install
- Grafana is our web front-end, which not only displays the anonymized temperature readings from the Theia Thermometer but also gives us the ability to manipulate the data and give us our Community Average.
- Download and install the Grafana package:
wget https://dl.grafana.com/oss/release/grafana_6.6.1_armhf.deb
sudo dpkg -i grafana_6.6.1_armhf.deb
- We need to get Grafana to start at startup. Luckily for us, Grafana comes with a systemd service file.
sudo systemctl enable grafana-server
- Start the Grafana web server by typing:
sudo systemctl start grafana-server
- Grafana Web Portal
- Next, we need to access the Grafana Web Portal using the Pi’s local IP address. This is the same address you used earlier to SSH in, but in case you forgot it for some reason you can get the IP address assigned to the pi by running the following command:
hostname -I
- With your IP address handy, go to the following web address using a web browser on your computer. Grafana’s web interface sits, by default, on port 3000 of your Raspberry Pi’s IP address.
http://<IPADDRESS>:3000
- The first thing you will see when loading up Grafana is a login screen. On this screen, you will be able to login using the default admin user. The username for this user is “admin” and the password is “admin“. We can change this super insecure password in the next step.
- The default password is incredibly insecure and should be changed immediately. To proceed to the Grafana dashboard, go ahead and enter a new password when prompted, then click the “Save” button.
- Once you have logged in and changed the default password, you should now be greeted with the Grafana Home Screen. This screen means that you are now ready to start adding data from our InfluxDB Theia database!
- Adding InfluxDB to Grafana
- We need to add
Theia
as a new data source. We can do this by hovering over the cog in the sidebar, followed by clicking the “Data Sources” menu option. - In the next menu, we will need to click the “Add data source” button to proceed.
- On the “Add data source” page, you need to find InfluxDB, hover over it and click the “Select” button.
- Now we are required to enter the details of our InfluxDB installation. First we need to add our InfluxDB URL. In our case because the database is on the same Pi we’re running Grafana on, we use the following URL:
http://localhost:8086
- Next, we will need to enter the InfluxDB Details as follows:
Database: Theia
User: admin
Password: <your password>
- Once you have set all the required information, click the “Save & Test” button located at the bottom of the screen.
- Setting Up a Dashboard
- The next step is to create a dashboard to display this data.
- Click “Dashboard Settings” on the top of the screen, a button with a cog icon.
- Click “JSON Model”
- Download, or simply cut-and-paste the JSON code from: https://github.com/zingomarket/project-theia/blob/master/theia_dashboard/theia_dashboard.json
- Paste the code in and click ‘Save Changes’
That's it, you’re done! Now you should be able to capture temperatures using the Theia thermometer, and they should both write to Theia.py, and record the data in real-time to InfluxDB and display in Grafana.
It should automatically calculate averages, as well as plot the temperatures in a few useful ways.
https://stackshare.io/karakoram/Theia
Next Steps:We have included the AMG8833 thermal camera as part of our build. Initially, we had planned to include a low resolution/low-cost FLIR camera as part of our product. However, the enhanced SPI firmware needed to operate the interpolated 64x64 FLIR camera (upsampled from the 8x8 AMC8833) is directly inoperable with the default SPI firmware required by the RadioHead LoRa library.
We plan to continue working on this and release an updated V2 of the software in August, which includes both temperature reading and FLIR capabilities, with the LoRa radio. We also intend to use the Edge Impulse machine learning framework to parse the data collected in V1 to improve our ability to deploy healthcare workers intelligently.
Conclusion:At the average cost of USD $20-80 (depending on each countries ability to negotiate the wholesale price for commercial components) per 2km radius of populated land, it leverages the power of LoRa IoT communication standard to monitor a countries health without the need for large commercial telecommunication networks such as 3G/4G, or even a reliance on WiFi.
We believe that Theia is the most effective solution to giving a developing country, with limited healthcare services, and often without a reliable telecommunication network, to triage their COVID-19 outbreaks, sending doctors and nurses where they are most needed.
Core Team:Josh Thomas, Andrew Osula, Anurag Kurapati
Electrical Engineering & Firmware Support:Owen Murphy
PCB Printing & Manufacturing:PCBWay & Lesley Wong
Thanks to:Thanks go out to a considerable number of people for making this project possible. This project was indeed a global effort, with member partners in China, the United Kingdom, and the United States.
Andrew Osula and Anurag Kurapati for their support and partnership in industrial design and mechanical engineering, joining me in the core team and showcasing how an extraordinary innovation team can operate. The result of our project speaks for itself, with an end product that looks as good as it functions, with a real balance between form and function.
Owen Murphy, without whom we would have neither had a professionally designed PCB, nor gotten our firmware working. His background in electrical engineering and embedded software design was invaluable.
PCBWay, who donated their time, PCB stock, manufacturing capabilities, and financial support on this Theia project. Their expert experience in PCB printing offered us a leg up, ensuring that our processor looked and functioned professionally. PCBWay's partnership on the project showed how a United Nations innovation challenge could enable true global collaboration in the face of shared adversity.
Comments