You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SparkFun Qwiic Soil Moisture Sensor provides a simple and cost effective solution for adding soil moisture sensing to your project. Implementing a SparkFun Qwiic I2C interface, these sensors can be rapidly added to any project with boards that are part of the SparkFun Qwiic ecosystem.
24
12
13
+
This repository implements a Python package for the SparkFun Qwiic Soil Moisture Sensor. This package works with Python, MicroPython and CircuitPython.
25
14
26
-
Python module for the [SparkFun Qwiic Soil Moisture Sensor](https://www.sparkfun.com/products/17731)
15
+
### Contents
27
16
28
-
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)
24
+
## About the Package
25
+
26
+
This python package enables the user to access the features of the Qwiic Soil Moisture Sensor via a single Qwiic cable. This includes reading the moisture level, turning on and off the LED, and more. The capabilities of the moisture sensor are each demonstrated in the included examples.
31
27
32
28
New to qwiic? Take a look at the entire [SparkFun qwiic ecosystem](https://www.sparkfun.com/qwiic).
33
29
34
-
##Contents
30
+
### Supported SparkFun Products
35
31
36
-
*[Supported Platforms](#supported-platforms)
37
-
*[Dependencies](#dependencies)
38
-
*[Installation](#installation)
39
-
*[Documentation](#documentation)
40
-
*[Example Use](#example-use)
32
+
This Python package supports the following SparkFun qwiic products on Python, MicroPython and Circuit python.
| Python | Linux |[Raspberry Pi](https://www.sparkfun.com/raspberry-pi-5-8gb.html) , [NVIDIA Jetson Orin Nano](https://www.sparkfun.com/nvidia-jetson-orin-nano-developer-kit.html) via the [SparkFun Qwiic SHIM](https://www.sparkfun.com/sparkfun-qwiic-shim-for-raspberry-pi.html)|
*[Google Coral Development Board](https://www.sparkfun.com/products/15318)
44
+
> [!NOTE]
45
+
> The listed supported platforms and boards are the primary platform targets tested. It is fully expected that this package will work across a wide variety of Python enabled systems.
48
46
49
-
Dependencies
50
-
--------------
51
-
This driver package depends on the qwiic I2C driver:
The SparkFun qwiic Soil Moisture Sensor module documentation is hosted at [ReadTheDocs](https://qwiic-soil-moisture-sensor-py.readthedocs.io/en/latest/?)
49
+
The first step to using this package is installing it on your system. The install method depends on the python platform. The following sections outline installation on Python, MicroPython and CircuitPython.
57
50
58
-
Installation
59
-
---------------
60
-
### PyPi Installation
51
+
### Python
61
52
62
-
This repository is hosted on PyPi as the [sparkfun-qwiic-soil-moisture-sensor](https://pypi.org/project/sparkfun-qwiic-soil-moisture-sensor/) package. On systems that support PyPi installation via pip, this library is installed using the following commands
53
+
The package is primarily installed using the `pip` command, downloading the package from the Python Index - "PyPi". Note - the below instructions outline installation an Linux-based (Raspberry Pi) system.
54
+
55
+
#### PyPi Installation
56
+
57
+
The SparkFun Qwiic Soil Moisture Sensor Python package is part of the overall SparkFun Qwiic Python package which is hosted on PyPi. On systems that support PyPi installation via pip, this library is installed using the following commands
63
58
64
59
For all users (note: the user must have sudo privileges):
If not already installed, follow the [instructions here](https://docs.micropython.org/en/latest/reference/mpremote.html) to install mpremote on your computer.
94
+
95
+
Connect a device with MicroPython installed to your computer and then install the package directly to your device with mpremote mip.
If not already installed, follow the [instructions here](https://docs.circuitpython.org/projects/circup/en/latest/#installation) to install CircUp on your computer.
102
+
103
+
Ensure that you have the latest version of the SparkFun Qwiic CircuitPython bundle.
104
+
```sh
105
+
circup bundle-add sparkfun/Qwiic_Py
106
+
```
107
+
108
+
Finally, connect a device with CircuitPython installed to your computer and then install the package directly to your device with circup.
109
+
```sh
110
+
circup install --py qwiic_soil_moisture_sensor
88
111
```
89
112
90
113
Example Use
91
-
-------------
92
-
See the examples directory for more detailed use examples.
114
+
---------------
115
+
Below is a quickstart program to print moisture level and toggle the LED on the Soil Moisture Sensor.
116
+
117
+
See the examples directory for more detailed use examples and [examples/README.md](https://github.com/sparkfun/qwiic_soil_moisture_sensor_py/blob/main/examples/README.md) for a summary of the available examples.
93
118
94
119
```python
95
-
from__future__import print_function
96
120
import qwiic_soil_moisture_sensor
97
-
121
+
import time
122
+
import sys
98
123
99
124
defrunExample():
100
125
101
-
print("\nSparkFun qwiic soil moisture sensor Example 1\n")
126
+
print("\nSparkFun Qwiic Soil Moisture Sensor Example 1\n")
Below is a brief summary of each of the example programs included in this repository. To report a bug in any of these examples or to request a new feature or example [submit an issue in our GitHub issues.](https://github.com/sparkfun/qwiic_bme280_py/issues).
3
+
4
+
## Example 1: Basic Readings
5
+
This example demonstrates basic bringup of the Qwiic Soil Moisture Sensor to print moisture level and toggle the LED on and off.
This example demonstrates how to change the I2C address on the Qwiic Soil Moisture Sensor. The user is prompted for a new I2C address in the legal range 0x08 to 0x3F. Then, the address of the sensor is changed to the user's selection.
16
+
17
+
The key method showcased by this example is [change_address()](https://docs.sparkfun.com/qwiic_soil_moisture_sensor_py/classqwiic__soil__moisture__sensor_1_1_qwiic_soil_moisture_sensor.html#ad3b91fdbd9f8190798af7ee2227d4d63)
0 commit comments