In a microbiological laboratory, an incubator is an essential piece of equipment for incubating samples at the correct temperature. It ensures that microbiological samples are kept in a stable and regulated environment, which is crucial for accurate testing. To maintain optimal conditions, it's important to monitor the incubator for factors such as temperature, humidity, CO2 level, light intensity, and airflow. Regular incubator monitoring can prevent the loss or damage of samples due to equipment failure, power outage, human error, or contamination. With remote incubator monitoring, users can access real-time data, alerts, and reports on the incubator's performance and status, and control and troubleshooting. In this project, we explain how we created a network of sensors to collect and transmit data from an incubator at BioClub Tokyo to a cloud platform for storage, processing, and visualization. We also discuss the advantages and difficulties of our approach, as well as plans for the future development of the incubator management system.
About BioClub TokyoBioClub Tokyo is a bio-community space that aims to promote DIY biology, bio-art, and bio-design among the public. They provide a platform for collaboration and experimentation with biology and host regular events, including talks, workshops, exhibitions, and hackathons, to educate people about various topics related to biologies, such as natural history, wildlife filmmaking, creature design, microbiology, synthetic biology, biohacking, and more. Additionally, BioClub Tokyo has a lab where members can access equipment and materials for their projects. The BioClub utilizes a significant amount of DIY equipment.
Why Cellular NetworksCellular networks and Wi-Fi are two different ways to connect to the Internet, and each has its pros and cons depending on the situation. We can make use of a Wi-Fi network to achieve the same functionality but we have considered cellular networks over a Wi-Fi network for the following reasons.
Data always encrypted: Security is often a concern with shared Wi-Fi, because depending on the network, data may not be encrypted. With cellular, data is always encrypted, ensuring data remains private. While it may not be a significant issue for a proof-of-concept project, it is a requirement in an actual laboratory setting when we want to control the device.
Unlimited wireless range: While Wi-Fi's capacity is limited to the range of the router, cellular internet connectivity has no set range. Devices can connect from anywhere there's a cellular signal. Our goal was to ensure the setup's portability in case we need to relocate the device in the future.
No access to a router required: With cellular connectivity, there's no need for a router nearby because the data flows directly from the device to the cellular network, just like with a mobile phone. As the lab uses the Wi-Fi network provided by a co-working facility and we have no control over it, we opted to use a cellular network for greater autonomy.
Resilient connectivity: Wi-Fi is notoriously patchy in any deployment and can have dead spots, require router resets, and lead to signal disruption. Cellular data is more resilient and reliable, especially for applications that require constant connectivity.
Exclusive spectrum bands: Wi-Fi operates in unlicensed bands that don't require permission to use, but also face interference from other devices and networks. Cellular technology operates in licensed spectrum bands that are meant to prevent interference and ensure the quality of service.
Hardware selectionFor this project, we need network connectivity that is dependable, energy-efficient, and simple to handle. To achieve this, we will employ the Blues Cellular Notecard, along with the Notecarrier-B. We will be utilizing Seeed Studio XIAO RP2040 with a Grove Shield to connect sensors.
Blues LTE-M Notecard Global
Blues Notecard is an embeddable data storage and transport module for cellular IoT products. It allows for the transfer of Notes, which can be either JSON-formatted or binary data, between the device and the cloud in both directions.
Notecarrier-B
Notecarriers offer breakout connections for the Notecard, as well as circuitry to provide power management, protection, and signal amplification.
Seeed XIAO RP2040 and Grove Shield
The XIAO RP2040 is a cost-effective yet highly capable development board. It functions as a host MCU for the Notecard and can easily connect to sensors through the Grove Shield without requiring any soldering. It's important to ensure that there are no loose wires present in the laboratory setting.
Seeed Grove VOC and eCO2 Gas Sensor (SGP30)
SGP30 is a digital multi-pixel gas sensor that provides TVOC (Total Volatile Organic Compounds) and equivalent CO2 output.
Seeed Grove Temperature & Humidity Sensor (SHT40)
SHT40 is a digital Humidity and Temperature sensor which has an accuracy rate of up to ±1.8% ~ ±3.5% RH and ±0.2 °C, and an operating range of 0% to 100% RH, -40°C to +125°C. For the task at hand, it is crucial to have temperature-sensing capabilities with high resolution.
The DIY incubator used for this project is a small affordable, and portable refrigerator that has been repurposed for incubation purposes.
As demonstrated in the image below, a slender pathway has been established to allow for the insertion of sensor connectors.
The sensors are mounted inside the incubator.
To install the Notecard, place it into the M.2 slot on the Notecarrier-B gently and tighten it using the provided screw to secure it. Secure the u.FL connector of the cellular antenna to the MAIN socket on the Notecard. The power is provided to the Notecard using the USB connector on the Notecarrier-B. The host MCU, XIAO RP2040, is powered through one of the Grove I2C connectors via the Notecarrier-B's Qwiic connector. The host MCU uses the I2C communication protocol to communicate with the Notecard through the Qwiic connector. The sensors are connected to the other Grove I2C connector via a Grove I2C Hub. To mount the assembled hardware safely, we utilized an acrylic plate and secured it to the outer side of the incubator with double-sided tape.
This is what the hardware looks like when it's assembled and mounted.
The high-level connectivity diagram is given below.
We need to set up Notehub, which is a cloud service that receives data from the Notecard and allows us to manage the device, and route that data to our own or 3rd party cloud apps and services. We can create a free account at https://notehub.io/sign-up and after successful login, we can create a new project.
We should copy the ProductUID which is used by Notehub to associate the Notecard to the project created.
Notecard ConfigurationFirst, connect the Notecarrier-B to a computer via a USB cable. We should see a red LED flash repeatedly while it's booting up. We will be using the in-browser REPL to configure the Notecard which can be accessed at https://dev.blues.io/notecard-playground. Click on the USB Notecard button and pair the device as shown in the images below.
We would be able to see the REPL after a successful pairing.
To associate the Notecard with the project in Notehub, we need to provide ProductUID for the project. Write the request (given below) in the text field above and click on the paper plane button.
> {"req":"hub.set", "product":"com.xxx.xxxxx:incubator"}
To synchronize the Notecard with the Notehub, send the request below.
> {"req":"hub.sync"}
After the synchronization process is finished, the response to the subsequent request will provide the UNIX Epoch time of the latest sync and the duration in seconds since the last completed synchronization.
> {"req":"hub.sync.status"}
{
"time": 1688462830,
"completed": 4
}
Route ConfigurationWe will be displaying the live sensors data using the Datacake, a data streaming and visualization tool, that's easy to set up and configure. We would need to create a Datacake account. We can create a route by clicking the Create Route link at the top right on the Notehub Route page. Please follow the instructions given in the comprehensive tutorial offered by Blues, for leveraging the General HTTP/HTTPS Request/Response route type to invoke the Datacake API.
To ensure that the correct Notecard outbound file data is sent to Datacake, we need to specify the desired filters in the Filters section. This guarantees that the data sent is always the intended data. In the application code, we would add notes to the data.qo file.
We need to provide a specific HTTP payload decoder in the Datacake device configuration to parse the incoming data from the Notehub.
To visualize the sensor data we need to add a dashboard with Value and Chart widgets.
We can add and format the widgets as shown below.
Please follow the instructions here to download and install Arduino IDE. After installation, open the Arduino IDE and install the board package for the RP2040 by going to Tools > Board > Boards Manager. Search the board package as shown below and install it.
After the board package installation is completed, choose the Seeed XIAO RP2040 from Tools > Board > Raspberry Pi RP2040 Boards menu and select the serial port of the connected board from Tools > Port menu. We need to install the Blues Wireless Notecard library using the Library Manager (Tool > Manage Libraries...) as shown below.
Similarly, we can find and install the Adafruit SGP30 and Adafruit SHT4x sensor libraries.
FirmwareWe can utilize the following Arduino sketch to collect data hourly and transmit it to the Notehub. Create a new sketch with the following code and compile/upload the firmware to the connected XIAO RP2040.
#include <Notecard.h>
#include "Adafruit_SGP30.h"
#include "Adafruit_SHT4x.h"
#define LEDB 25
#define LEDG 16
#define LEDR 17
#define PRODUCT_UID "com.xxx.xxxx:incubator"
#define myProductID PRODUCT_UID
Notecard notecard;
Adafruit_SHT4x sht4 = Adafruit_SHT4x();
Adafruit_SGP30 sgp;
/* return absolute humidity [mg/m^3] with approximation formula
@param temperature [°C]
@param humidity [%RH] !`
*/
uint32_t getAbsoluteHumidity(float temperature, float humidity)
{
// approximation formula from Sensirion SGP30 Driver Integration chapter 3.15
const float absoluteHumidity = 216.7f * ((humidity / 100.0f) * 6.112f * exp((17.62f * temperature) / (243.12f + temperature)) / (273.15f + temperature)); // [g/m^3]
const uint32_t absoluteHumidityScaled = static_cast<uint32_t>(1000.0f * absoluteHumidity); // [mg/m^3]
return absoluteHumidityScaled;
}
void errorLoop(unsigned int delay_ms)
{
while (1) {
digitalWrite(LEDR, LOW);
delay(delay_ms);
digitalWrite(LEDR, HIGH);
delay(delay_ms);
Serial.println("Error");
}
}
void setup()
{
// keep LEDs off
pinMode(LEDR, OUTPUT);
pinMode(LEDG, OUTPUT);
pinMode(LEDB, OUTPUT);
digitalWrite(LEDR, HIGH);
digitalWrite(LEDG, HIGH);
digitalWrite(LEDB, HIGH);
if (! sgp.begin()) {
Serial.println("SGP30 not found :(");
errorLoop(500);
}
if (! sht4.begin()) {
Serial.println("Couldn't find SHT40");
errorLoop(500);
}
sht4.setPrecision(SHT4X_HIGH_PRECISION);
sht4.setHeater(SHT4X_NO_HEATER);
notecard.begin();
J *req = notecard.newRequest("hub.set");
if (myProductID[0])
{
JAddStringToObject(req, "product", myProductID);
}
JAddStringToObject(req, "mode", "continuous");
notecard.sendRequestWithRetry(req, 5);
}
void loop()
{
// SHT30
sensors_event_t humidity, temp;
sht4.getEvent(&humidity, &temp);
// SGP40
sgp.setHumidity(getAbsoluteHumidity(temp.temperature, humidity.relative_humidity));
if (! sgp.IAQmeasure()) {
Serial.println("Measurement failed");
return;
}
J *req = notecard.newRequest("note.add");
if (req != NULL) {
JAddBoolToObject(req, "sync", true);
J *body = JAddObjectToObject(req, "body");
if (body != NULL) {
JAddNumberToObject(body, "temperature", temp.temperature);
JAddNumberToObject(body, "humidity", humidity.relative_humidity);
JAddNumberToObject(body, "TVOC", sgp.TVOC);
JAddNumberToObject(body, "eCO2", sgp.eCO2);
}
notecard.sendRequest(req);
}
delay(60UL * 60UL * 1000UL); // every hour
}
Data VisualizationIn the Datacake dashboard, users can view updated sensor data values on an hourly basis. Also, the chart below displays the temperature data for the past week.
Our goal is to remotely regulate the temperature of the incubator. The incubator has temperature control circuitry that enables manual temperature adjustments using push buttons to maintain a consistent temperature. We are exploring the best way to bypass the onboard MCU, which may be a PIC, to utilize the XIAO RP2040 for control. The Blues Notecard can receive commands through Notehub and can be used to regulate the temperature. Below is a tear-down image of the incubator front panel.
In this project, we have designed and implemented a system that uses a cellular network to monitor the temperature, humidity, and gas concentration of a lab incubator remotely. This system can be useful for researchers who need to monitor their experiments in the incubator without being physically present in the lab. This system can also be extended to support other types of sensors for different applications and can provide alerts via SMS or email when the temperature or humidity exceeds a predefined threshold.
AcknowledgmentI would like to express my appreciation to Georg Tremmel and Shohei Asami for introducing me to the BioClub Tokyo lab and inviting me to give a presentation on this project during a talk.
Comments