Uncategorized

Moisture Sensor SEN-17731

Read moisture measurements from SEN-17731

Ask Question

Asked today

Modified today

Viewed 6 times

1

I am trying to read various measurements with a raspberry pi 4. I decided to use an i2c bus to keep the wiring clean and easy. For a soil moisture measurement I decided to go with the SEN-17731. Somehow I cannot find any sample code nor registers I need to address with i2c.

On the website mentioned above only the following is written:

Our Qwiic Soil Moisture Sensor utilizes the I2C protocol with the existing signals and the ATtiny85 MCU as the I2C gateway, which does all the nitty gritty stuff for you. The default I2C address is 0x28. The Qwiic connector should be self-evident, and this board also has pins broken out for SPI programming.

Apparently this code is the firmware on the ATtiny85, since they listed the git repo under “Documents”.

It which defines:

#define COMMAND_GET_VALUE 0x05

and later uses this within:

   if (command == COMMAND_GET_VALUE) {
    ADC_VALUE=analogRead(ADC_PIN);
    ADC_VALUE_L=ADC_VALUE;
    ADC_VALUE_H=ADC_VALUE>>8; 
    TinyWire.send(ADC_VALUE_L);  
    TinyWire.send(ADC_VALUE_H);
    command = COMMAND_HAS_BEEN_CHECKED;
  }

Tinywire seems to be an Arduino library (equivalent to SMBus for python?) but how can I address it from outside the Arduino Universe? Am I on the right path here?

raspberry-pii2csparkfun

ShareCite

EditFollowFlag

edited 43 mins ago

asked 52 mins ago

user avatar

shoj

111 bronze badge

 New contributor

  • SparkFun Qwiic Soil Moisture Sensor – US$10$9.50 sparkfun.com/products/17731 (1) The Sensor is a simple breakout for measuring the moisture in soil and similar materials. It is pretty straightforward to use. The two large, exposed pads function as probes for the sensor, together acting as a variable resistor. The more water that is in the soil means the better the conductivity between the pads will be, resulting in a lower resistance and a higher SIG out. / to continue, … – tlfong01 3 mins ago  Edit  
  • / continued; … (2) To get the sensor functioning, all you will need is to connect the VCC and GND pins to your Arduino-based device (or compatible development board). You will receive a SIG out, which will depend on the amount of water in the soil. (3) Note: Check the Hookup Guide below for assembly and weatherproofing instructions, as well as a simple example project that you can put together yourself! – tlfong01 3 mins ago  Edit  

Add a comment

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.