API Reference

qwiic_soil_moisture_sensor

Python module for the [SparkFun Qwiic Soil Moisture Sensor](https://www.sparkfun.com/products/17731)

This python package is a port of the existing [SparkFun Soil Moisture Sensor Arduino Examples](https://github.com/sparkfun/Zio-Qwiic-Soil-Moisture-Sensor/tree/master/Firmware/Qwiic%20Soil%20Moisture%20Sensor%20Examples)

This package can be used in conjunction with the overall [SparkFun qwiic Python Package](https://github.com/sparkfun/Qwiic_Py)

New to qwiic? Take a look at the entire [SparkFun qwiic ecosystem](https://www.sparkfun.com/qwiic).

class qwiic_soil_moisture_sensor.QwiicSoilMoistureSensor(address=None, i2c_driver=None)[source]
Parameters
  • address – The I2C address to use for the device. If not provided, the default address is used.

  • i2c_driver – An existing i2c driver object. If not provided a driver object is created.

Returns

The Soil Moisture Sensor device object.

Return type

Object

begin()[source]

Initialize the operation of the Soil Moisture Sensor module :return: Returns true of the initialization was successful, otherwise False. :rtype: bool

change_address(newAddress)[source]
Changes the I2C address of the Qwiic Soil Moisture Sensor reader
param newAddress

the new address to set the Soil Moisture Sensor reader to

rtype

bool

check_status_error()[source]

Returns if the Error bit on the sensor is set.

Returns

value of Error bit

Return type

integer

property connected

Determine if a Soil MoistureSensor device is conntected to the system.. :return: True if the device is connected, otherwise False. :rtype: bool

is_connected()[source]

Determine if a Soil MoistureSensor device is conntected to the system.. :return: True if the device is connected, otherwise False. :rtype: bool

led_off()[source]

Turn off the onboard LED. :return: Nothing :rtype: void

led_on()[source]

Turn on the onboard LED. :return: Nothing :rtype: void

read_moisture_level()[source]

Reads the results from the sensor and stores internally :rtype: integer