Building Smarter Gardens with ANAVI Gardening uHAT and the Yocto Project

If you have ever wanted to turn your Raspberry Pi into a smart gardening assistant, our ANAVI Gardening uHAT is a simple, low-cost way to get started. This open source add-on board makes it easy to monitor and care for your plants with sensors for soil moisture, temperature, humidity, barometric pressure, and light. Best of all, there is no soldering, special tools, or complicated setup. Just plug the board into your Raspberry Pi with your bare hands, follow the user manual, and you are ready to go. First introduced in 2021 through a successful Crowd Supply campaign, the ANAVI Gardening uHAT is now widely available through distributors such as Mouser Electronics. While the official documentation is based on Raspberry Pi Operating System, the board works with any Raspberry Pi single-board computer and any Linux distribution designed for it. This makes the ANAVI Gardening uHAT not just a hobbyist gadget, but also a versatile tool for anyone experimenting with Internet of Things (IoT), agricultural technology, or embedded Linux.

The Yocto Project Meets Raspberry Pi Gardening

In early 2025, Leon Anavi, the creator of the ANAVI Gardening uHAT, launched a new series of video tutorials on the Yocto Project and OpenEmbedded. These tools, maintained under the Linux Foundation, have become the industry standard for building custom Linux distributions for embedded devices.

In episode 10 from September 2025, Leon demonstrates how to enable the Serial Peripheral Interface (SPI) on a Raspberry Pi and use it with the Microchip MCP3002 10-bit analog-to-digital converter (ADC) integrated into the ANAVI Gardening uHAT. This allows you to connect analog sensors, such as a capacitive soil moisture sensor, and read their data in real time.

Step-by-Step: Enabling Serial Peripheral Interface with Yocto

If you want to try the tutorial yourself, here is a simplified version of the steps Leon used in the video. These examples are based on the Yocto Long Term Support (LTS) release Scarthgap and use the meta-raspberrypi board support package (BSP) layer.

  1. Enable Serial Peripheral Interface support
    Add the following line to your conf/local.conf: ENABLE_SPI_BUS = "1"
  2. Include required Python packages
    Extend your Linux image with the spidev library (used in the examples), plus some helpful tools: IMAGE_INSTALL:append = " python3-spidev"
  3. Build and flash your image
    Build the core-image-base, flash it to a microSD card, and boot your Raspberry Pi.
  4. Run Python code to read sensor values
    Open a Python 3 interactive shell and use this example code snippet to start reading data from a capacitive soil moisture sensor through the MCP3002 analog-to-digital converter.

Why This Matters

This combination of ANAVI Gardening uHAT and the Yocto Project is more than just a fun do-it-yourself experiment. It is a hands-on way to learn about:

  • Embedded Linux development
  • Custom Raspberry Pi distributions
  • Practical Internet of Things (IoT) applications in agriculture

For hobbyists, it means you can monitor your houseplants or small garden with open source hardware and software. For professionals, it is a chance to explore how Yocto-powered Linux images can streamline development in real-world embedded projects.

You may also like

ANAVI Info uHAT Used in Yocto Project I²C Tutorial on Raspberry Pi 5

ANAVI Info uHAT is an affordable, open-source Raspberry Pi add-on board that brings extra functionality in a compact form. It features a mini OLED display, three buttons, red and green indicator LEDs, and slots for various sensors. Each kit includes a 0.96″ yellow-blue I²C OLED display with a resolution of 128×64 pixels.

Originally crowdfunded on Crowd Supply in 2022, the board is now available from various distributors, including Mouser. While our documentation is based on Raspberry Pi OS, ANAVI Info uHAT works with any Raspberry Pi computer model and Linux distribution running on Raspberry Pi.

At the start of 2025, Leon Anavi launched a series of video tutorials on the Yocto Project and OpenEmbedded. The Yocto Project, a collaborative initiative under the Linux Foundation, has become the de facto industry standard for creating custom Linux distributions tailored for embedded devices.

In Episode 9 from September 2025, Leon demonstrates how to enable I²C on a Raspberry Pi and use it with an SSD1306 mini OLED display. To simplify wiring, he used the ANAVI Info uHAT, attaching it directly to the Raspberry Pi 5’s 40-pin header, while the OLED display connected to its dedicated I²C port.

Thanks to meta-raspberrypi, a community-maintained Yocto/OpenEmbedded BSP (Board Support Package) layer, enabling I²C and autoloading its Linux kernel modules is as simple as adding two lines to conf/local.conf:

ENABLE_I2C = "1"
KERNEL_MODULE_AUTOLOAD:rpi += "i2c-dev i2c-bcm2708"

The demonstration from the video tutorial also included useful packages in the Yocto image to scan for I²C devices and interact with the SSD1306 OLED display:

IMAGE_INSTALL:append = " i2c-tools ssd1306"

After building core-image-base and booting it on the Raspberry Pi, you can test the OLED using the open-source ssd1306_bin tool. Here are some sample commands from the tutorial:

ssd1306_bin -n 1 -I 128x64
ssd1306_bin -n 1 -c
ssd1306_bin -n 1 -r 0
ssd1306_bin -n 1 -x 1 -y 1
ssd1306_bin -n 1 -l "Hello World"
ssd1306_bin -n 1 -x 1 -y 2
ssd1306_bin -n 1 -l "The Yocto Project"
ssd1306_bin -n 1 -x 1 -y 3
ssd1306_bin -n 1 -l "on Raspberry Pi 5"

This tutorial builds on concepts from previous episodes in the series, so if you are new to the Yocto Project on Raspberry Pi 5, it is highly recommended to start from the beginning. Watching the full video will give you a detailed walkthrough and context for each step.

You may also like