Soil Moisture Sensor

wall_photo

Overview

Blip firmware reads the analog data of moisture sensor and writes to a ble service characteristic periodically every minute. A node.js script is running on a raspberry pi which connects to blip and subscribes to moisture service notification. When it gets the moisture data, it appends that to the time series graph on Web UI and write to MongoDB database as well.

Hardware components Used

  1. Blip
  2. Analog Soil Moisture Sensor
  3. Raspberry Pi 3 B+

Dependencies

Firmware

  1. Zephyr OS

Software and visualization

  1. Node.js, Express.js
  2. socket.io, mongoose
  3. noble
  4. Highcharts

Usage

To make use of this project, you should have a Blip board and a generic soil moisture sensor, connections should be as follows:

Connections

Blip Soil Moisture sensor
+5V VCC
GND GND
P0.03 VO

V0 is amplified analog output of conductivity between electrodes which changes with the moisture level.

Compiling and Flashing the Firmware

Firmware is developed using the Zephyr SDK, Please install zephyr from here and then execute following commands.

cd firmware
mkdir build && cd build
cmake -GNinja -DBOARD=nrf52840_blip ..
# Compile
ninja
# Flash
ninja flash

Running Node.js script and visualization

Node.js scripts extract the soil moisture data from ble packets and visualize the feeds on web browser. Please install Node.js and run these commands.

cd scripts
sudo node index.js

moisture feed

Demo Video

Here is the video of project in action.

Source Code

Firmware, node.js script and visualization code is available here.