Connecting the STEMMA Soil Sensor

We recommend using a Female-to-Female STEMMA Connector and plugging it in between the PyPortal and the STEMMA Soil Sensor. No soldering is involved - just connect the cable between the Stemma Soil Sensor and the PyPortal I2C port.

1 x STEMMA Cable
STEMMA Cable - 150mm/6" Long 4 Pin JST-PH Cable–Female/Female

The cable makes the following connections between the PyPortal's I2C port and the STEMMA Soil Sensor:

  • PyPortal 3.3V to Sensor VIN
  • PyPortal GND to Sensor GND
  • PyPortal SCL to Sensor SCL
  • PyPortal SDA to Sensor SDA

Connecting the Peristaltic Liquid Pump

Add a ground and power wire to the end of the DC motor using alligator clips or by soldering wires directly to the terminals.

Make the following connections:

  1. Connect the JST PH 3-Pin to Male Header Cable to the D3 STEMMA connector on the PyPortal.
  2. Connect the header cable's power (red) and ground (black) to the breadboard's red and blue power rails.
  3. Ensuring the flat side of the transistor is facing towards the PyPortal; Connect the emitter to the GND rail. 
  4. Connect the transistor's base to one lead of the 220ohm resistor. Connect the other lead of the resistor to the white (yellow in this wiring diagram) male header cable.
  5. Connect the female DC power adapter to the power and ground rails on the opposite side of the breadboard.
  6. Connect the left and right ground rails together.
  7. Connect the DC motor's power (green in this diagram) to the red power rail. 
  8. Connect one lead of a 1N4148 diode to the transistor's collector lead.
  9. Connect one end of the motor to the striped diode lead. Connect the motor's other terminal to the  un-striped diode lead.
  10. Re-read the notes above the diagram to ensure you did not make any errors while connecting components. It does not matter which way you connect the motor's leads for now.

When you're ready, stick the STEMMA Soil sensor into your plant's soil. Be sure to leave the white portion of the sensor not covered by soil. You may also want to position the sensor at the edge of your planter.

Affix one end of the silicone tubing from the end of the pump to the planter (tape, putty or glue work great), positioning it away from the soil sensor.

Insert the other end of the silicone tubing into a water bottle. The pump will be fed from the water bottle. Select the largest/widest bottle you have.

This guide was first published on Aug 28, 2019. It was last updated on Aug 28, 2019.
This page (PyPortal Wiring) was last updated on Oct 11, 2020.