Git Product home page Git Product logo

Comments (12)

ladyada avatar ladyada commented on July 24, 2024

@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

from adafruit_blinka.

caternuson avatar caternuson commented on July 24, 2024

Looks like there's already a delay mechanism in place?
https://github.com/adafruit/Adafruit_CircuitPython_seesaw/blob/master/adafruit_seesaw/seesaw.py#L380
moisture_read calls that with a delay value of 0.005:
https://github.com/adafruit/Adafruit_CircuitPython_seesaw/blob/master/adafruit_seesaw/seesaw.py#L236

So just try bumping that 0.005 up?

from adafruit_blinka.

ladyada avatar ladyada commented on July 24, 2024

yep try 20ms or more time thx

from adafruit_blinka.

caternuson avatar caternuson commented on July 24, 2024

Tried several, all the way up 1/2 a sec. Still gets spurious reads.

0.010

02-07-19 20:35:28       745.0   20.026262214882003
02-07-19 20:35:49       764.2   19.896068200410003
02-07-19 20:36:09       4043.7  19.864850262408005
02-07-19 20:36:29       741.1   19.929281986836003
02-07-19 20:36:49       780.3   19.94920690176

0.020

02-07-19 20:35:28       745.0   20.026262214882003
02-07-19 20:35:49       764.2   19.896068200410003
02-07-19 20:36:09       4043.7  19.864850262408005
02-07-19 20:36:29       741.1   19.929281986836003
02-07-19 20:36:49       780.3   19.94920690176

0.050

02-07-19 20:44:12       758.2   19.939909727106006
02-07-19 20:44:32       712.9   19.886105742948
02-07-19 20:44:53       4094.9  19.853557239330005
02-07-19 20:45:14       723.4   19.886771025756
02-07-19 20:45:34       812.7   19.842929499060002

0.500

02-07-19 20:17:01       781.2   19.843594781868
02-07-19 20:17:26       748.0   19.961165207646
02-07-19 20:17:51       4020.2  19.841598933444
02-07-19 20:18:16       773.7   19.929947269644
02-07-19 20:18:41       752.9   19.85355723933

from adafruit_blinka.

ladyada avatar ladyada commented on July 24, 2024

weird, can you see what the raw value, pre floatification, is?

from adafruit_blinka.

caternuson avatar caternuson commented on July 24, 2024

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 LOG_RATE=1:

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.005

02-07-19 21:36:42       708     19.79709212394
02-07-19 21:36:43       767     19.79709212394
02-07-19 21:36:44       33600   19.910022354720002
02-07-19 21:36:45       881     20.22885456282
02-07-19 21:36:46       784     20.122577160120002

0.020

02-07-19 21:38:21       820     19.79709212394
02-07-19 21:38:22       889     20.01629975742
02-07-19 21:38:23       33654   19.910022354720002
02-07-19 21:38:25       867     19.910022354720002
02-07-19 21:38:26       945     20.01629975742

from adafruit_blinka.

ladyada avatar ladyada commented on July 24, 2024

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

from adafruit_blinka.

ladyada avatar ladyada commented on July 24, 2024

hey just checking back, did you find any solution or workaround?

from adafruit_blinka.

caternuson avatar caternuson commented on July 24, 2024

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.

02-15-19 20:53:53 1015 27.4226979465
02-15-19 20:53:54 1015 27.3164205438
02-15-19 20:53:55 33783 27.5356129185
02-15-19 20:53:56 1015 27.74818298268
02-15-19 20:53:57 1015 27.4226979465

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.

from adafruit_blinka.

ladyada avatar ladyada commented on July 24, 2024

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

from adafruit_blinka.

caternuson avatar caternuson commented on July 24, 2024

OK. I can PR that. Want to close this issue and open a new one in https://github.com/adafruit/Adafruit_CircuitPython_seesaw ?

from adafruit_blinka.

ladyada avatar ladyada commented on July 24, 2024

issue cant be moved there for some reason, so opened there, closin' here!

from adafruit_blinka.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.