-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seesaw soil sensor getting spurious readings #84
Comments
@caternuson stemma sorta relies on delays to manage timing, and the Pi is much faster. since you have it set up can you try inserting delays into seesaw? like in between the i2c send and receive command |
Looks like there's already a delay mechanism in place? So just try bumping that 0.005 up? |
yep try 20ms or more time thx |
Tried several, all the way up 1/2 a sec. Still gets spurious reads. 0.010
0.020
0.050
0.500
|
weird, can you see what the raw value, pre floatification, is? |
OK, floatification was coming from the averaging math. This seems to be something else, so don't need to worrying about averaging. Getting rid of that and now just doing this with while True:
moisture = ss.moisture_read()
temperature = ss.get_temp()
time_stamp = datetime.datetime.now().strftime("%m-%d-%y %H:%M:%S")
print(time_stamp, moisture, temperature)
log_data(time_stamp, moisture, temperature)
time.sleep(LOG_RATE) Then only test original 0.005 and 0.020, the spurious read is:
0.020
|
man who knows - it shouldn't be that high, i think max value is 4096 - i think we should re-try in the lirbary if the touch reading is above 4096 (try pressing your palm against it to see the max value |
hey just checking back, did you find any solution or workaround? |
Sorry, not yet. Broke down the actual plant setup to bring back to bench and got buried. Getting rid of file logging and averaging and just doing a simple readout loop: import time, datetime
import board, busio
from adafruit_seesaw.seesaw import Seesaw
i2c = busio.I2C(board.SCL, board.SDA)
ss = Seesaw(i2c, addr=0x36)
while True:
moisture = ss.moisture_read()
temperature = ss.get_temp()
time_stamp = datetime.datetime.now().strftime("%m-%d-%y %H:%M:%S")
print(time_stamp, moisture, temperature)
time.sleep(1) Holding thumb over entire sense area, looks like 1015 is max, but can still get the odd ball reading. This is with a delay of 0.020 in the seesaw lib.
Given how different the odd reading is, an out of bounds check would be pretty easy to add. But would be nice to know where it's coming from. |
unfortunately its probably in the seesaw lib in a way i cant easily fix...so out of bounds check is the best option, check for a max of 4095 |
OK. I can PR that. Want to close this issue and open a new one in https://github.com/adafruit/Adafruit_CircuitPython_seesaw ? |
issue cant be moved there for some reason, so opened there, closin' here! |
Not 100% sure this is a blinka issue, but starting here. Something about blinka's I2C w/ Seesaw? No issue on a Metro w/ CP.
Re this thread:
https://forums.adafruit.com/viewtopic.php?f=19&t=146478
SETUP A
Raspberry Pi Zero W + STEMMA Soil Sensor
Sensor stuck in a pot of wet dirt
Python3 + blinka + CP libs
Readings are an average of 10 samples taken 1 second apart
Occasional spurious readings (~4000+) for moisture (time, moisture, temperature):
SETUP B
Metro M4 Express + STEMMA Soil Sensor
Sensor stuck in a pot of wet dirt
CP 3.1.2 + CP libs
Readings are an average of 10 samples taken 1 second apart
No spurious readings (time, moisture, temperature):
The text was updated successfully, but these errors were encountered: