Skip to lesson content

Hardware & Sensors · Lesson 9 of 17

Pimoroni Automation HAT Mini

Automation HAT Mini

In the GreenWise monitor, the HAT Mini reads the soil probe and displays the result on its built-in colour screen.

Which terminals does the monitor use?

  • The three analogue screw-terminal inputs measure voltages up to 24 V. The moisture probe sends its signal to analogue input 1.
  • The board also has three digital inputs, three sinking outputs and one relay. A sinking output switches the ground side of a load. In the optional LED lesson, the supply feeds the LED through a resistor and output 1 provides its path to ground.

Fit the board and check an input

Shut down the Pi and disconnect its power. Align the HAT's socket with both rows of the Pi's 40-pin header, seat the board and reconnect the power.

Follow Pimoroni's installation instructions to enable I²C and SPI and install the Python libraries. If the installer creates its default virtual environment, activate it with source ~/.virtualenvs/pimoroni/bin/activate before running the examples.

With the soil moisture probe connected, run this command to read its voltage:

python -c "import automationhat; print(automationhat.analog.one.read())"

Compare readings from the same probe in dry and wet growing medium to interpret the voltage as relative moisture.