Setting up the soil sensor
In this section, we will interface and test the soil sensor to the Pico. A Fritzing schematic of the soil sensor is shown here:
Pico Pinout
A pinout reference card for the Pico will come in handy while wiring up components. We provided a link to the pinout card in Chapter 1, Getting Started with the Raspberry Pi Pico.
The soil sensor comes with an I2C interface, and the STEMMA soil sensor connector consists of four pins—namely SCL, SDA, VIN, and GND. If you are not familiar with the I2C interface, we recommend reading Chapter 2 of this book, Serial Interfaces and Applications. In the Fritzing schematic, looking from left to right, the soil sensor is connected to the Pico as follows:
- SCL to the GP9 pin of the Pico.
- SDA to the GP8 pin of the Pico.
- VIN to the 3.3V pin of the Pico.
- The GND pins are tied together.
Pull-Up Resistors...