~vz227

Plant Monitor on SAM3X8E MCU [C]

November 8, 2026

Tags: embedded ARM

Table of Contents

Summary

All plants require specific environmental conditions in order to thrive. These may include specific temperature range, soil moisture, light level et cetera. We wish to monitor these statistics in order to better tend to our plant(s)’ health.

Only a limited number of these parameters may feasibly be tracked manually with reasonable accuracy. Moreover, manual tracking quickly becomes impractical when tending to a larger number of plants.

To address this problem, we may use a microcontroller that runs a piece of software for this specific purpose. Moreover, to collect the necessary information from the outside world, a number of I/O peripheral devices are necessary.

For our purposes, we are interested in tracking specifically the room temperature, humidity, pressure, soil moisture, and light level. Thus, we will need a number of sensor peripheral devices for these variables.

Such a solution provides not only a way to accurately track environmental variables, it makes the addition and monitoring of more plants straightforward.

Hardware Architecture

AT91SAM3X8E Microcontroller

The microcontroller itself that our system will run on. A member of the ARM Cortex-M3 family with 512KB of flash memory and 96KB of SRAM. Includes internal peripherals that are essential for communicating with the chosen external devices. These are the Serial-Peripheral Interface (SPI) for communicating with the LCD display controller, the Two-Wire Interface (TWI or I2C) for communicating with the BME280 environment sensor, and the Analog-to-Digital Converter (ADC) for retrieving data from the soil moisture sensor.

Arduino DUE Development Board

The board holding the SAM3X8E chip. Provides a PCB that exposes the pins of the MCU allowing external peripherals to be connected. Moreover, provides power regulation, a clock source, and USB ports to load firmware.

LCD Display w/ ST7789VW Controller

2-inch LCD display on which the retrieved statistics are to be displayed. Communicates with the MCU via SPI. Driver must use the SPI interface implemented by the HAL to render text to the screen.

BME280 Environment Sensor (Humidity, Pressure, Temperature)

A combined humidity, pressure, and temperature sensor that can communicate with the MCU via either SPI or I2C interfaces. For the sake of variety, we will use the I2C interface as the ST7789VW controller already uses SPI.

Software Architecture

Compilation & Debugging

Demonstration

WIP


Credits