---
title: "Real-Time Laboratory Monitoring using Edge impulse"
url: "https://maker.wiznet.io/louis_m/projects/real-time-laboratory-monitoring-using-edge-impulse/"
markdown_url: "https://maker.wiznet.io/louis_m/projects/real-time-laboratory-monitoring-using-edge-impulse/md"
type: "UCC: User Created Content"
author: "Rahul Khanna D"
author_url: "https://www.hackster.io/rahulkhanna/real-time-laboratory-monitoring-using-edge-impulse-755813#comments"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "Rahul Khanna D"
original_url: "https://www.hackster.io/rahulkhanna/real-time-laboratory-monitoring-using-edge-impulse-755813#comments"
published: "2022-11-01"
language: "en"
likes: 6
views: 956
comments: 0
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Real-Time Laboratory Monitoring using Edge impulse

> Real-Time Laboratory Monitoring using Edge impulse

Original author: Rahul Khanna D (source: https://www.hackster.io/rahulkhanna/real-time-laboratory-monitoring-using-edge-impulse-755813#comments)

## Article

### **Why Did We Build This?**

The maintenance of the ambiance in places such as laboratories, especially chemical labs is essential. The temperature, humidity, and ambient light have to be monitored continuously and the level of Air quality and heat levels are used as an interrupt to prevent laboratory accidents.

![](https://hackster.imgix.net/uploads/attachments/1515889/40093_XyLiNfMT7B.jpg?auto=compress%2Cformat&w=740&h=555&fit=max)

### **Hardware Build**

WizFi360-EVB-Pico is based on Raspberry Pi RP2040 and adds Wi-Fi connectivity using WizFi360. It is pin compatible with the Raspberry Pi Pico board and can be used for IoT Solution development.

![](https://hackster.imgix.net/uploads/attachments/1515884/dsc00307_VHyF5zCz1n.JPG?auto=compress%2Cformat&w=740&h=555&fit=max)

### **Setting up IDE**

Open File -> Preferences, and enter the following into the Additional Boards Manager URLs

```plaintext
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
```

Now you can search for “wizfi” in the Boards Manager and install the latest package for Raspberry Pi Pico/RP2040. Add the [WizFi360EVB library](https://github.com/Rahul24-06/WizFi360EVB-Arduino)

![](https://hackster.imgix.net/uploads/attachments/1515881/screenshot_%2860%29_gni22gXxBF.png?auto=compress%2Cformat&w=740&h=555&fit=max)

Select the WIZnet WizFi360-EVB-Pico board and run the following blink code.

```plaintext
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(1000);                       // wait for a second
digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
delay(1000);                       // wait for a second
}
```

Now we have uploaded the code and the board is ready for this project.

### **Interfacing Sensor with WizFi360-EVB-PicoInterfacing Grove Temp&Humi Sensor (SHT40)**

![](https://hackster.imgix.net/uploads/attachments/1515931/image_8Q2taj5bbc.png?auto=compress%2Cformat&w=740&h=555&fit=max)

The SHT40 temperature is measured using a thermocouple method. A thermocouple consists of two types of metallic wires of different materials. One end of the two wires is welded together to form the working end, which is placed at the temperature to be measured. The other end is called the free end and is connected to the main control to form a closed loop.

- Download Grove Temp&Humi Sensor Code Library. Visit the [arduino-i2c-sht4x r](https://github.com/Sensirion/arduino-i2c-sht4x)epositories and download the entire repo to your local drive.

- Add the library to the Arduino IDE

Here we connect the SHT40 temperature and humidity sensor to the IO26 & IO27 pin of the WizFi360.

**Interfacing NeoPixel:**

The NeoPixel ring which I used is a 16-bit NeoPixel, i.e. the ring consists of 16 LEDs.

![](https://hackster.imgix.net/uploads/attachments/1515935/image_InsP8nEGGq.png?auto=compress%2Cformat&w=740&h=555&fit=max)

**Connections **:

WizFi360 ------------------------------------------WS2816

VBUS -> Vcc

GND -> Ground(0V)

IO13 -> DI (Data IN)

The NeoPixel library is attached to the repository. The color of the NeoPixel is switched depending on the temperature and humidity stored in the variables.

Make the Connection as shown below.

### **Edge Impulse TFLite Model Generation & Deployment**

We will use edge impulse to build & train the TensorFlow Lite model. We will be collecting the gas sensor data for the following cases

- Temperature

- Humidity

- Pressure

We will be creating an edge impulse project named **Lab Monitoring - Anomaly Detection. **Running the following command will require your edge impulse email & password.

```plaintext
edge-impulse-daemon
```

![](https://hackster.imgix.net/uploads/attachments/1515951/ss1_yFZEBBput4.png?auto=compress%2Cformat&w=740&h=555&fit=max)

We have a 65% & 35% split for training and testing data. Next, we create Impulse and add the processing block with Flattern that Flatten an axis into a single value, useful for slow-moving averages like temperature data, in combination with other blocks. Next, we add a Keras Classification learning block, then click on Save Impulse. Next, we click the Generate features to train the model. After a few minutes, we can see the output in the Feature Explorer.

![](https://hackster.imgix.net/uploads/attachments/1515952/ss2_tkAlYn7ucf.png?auto=compress%2Cformat&w=740&h=555&fit=max)

You can visualize the features using the feature explorer.

![](https://hackster.imgix.net/uploads/attachments/1515953/ss3_8Lho4utMGg.png?auto=compress%2Cformat&w=740&h=555&fit=max)

Now we can deploy the model by exporting it into an Arduino library. Go to the Deployment tab in the left navigation. Select **Arduino,** Click **Build** to download the Arduino Library.

- Go to Sketch > Libraries > Add.ZIP Library, Select the library downloaded from Edge Impulse

- Open the** WizFiAnomalyDetector.ino** file and Upload the

### **Enclosure**

I used an Acrylic enclosure for this project. First, I placed all the circuitry inside the enclosure and screw it firmly. I made a small opening for the Neopixel Ring and the Temperature sensor. Finally, all the screws are firmly mounted and the power cable is inserted via a slot.

![](https://hackster.imgix.net/uploads/attachments/1516008/real-time_laboratory_monitoring_2_JGD38TpNs4.png?auto=compress%2Cformat&w=740&h=555&fit=max)

### **Step 7: Let's See It Working**

This data that is logged can be displayed on either a website or with a mobile application.

### **Video:**

[Embedded media](https://www.youtube.com/embed/99ddR2ZpUAg?rel=0)

Give a thumbs up if it really helped you and do follow my channel for interesting projects. :)

Share this video if you like.

Happy to have you subscribed: <https://www.youtube.com/channel/UCks-9JSnVb22dlqtMgPjrlg/videos>

**Thanks for reading!**

---

Source: https://maker.wiznet.io/louis_m/projects/real-time-laboratory-monitoring-using-edge-impulse/
