# Adafruit Simple Soil Moisture Sensor

## Overview

![the breakout with a micro:bit in a plant](https://cdn-learn.adafruit.com/assets/assets/000/138/214/medium800/sensors_6362-05.jpg?1751984645 )

Perfect for educational uses, the **Adafruit Simple Soil Moisture Sensor** is low cost and easy to use. This is a simple _resistive_ style moisture sensor, where there are two prongs and the sensor measures the conductivity between the two. We gold-plated the prongs to reduce the risk of oxidation - if you see build-up on the prongs, clean them off with a dish-scrubber to keep the sensor clean.

![front view of the board](https://cdn-learn.adafruit.com/assets/assets/000/138/215/medium800/sensors_6362-03.jpg?1751984687 )

While not as advanced as a capacitive or frequency-based sensor, these are really easy to use! We're stocking this sensor for folks who want to use it with a micro:bit or Arduino or other board with an analog input. It won't work with a Raspberry Pi because those don't have analog inputs - [for that use one of our capacitive sensors](https://www.adafruit.com/product/4026).

![back view of the board](https://cdn-learn.adafruit.com/assets/assets/000/138/216/medium800/sensors_6362-01.jpg?1751984725 )

Getting started is super easy!

- **When using with a micro:bit** you'll need some [small alligator clips](https://www.adafruit.com/product/4100). Connect the GND pad from the 'bit to the GND pad on the sensor. Connect the 3V pad to the 3V pad. Then connect the 0 pad on the 'bit to the OUT pad on the sensor (you can also use 1 or 2 pad on the 'bit). Then, on the micro:bit, read the analog value. When soil is dry, the reading will be under 100. As the soil gets wetter, it will rise to 1000.
- **On an Arduino,** connect 3V to the 3V output pin (or 5V if there's no 3V pin) and GND to ground. You can either use [alligator-clips-to-pins](https://www.adafruit.com/product/3255) or a [JST SH to 3-pin cable](https://www.adafruit.com/product/5755). Then connect the OUT to A0 or another analog input. When you use analogRead() you'll see dry soil at \< 100 and wet soil \> 600.

Either way, no soldering is required!

**Please note: This is just the sensor. You'll also need alligator clips or a JST-SH cable to connect to it!**

# Adafruit Simple Soil Moisture Sensor

## Pinouts

![front and back view of the breakout](https://cdn-learn.adafruit.com/assets/assets/000/138/382/medium800/sensors_double.jpg?1752500195 )

## Power Pins

- **3V** &nbsp;- this is the power pad.&nbsp;It can be powered by 3V or 5V. Give it the same power as the logic level of your microcontroller - e.g. for a 5V micro like Arduino, use 5V.
- **GND** &nbsp;- common ground pad for power and logic.

## Moisture Sensor Output

- **Soil Prongs** - there are two gold-plated prongs on the board that are inserted into the soil. The conductivity between these two prongs are used to read resistance and determine the moisture level in the soil.
- **OUT** - this is the analog sensor output. It is a measurement of the conductivity between the two prongs on the board. It is laid out as a large pad at the top edge of the board for use with an alligator clip.

## JST-SH Port

On the left side of the board is a 3-pin **JST-SH port**. This port lets you plug in a [JST-SH to 3-pin cable](https://www.adafruit.com/product/5755) to access the **GND** , **3V** and **OUT** signals separate from the large pads along the top edge of the board. This is handy if you want to use this sensor without alligator clips.

# Adafruit Simple Soil Moisture Sensor

## CircuitPython

Warning: This code will not run on a Raspberry Pi single board computer since it does not have an analog input.

It's easy to use the **Simple Soil Moisture Sensor** with CircuitPython, and the&nbsp;[analogio core module](https://docs.circuitpython.org/en/latest/shared-bindings/analogio/) module. This module allows you to easily write Python code to read analog input data from the soil sensor.

### JST SH Compatible 1mm Pitch 3 Pin to Premium Male Headers Cable

[JST SH Compatible 1mm Pitch 3 Pin to Premium Male Headers Cable](https://www.adafruit.com/product/5755)
If you fancy connecting to&nbsp;anything else with a JST SH compatible 3-pin connector, this cable will do the trick. For example, our [NeoPixel JST Breakout boards](https://www.adafruit.com/product/5975), or [UPDI Friend](https://www.adafruit.com/product/5879), or <a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/5755)
[Related Guides to the Product](https://learn.adafruit.com/products/5755/guides)
![angled shot of 100mm long JST-SH 3-pin cable with male headers.](https://cdn-shop.adafruit.com/640x480/5755-02.jpg)

## CircuitPython Microcontroller Wiring

First wire up the breakout to your board exactly as follows. The following is the sensor wired to a Circuit Playground Express with alligator clips:

- **Board 3.3V** to **sensor 3V (red wire)**
- **Board GND** to **sensor GND (black wire)**
- **Board A0** to **sensor OUT (white wire)**

![cpx fritzing with sensor](https://cdn-learn.adafruit.com/assets/assets/000/138/407/medium640/sensors_featherGator_bb.jpg?1752531537)

Here is a Metro M0 Express wired up using a 3-pin JST-SH cable:

- **Board 3.3V** to **sensor JST-SH 3V (red wire)**
- **Board GND** to **sensor JST-SH GND (black wire)**
- **Board A0** to **sensor JST-SH OUT (white wire)**

![metro m0 express fritzing](https://cdn-learn.adafruit.com/assets/assets/000/138/408/medium640/sensors_featherJST_bb.jpg?1752531593)

## CircuitPython Usage

To use with CircuitPython, you need to&nbsp;update **code.py** with the example script.

Thankfully, we can do this in one go. In the example below, click the **Download Project Bundle** button below to download the necessary libraries and the **code.py** file in a zip file. Extract the contents of the zip file, and copy&nbsp;the **code.py** file to your **CIRCUITPY** drive.

Your **CIRCUITPY/lib** folder will be empty since the example is only using core modules that are built into the **CIRCUITPY** drive.

![CIRCUITPY drive](https://adafruit.github.io/Adafruit_Learning_System_Guides/Simple_Soil_Sensor_Demos_CircuitPython_Simple.png )

Info: The /lib folder will be empty since the example is only using core modules.

## Example Code

Once everything is saved to the **CIRCUITPY** drive, [connect to the serial console](https://learn.adafruit.com/welcome-to-circuitpython/kattni-connecting-to-the-serial-console) to see the data printed out!

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Simple_Soil_Sensor_Demos/CircuitPython_Simple/code.py

The soil moisture data is read as a 16-bit analog value. If the reading is below `2000`, the soil is dry. Above that, it is moist.

![serial console output from circuitpython](https://cdn-learn.adafruit.com/assets/assets/000/138/385/medium800/sensors_Screenshot_2025-07-14_164306.png?1752525801 )

## Advanced Sensing

One disadvantage to the soil sensor is that the soil probes can oxidize over time. There is a "hack" you can do to prolong the life of the probes. You can connect the sensor 3V pad to a digital pad on the microcontroller and turn it "on" only when you're getting an analog reading.

## Advanced Wiring

First wire up the breakout to your board exactly as follows. The following is the sensor wired to a Circuit Playground Express with alligator clips:

- **Board D5** &nbsp;to **sensor 3V (red wire)**
- **Board GND** to **sensor GND (black wire)**
- **Board A0** to **sensor OUT (white wire)**

![cpx fritzing with sensor](https://cdn-learn.adafruit.com/assets/assets/000/138/409/medium640/sensors_featherGatorAdv_bb.jpg?1752531618)

Here is a Metro M0 Express wired up using a 3-pin JST-SH cable:

- **Board D5** &nbsp;to **sensor JST-SH 3V (red wire)**
- **Board GND** to **sensor JST-SH GND (black wire)**
- **Board A0** to **sensor JST-SH OUT (white wire)**

![metro m0 express fritzing](https://cdn-learn.adafruit.com/assets/assets/000/138/410/medium640/sensors_featherJSTadv_bb.jpg?1752531659)

## Advanced Example
https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Simple_Soil_Sensor_Demos/CircuitPython_Advanced/code.py

The soil moisture data is read as a 16-bit analog value. If the reading is below `2000`, the soil is dry. Above that, it is moist. Before a reading, pin 5 is set to `True`, turning on the sensor. After the reading, pin 5 is set to `False`, turning the sensor off.

# Adafruit Simple Soil Moisture Sensor

## Arduino

Using the Simple Soil Moisture Sensor with Arduino involves wiring up the sensor to your Arduino-compatible microcontroller and running the provided example code.

You can connect to the sensor with alligator clips or the JST-SH port.

### Small Alligator Clip to Male Jumper Wire Bundle - 12 Pieces

[Small Alligator Clip to Male Jumper Wire Bundle - 12 Pieces](https://www.adafruit.com/product/3255)
For bread-boarding with unusual non-header-friendly surfaces, these cables will be your best friends! No longer will you have long strands of alligator clips that are grabbing little wires. These compact jumper cables have a premium male header on one end, and a grippy mini alligator clip on...

In Stock
[Buy Now](https://www.adafruit.com/product/3255)
[Related Guides to the Product](https://learn.adafruit.com/products/3255/guides)
![ Bundle of Small Alligator Clip to Male Jumper Wires](https://cdn-shop.adafruit.com/640x480/3255-02.jpg)

### JST SH Compatible 1mm Pitch 3 Pin to Premium Male Headers Cable

[JST SH Compatible 1mm Pitch 3 Pin to Premium Male Headers Cable](https://www.adafruit.com/product/5755)
If you fancy connecting to&nbsp;anything else with a JST SH compatible 3-pin connector, this cable will do the trick. For example, our [NeoPixel JST Breakout boards](https://www.adafruit.com/product/5975), or [UPDI Friend](https://www.adafruit.com/product/5879), or <a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/5755)
[Related Guides to the Product](https://learn.adafruit.com/products/5755/guides)
![angled shot of 100mm long JST-SH 3-pin cable with male headers.](https://cdn-shop.adafruit.com/640x480/5755-02.jpg)

## Wiring

Wire as shown for a **5V** board like an Uno. If you are using a **3V** board, like an Adafruit Feather, wire the board's 3V pin to the sensor 3V.

Here is an Adafruit Metro wired up to the sensor using alligator clips with jumper wires:

- **Board 5V** to **sensor 3V (red wire)**
- **Board GND** to **sensor GND (black wire)**
- **Board A0** to **sensor OUT (white wire)**

![metro with gator to sensor](https://cdn-learn.adafruit.com/assets/assets/000/138/399/medium640/sensors_metroGator_bb.jpg?1752530705)

Here is an Adafruit Metro wired up using a 3-pin JST-SH cable:

- **Board 5V** to **sensor JST-SH 3V (red wire)**
- **Board GND** to **sensor JST-SH GND (black wire)**
- **Board A0** to **sensor JST-SH OUT (white wire)**

![](https://cdn-learn.adafruit.com/assets/assets/000/138/400/medium640/sensors_metroJst_bb.jpg?1752530761)

Info: There are no additional libraries needed for the example code.

## Example Code
https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Simple_Soil_Sensor_Demos/Arduino/metroSimpleSoilSensor/metroSimpleSoilSensor.ino

![serial plotter output](https://cdn-learn.adafruit.com/assets/assets/000/138/388/medium800/sensors_Screenshot_2025-07-14_172208.png?1752528157 )

Upload the sketch to your board and open up the Serial Plotter ( **Tools -\> Serial Plotter** ) at 115200 baud. You'll see Every five seconds, the analog reading from the sensor will be written to the plotter.

## Advanced Sensing

One disadvantage to the soil sensor is that the soil probes can oxidize over time. There is a "hack" you can do to prolong the life of the probes. You can connect the sensor 3V pad to a digital pad on the Arduino-compatible microcontroller and turn it "on" only when you're getting an analog reading.

## Advanced Wiring

Wire as shown for a **5V** board like an Uno. If you are using a **3V** board, like an Adafruit Feather, wire the board's 3V pin to the sensor 3V.

Here is an Adafruit Metro wired up to the sensor using alligator clips with jumper wires:

- **Board D2** &nbsp;to **sensor 3V (red wire)**
- **Board GND** to **sensor GND (black wire)**
- **Board A0** to **sensor OUT (white wire)**

![fritzing with metro and gator](https://cdn-learn.adafruit.com/assets/assets/000/138/402/medium640/sensors_metroGatorAdv_bb.jpg?1752530830)

Here is an Adafruit Metro wired up using a 3-pin JST-SH cable:

- **Board D2** to **sensor JST-SH 3V (red wire)**
- **Board GND** to **sensor JST-SH GND (black wire)**
- **Board A0** to **sensor JST-SH OUT (white wire)**

![fritzing for metro with jst-sh](https://cdn-learn.adafruit.com/assets/assets/000/138/401/medium640/sensors_metroJstAdv_bb.jpg?1752530790)

## Advanced Example Code
https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Simple_Soil_Sensor_Demos/Arduino/metroAdvSoilSensor/metroAdvSoilSensor.ino

Upload the sketch to your board and open up the Serial Plotter ( **Tools -\> Serial Plotter** ) at 115200 baud. Every five seconds, pin 2 will be set&nbsp;`HIGH` to power up the sensor. Then, the analog reading from the sensor will be written to the plotter.&nbsp;After the reading, pin 2 is set `LOW` to turn off power to the sensor.

# Adafruit Simple Soil Moisture Sensor

## micro:bit and MicroPython

![microbit micropython](https://cdn-learn.adafruit.com/assets/assets/000/138/294/medium800/sensors_Screenshot_2025-07-09_162456.png?1752092742 )

You can use the [micro:bit Python Editor](https://python.microbit.org/v/3/reference) to write MicroPython code for the **Soil Moisture Sensor**. The `microbit` library lets you easily access all of the pins and features on the micro:bit.

## Wiring

Use alligator clips to connect the soil moisture sensor to the micro:bit.

- **micro:bit 3V** to **sensor 3V (red wire)**
- **micro:bit GND** to **sensor GND (black wire)**
- **micro:bit 0** to **sensor OUT (white wire)**

![microbit fritzing](https://cdn-learn.adafruit.com/assets/assets/000/138/295/medium640/sensors_microBitGator_bb.jpg?1752092876)

## Code

The MicroPython code reads the analog&nbsp;`moisture` value for 5 seconds on pin 0. If the&nbsp;`moisture` level is greater than `200`, the LED matrix shows a happy face. Otherwise, it shows a sad face, letting you know that the soil is dry.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Simple_Soil_Sensor_Demos/MicroPython/simple_soil_sensor_demo.py

## Send to micro:bit
When you're ready to send the code to the micro:bit, you'll click the **Send to micro:bit** button at the bottom of the window.

![send to micro:bit](https://cdn-learn.adafruit.com/assets/assets/000/138/296/medium640/sensors_Screenshot_2025-07-09_163119.png?1752093223)

Connect your micro:bit to your computer with a known good data micro-B USB cable. Once you're connected, click **Next**.

![connect usb to microbit](https://cdn-learn.adafruit.com/assets/assets/000/138/297/medium640/sensors_Screenshot_2025-07-09_163106.jpg?1752093316)

In the next prompt window, click **Next** to connect to the micro:bit.

![select connect](https://cdn-learn.adafruit.com/assets/assets/000/138/298/medium640/sensors_Screenshot_2025-07-09_163207.jpg?1752093355)

In the pop-out, select the **BBC micro:bit** and click **Connect**.

![usb bbc microbit connect](https://cdn-learn.adafruit.com/assets/assets/000/138/299/medium640/sensors_Screenshot_2025-07-09_163249.jpg?1752093424)

You'll see your code upload the the micro:bit and start running.

![sad microbit](https://cdn-learn.adafruit.com/assets/assets/000/138/300/medium640/sensors_6362-04.jpg?1752093485)

## Advanced Sensing

One disadvantage to the soil sensor is that the soil probes can oxidize over time. There is a "hack" you can do to prolong the life of the probes. You can connect the sensor 3V pad to a digital pad on the micro:bit and turn it "on" only when you're getting an analog reading&nbsp;and then turn it "off" when not measuring.

### Wiring

Use alligator clips to connect the soil moisture sensor to the micro:bit.

- **micro:bit 2** &nbsp;to **sensor 3V (red wire)**
- **micro:bit GND** to **sensor GND (black wire)**
- **micro:bit 0** to **sensor OUT (white wire)**

![fritzing microbit with 3V connected to pin 2](https://cdn-learn.adafruit.com/assets/assets/000/138/301/medium640/sensors_microBitGatorAdv_bb.jpg?1752093700)

### Advanced Sensing Code

The MicroPython code turns the sensor on by toggling pad 2 high. Then, it reads the analog&nbsp;`moisture` value on pad 0. If the `moisture` level is greater than `200`, the LED matrix shows a happy face. Otherwise, it shows a sad face, letting you know that the soil is dry. Pad 2 is set low to turn off the soil sensor and help keep the soil probes from oxidizing.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Simple_Soil_Sensor_Demos/MicroPython/adv_soil_sensor_demo.py

# Adafruit Simple Soil Moisture Sensor

## micro:bit and Arduino

Using the Simple Soil Moisture Sensor with Arduino involves wiring up the sensor to your micro:bit, installing the [Adafruit\_Microbit](https://github.com/adafruit/Adafruit_Microbit) library, and running the provided example code.

## Wiring

Use alligator clips to connect the soil moisture sensor to the micro:bit.

- **micro:bit 3V** to **sensor 3V (red wire)**
- **micro:bit GND** to **sensor GND (black wire)**
- **micro:bit 0** to **sensor OUT (white wire)**

![simple soil sensor fritzing](https://cdn-learn.adafruit.com/assets/assets/000/138/308/medium640/sensors_microBitGator_bb.jpg?1752153404)

## Library Installation

You can install the necessary&nbsp;libraries for Arduino using the Library Manager in the Arduino IDE.

![arduino ide menu](https://cdn-learn.adafruit.com/assets/assets/000/138/309/medium800/sensors_Arduino_Open_Library_Manager.png?1752153471 )

Click the **Manage Libraries ...** menu item, search for **Adafruit\_GFX** , and select the **Adafruit GFX** library:

![install adafruit gfx](https://cdn-learn.adafruit.com/assets/assets/000/138/311/medium800/sensors_Screenshot_2025-07-09_171024.png?1752153524 )

If asked about dependencies, click "Install all".

![install adafruit gfx](https://cdn-learn.adafruit.com/assets/assets/000/138/310/medium800/sensors_Screenshot_2025-07-09_171034.png?1752153508 )

Then, search for **Adafruit\_Microbit** and select the **Adafruit microbit** library.

![install adafruit microbit](https://cdn-learn.adafruit.com/assets/assets/000/138/312/medium800/sensors_Screenshot_2025-07-09_171101.png?1752153589 )

If asked about dependencies, click "Install all".

![microbit dependencies](https://cdn-learn.adafruit.com/assets/assets/000/138/313/medium800/sensors_Screenshot_2025-07-09_171110.png?1752153623 )

If the "Dependencies" windows do not come up, then you already have the dependencies installed.

Warning: If the dependencies are already installed, you must make sure you update them through the Arduino Library Manager before loading the example!

## Simple Example Code
https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Simple_Soil_Sensor_Demos/Arduino/microBitSimpleSoilSensor/microBitSimpleSoilSensor.ino

Upload the sketch to your board and open up the Serial Monitor ( **Tools -\> Serial Monitor** ) at 115200 baud. You'll see the micro:bit recognized. Every five seconds, the analog reading from the sensor will be printed to the Serial Monitor. If the reading is&nbsp;greater than `200`, the LED matrix shows a happy face. Otherwise, it shows a sad face, letting you know that the soil is dry.

![simple soil demo serial monitor](https://cdn-learn.adafruit.com/assets/assets/000/138/314/medium800/sensors_Screenshot_2025-07-09_175044.png?1752153821 )

## Advanced Sensing

One disadvantage to the soil sensor is that the soil probes can oxidize over time. There is a "hack" you can do to prolong the life of the probes. You can connect the sensor 3V pad to a digital pad on the micro:bit and turn it "on" only when you're getting an analog reading.

### Wiring

Use alligator clips to connect the soil moisture sensor to the micro:bit.

- **micro:bit 2** &nbsp;to **sensor 3V (red wire)**
- **micro:bit GND** to **sensor GND (black wire)**
- **micro:bit 0** to **sensor OUT (white wire)**

![microbit advanced wiring](https://cdn-learn.adafruit.com/assets/assets/000/138/315/medium640/sensors_microBitGatorAdv_bb.png?1752153909)

### Advanced Example Code
https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Simple_Soil_Sensor_Demos/Arduino/microBitAdvSoilSensor/microBitAdvSoilSensor.ino

Upload the sketch to your board and open up the Serial Monitor ( **Tools -\> Serial Monitor** ) at 115200 baud. You'll see the micro:bit recognized. Every five seconds, pin 2 will be set `HIGH` to power up the sensor. Then, the analog reading from the sensor will be printed to the Serial Monitor. If the reading is greater than `200`, the LED matrix shows a happy face. Otherwise, it shows a sad face, letting you know that the soil is dry. After the reading, pin 2 is set `LOW` to turn off power to the sensor.

![soil advanced demo serial monitor](https://cdn-learn.adafruit.com/assets/assets/000/138/316/medium800/sensors_Screenshot_2025-07-09_175757.png?1752154029 )

# Adafruit Simple Soil Moisture Sensor

## micro:bit and MakeCode

![make code in the browser](https://cdn-learn.adafruit.com/assets/assets/000/138/276/medium800/sensors_Screenshot_2025-07-09_115555.png?1752076572 )

You can use MakeCode block programming with the micro:bit and the **Soil Moisture Sensor**. You'll create blocks that read the output from the sensor and show a happy face or a sad face on the LED matrix depending on the moisture level in the soil.

## Wiring

Use alligator clips to connect the soil moisture sensor to the micro:bit.

- **micro:bit 3V** to **sensor 3V (red wire)**
- **micro:bit GND** to **sensor GND (black wire)**
- **micro:bit 0** to **sensor OUT (white wire)**

![](https://cdn-learn.adafruit.com/assets/assets/000/138/292/medium640/sensors_microBitGator_bb.jpg?1752091291)

## MakeCode

You can edit the MakeCode program at this link in your browser:

[Edit Soil Sensor MakeCode ](https://makecode.microbit.org/_TrbWb49Aa9wU)
In the code setup, the text "`Hello Soil Sensor!`" scrolls across the LED matrix display. Then in the loop, the analog `moisture` value is read every 5 seconds. If the `moisture` level is greater than `200`, the LED matrix shows a happy face. Otherwise, it shows a sad face, letting you know that the soil is dry.

![](https://cdn-learn.adafruit.com/assets/assets/000/138/281/medium640/sensors_Screenshot_2025-07-09_115555.jpg?1752089813)

## Upload the Code
Once you're happy with the code, you can create a MakeCode project by clicking the **floppy disk save icon**. **Name your project** and then click **Create**.

![create a makecode project](https://cdn-learn.adafruit.com/assets/assets/000/138/282/medium640/sensors_Screenshot_2025-07-09_113421.png?1752090034)

Clicking Create downloads the code as a compiled HEX file to your computer. You can also upload the code using web USB. Click the **Pair Now** button to begin.

![download with web usb](https://cdn-learn.adafruit.com/assets/assets/000/138/283/medium640/sensors_Screenshot_2025-07-09_114753.jpg?1752090187)

Connect your micro:bit to your computer with a known good data micro-B USB cable. Once you're connected, click **Pair**.

![pair the micro:bit](https://cdn-learn.adafruit.com/assets/assets/000/138/284/medium640/sensors_Screenshot_2025-07-09_114855.jpg?1752090235)

A window will pop-out showing the available USB devices. Select the **BBC micro:bit** and click **Connect**.

![connect BBC micro:bit](https://cdn-learn.adafruit.com/assets/assets/000/138/285/medium640/sensors_Screenshot_2025-07-09_114919.jpg?1752090381)

After the connection is established, click **Download** to load the code onto your micro:bit.

![download makecode to micro:bit](https://cdn-learn.adafruit.com/assets/assets/000/138/286/medium640/sensors_Screenshot_2025-07-09_114937.jpg?1752090610)

The code will begin running on your micro:bit!

![micro:bit with happy face in a plant](https://cdn-learn.adafruit.com/assets/assets/000/138/287/medium640/sensors_6362-05.jpg?1752090675)

# Adafruit Simple Soil Moisture Sensor

## FarmBeats-Compatible

You can use the Simple Soil Moisture Sensor to follow along with the [FarmBeats for Students](https://learn.microsoft.com/en-us/training/educator-center/instructor-materials/farmbeats-for-students) curriculum. We have a ["FarmBeats for Students" Compatible kit](https://www.adafruit.com/product/6352) that comes with the micro:bit v2, the soil sensor and other accessories.

### Adafruit Soil Sensor Kit - "FarmBeats for Students" Compatible!

[Adafruit Soil Sensor Kit - "FarmBeats for Students" Compatible!](https://www.adafruit.com/product/6352)
We can’t wait for spring to arrive, and we’re looking forward to caring for some plants! We designed this little **Adafruit Soil Sensor Kit with micro:bit v2** &nbsp;for students who want to learn how to make their plants grow with help from a little...

In Stock
[Buy Now](https://www.adafruit.com/product/6352)
[Related Guides to the Product](https://learn.adafruit.com/products/6352/guides)
![Kit Shot of the Moisture Bit with Included Components to make up the Soil Sensor Kit - Compatible with "FarmBeats for Students"](https://cdn-shop.adafruit.com/640x480/6352-00.jpg)

When you use the soil sensor with the FarmBeats lesson plans, you can reference this wiring diagram:

- **micro:bit 3V** to **sensor 3V (red wire)**
- **micro:bit GND** to **sensor GND (black wire)**
- **micro:bit 0** to **sensor OUT (white wire)**

![micro:bit with soil sensor fritzing](https://cdn-learn.adafruit.com/assets/assets/000/138/345/medium640/sensors_microBitGator_bb.jpg?1752254689)

There is a [YouTube playlist](https://www.youtube.com/playlist?list=PLyFUCX4O0xh9VofRpi0bjgaZ4ac5ETure) with video tutorials that go along with the lesson plans. The content surrounding using the micro:bit, soil sensor and MakeCode is similar to the steps in the [MakeCode page](https://learn.adafruit.com/adafruit-simple-soil-moisture-sensor) in this guide.

### Adafruit Simple Soil Moisture Sensor - micro:bit and MakeCode

[Adafruit Simple Soil Moisture Sensor](https://learn.adafruit.com/adafruit-simple-soil-moisture-sensor)
[micro:bit and MakeCode](https://learn.adafruit.com/adafruit-simple-soil-moisture-sensor/microbit-makecode)
# Adafruit Simple Soil Moisture Sensor

## WipperSnapper

![](https://cdn-learn.adafruit.com/assets/assets/000/139/122/medium800/sensors_1ie8MPx66f.png?1755856442)

## What is WipperSnapper

WipperSnapper is a firmware designed to turn any WiFi-capable board into an Internet-of-Things device without programming a single line of code. WipperSnapper connects to&nbsp;[Adafruit IO](https://io.adafruit.com/), a web&nbsp;platform designed ([by Adafruit!](https://www.adafruit.com/about)) to&nbsp;_display_,&nbsp;_respond_, and&nbsp;_interact_&nbsp;with your project's data.

Simply load the WipperSnapper firmware onto your board, add credentials, and plug it into power. Your board will automatically register itself with your Adafruit IO account.

From there, you can add&nbsp;_components_&nbsp;to your board such as buttons, switches, potentiometers, sensors, and more! Components are&nbsp;_dynamically&nbsp;_added to hardware, so you can&nbsp;immediately start interacting, logging, and streaming the data your projects produce without writing code.

If you've never used WipperSnapper, click below to read through the quick start guide before continuing.

[Quickstart: Adafruit IO WipperSnapper](https://learn.adafruit.com/quickstart-adafruit-io-wippersnapper)
## Wiring

To easily connect the Simple Soil Sensor to your microcontroller board we recommend using a [JST SH Compatible (1mm Pitch) 3 Pin to Premium Male Headers Cable](https://www.adafruit.com/product/5755) although any method is fine.

First, wire up a&nbsp; **Simple Soil Sensor** to your board exactly as follows.

Here is an example of the Simple Soil Sensor&nbsp;connected to an&nbsp;[Adafruit ESP32 Feather V2.](https://www.adafruit.com/product/5400)

- **Board 3.3V** &nbsp;to&nbsp;**sensor JST-SH 3V (red wire)**
- **Board GND** &nbsp;to&nbsp;**sensor JST-SH GND (black wire)**
- **Board A2** &nbsp;to**&nbsp;sensor JST-SH OUT (white wire)**

![](https://cdn-learn.adafruit.com/assets/assets/000/139/109/medium640/sensors_featherESP32V2_JST_bb.png?1755804129)

## Usage

Connect your board to Adafruit IO Wippersnapper and&nbsp;**[navigate to the WipperSnapper board list](https://io.adafruit.com/wippersnapper).**

On this page,&nbsp; **select the WipperSnapper board you're using** &nbsp;to be brought to the board's interface page.

![](https://cdn-learn.adafruit.com/assets/assets/000/139/131/medium800/sensors_SCR-20250822-iyea.png?1755870059 )

If you do not see your board listed here - you need&nbsp;[to connect your board to Adafruit IO](https://learn.adafruit.com/quickstart-adafruit-io-wippersnapper) first.

On the device page, quickly&nbsp; **check that you're running the latest version of the WipperSnapper firmware**.

The device tile on the left indicates the version number of the firmware running on the connected board.

- **If the firmware version is green with a checkmark -** &nbsp;continue with this guide.
- **If the firmware version is red with an "X" -** &nbsp;[update to the latest WipperSnapper firmware](https://learn.adafruit.com/quickstart-adafruit-io-wippersnapper)&nbsp;on your board before continuing.

![](https://cdn-learn.adafruit.com/assets/assets/000/139/124/medium640/sensors_ymGdv0mTjv.png?1755856732)

![](https://cdn-learn.adafruit.com/assets/assets/000/139/125/medium640/sensors_AalPuHDdoQ.png?1755856814)

 **Click the New Component button or the + button&nbsp;** to bring up the component picker.

![](https://cdn-learn.adafruit.com/assets/assets/000/139/111/medium800/sensors_sensor_page_temperature___humidity_06_AddComponent_%282%29.png?1755804712)

Adafruit IO supports a large amount of components. To quickly find your sensor, type&nbsp;`Soil`&nbsp;into the search bar, then select the&nbsp; **Simple Soil Sensor** &nbsp;component.

![](https://cdn-learn.adafruit.com/assets/assets/000/139/112/medium800/sensors_soil.png?1755805169)

On the component configuration page, the Soil sensor pin should be selected along with the sensor's settings.

![](https://cdn-learn.adafruit.com/assets/assets/000/139/120/medium800/sensors_8dTLRhUSRQ.png?1755855715)

Choose `A2` from the&nbsp; **Pin** dropdown, or an appropriate analog input pin for your board (matching your wiring).

The&nbsp; **Return Interval** allows you to set the component to report each change (with some hysteresis), or to report the current value on a schedule (following the poll period).

For this example, set the **Return Interval** to `Periodically`, and&nbsp; **Period** to 5 seconds.  
Later adjust this using the settings cog for the component, and pick a longer period.

Finally the&nbsp; **Return Type** selects whether to return the **Raw Analog Value** , or the&nbsp; **Voltage**.  
Pick either one, the Raw value is easier to work with, but the Voltage more familiar.

The dialog should look very similar to this before clicking **Create Component**.

![](https://cdn-learn.adafruit.com/assets/assets/000/139/121/medium800/sensors_3KM36LkvIM.png?1755856371)

Your device interface should now show the sensor components you created. After the interval you configured elapses, WipperSnapper will automatically read values from the sensor(s) and send them to Adafruit IO.

![](https://cdn-learn.adafruit.com/assets/assets/000/139/126/medium800/sensors_KS3q0ut4j3.png?1755856930)

To view the data that has been logged from the sensor, click on the graph next to the sensor name.

![](https://cdn-learn.adafruit.com/assets/assets/000/139/127/medium800/sensors_itIIzqHWmr.png?1755857020)

Here you can see the feed history and edit things about the feed such as the name, privacy, webhooks associated with the feed and more. If you want to learn more about how feeds work,&nbsp;[check out this page](https://learn.adafruit.com/all-the-internet-of-things-episode-four-adafruit-io/advanced-feeds).

In this graph I've switched the **Return Type** from **Raw Analog Value** (start ~42000), to **Voltage** (middle portion ~2.2volts), and back again, to illustrate the difference in value ranges.

![](https://cdn-learn.adafruit.com/assets/assets/000/139/119/medium800/sensors_an9NDgUtl6.png?1755855531)

# Adafruit Simple Soil Moisture Sensor

## Downloads

## Files

- [EagleCAD PCB files on GitHub](https://github.com/adafruit/Adafruit-Simple-Soil-Moisture-Sensor-PCB)
- [3D models on GitHub](https://github.com/adafruit/Adafruit_CAD_Parts/tree/main/6362%20Simple%20Soil%20Moisture%20Sensor)
- [Fritzing object in the Adafruit Fritzing Library](https://github.com/adafruit/Fritzing-Library/blob/master/parts/Adafruit%20Simple%20Soil%20Moisture%20Sensor.fzpz)

## Schematic and Fab Print
![schematic for the soil moisture sensor](https://cdn-learn.adafruit.com/assets/assets/000/138/219/medium800/sensors_schem.png?1751987241 )

![fab print for pcb](https://cdn-learn.adafruit.com/assets/assets/000/138/220/medium800/sensors_fab.png?1751987255 dimensions are in inches)

![](https://cdn-learn.adafruit.com/assets/assets/000/138/278/medium800/sensors_6362_Simple_Soil_Moisture_Sensor.jpg?1752080922 )


## Primary Products

### Adafruit Soil Sensor Kit - "FarmBeats for Students" Compatible!

[Adafruit Soil Sensor Kit - "FarmBeats for Students" Compatible!](https://www.adafruit.com/product/6352)
We can’t wait for spring to arrive, and we’re looking forward to caring for some plants! We designed this little **Adafruit Soil Sensor Kit with micro:bit v2** &nbsp;for students who want to learn how to make their plants grow with help from a little...

In Stock
[Buy Now](https://www.adafruit.com/product/6352)
[Related Guides to the Product](https://learn.adafruit.com/products/6352/guides)
### Adafruit Simple Soil Moisture Sensor - For micro:bit, and more

[Adafruit Simple Soil Moisture Sensor - For micro:bit, and more](https://www.adafruit.com/product/6362)
Perfect for educational uses, the&nbsp; **Adafruit Simple Soil Moisture Sensor** is low cost, and easy to use. This is a simple&nbsp;_resistive_ style moisture sensor, where there's two prongs and the sensor measures the conductivity between the two. We gold-plated the...

In Stock
[Buy Now](https://www.adafruit.com/product/6362)
[Related Guides to the Product](https://learn.adafruit.com/products/6362/guides)

## Featured Products

### Small Alligator Clip to Male Jumper Wire Bundle - 6 Pieces

[Small Alligator Clip to Male Jumper Wire Bundle - 6 Pieces](https://www.adafruit.com/product/3448)
When working&nbsp;with unusual non-header-friendly surfaces, these handy cables will be your best friends! No longer will you have long, cumbersome strands of alligator clips. These compact jumper cables have a premium male header on one end and a grippy mini alligator clip on the...

In Stock
[Buy Now](https://www.adafruit.com/product/3448)
[Related Guides to the Product](https://learn.adafruit.com/products/3448/guides)
### Small Alligator Clip Test Lead (set of 6)

[Small Alligator Clip Test Lead (set of 6)](https://www.adafruit.com/product/4100)
Connect this to that without soldering using these small&nbsp;alligator clip test leads. 18" long cables with color-coded alligator clips on both ends. You get 6 pieces in 6 unique colors. Strong and grippy, these always come in handy! We often use these in conjunction with a multimeter...

In Stock
[Buy Now](https://www.adafruit.com/product/4100)
[Related Guides to the Product](https://learn.adafruit.com/products/4100/guides)
### Small Alligator Clip to Male Jumper Wire Bundle - 12 Pieces

[Small Alligator Clip to Male Jumper Wire Bundle - 12 Pieces](https://www.adafruit.com/product/3255)
For bread-boarding with unusual non-header-friendly surfaces, these cables will be your best friends! No longer will you have long strands of alligator clips that are grabbing little wires. These compact jumper cables have a premium male header on one end, and a grippy mini alligator clip on...

In Stock
[Buy Now](https://www.adafruit.com/product/3255)
[Related Guides to the Product](https://learn.adafruit.com/products/3255/guides)
### JST SH Compatible 1mm Pitch 3 Pin to Premium Male Headers Cable

[JST SH Compatible 1mm Pitch 3 Pin to Premium Male Headers Cable](https://www.adafruit.com/product/5755)
If you fancy connecting to&nbsp;anything else with a JST SH compatible 3-pin connector, this cable will do the trick. For example, our [NeoPixel JST Breakout boards](https://www.adafruit.com/product/5975), or [UPDI Friend](https://www.adafruit.com/product/5879), or <a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/5755)
[Related Guides to the Product](https://learn.adafruit.com/products/5755/guides)

## Related Guides

- [Pushrod Garage](https://learn.adafruit.com/pushrod-garage.md)
- [FruitBox Sequencer: Musically Delicious Step Pattern Generator ](https://learn.adafruit.com/circuitpython-fruitbox-sequencer-musically-delicious-step-pattern-generator.md)
- [Circuit Playground Express Head-Tilt Ears](https://learn.adafruit.com/circuit-playground-express-head-tilt-ears.md)
- [Distance Measurement with Ultrasound](https://learn.adafruit.com/distance-measurement-ultrasound-hcsr04.md)
- [MIDI Stomping Pads](https://learn.adafruit.com/midi-stomping-pads.md)
- [Using EduBlocks with Circuit Playground Express](https://learn.adafruit.com/using-edublocks-with-circuit-playground-express.md)
- [PyPortal IoT Weather Station](https://learn.adafruit.com/pyportal-iot-weather-station.md)
- [Micro:Bit Puppet "Text Message" System!](https://learn.adafruit.com/micro-bit-radio-controlled-puppet.md)
- [micro:bit Lesson 2. Controlling LEDs on Breadboard](https://learn.adafruit.com/micro-bit-lesson-2-controlling-leds-on-breadboard.md)
- [Archimedes' Boat](https://learn.adafruit.com/archimedes-boat.md)
- [Combo Dial Safe with Circuit Playground Express](https://learn.adafruit.com/combo-dial-safe-with-circuit-playground-express.md)
- [How to Program SAMD Bootloaders](https://learn.adafruit.com/how-to-program-samd-bootloaders.md)
- [Esenciales para CircuitPython](https://learn.adafruit.com/esenciales-para-circuitpython.md)
- [DAC Hacks for Circuit Playground Express & other ATSAMD21 Boards](https://learn.adafruit.com/circuit-playground-express-dac-hacks.md)
- [Sound Activated Shark Mask](https://learn.adafruit.com/sound-activated-shark-mask.md)
