-
Notifications
You must be signed in to change notification settings - Fork 160
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
Support for Capacitive Soil Moisture Sensor #114
Comments
Hi, would the MCP3008 fit for you? Are you able to buy it? It has a 10bit ADC, what should be enough for your coils, right? There is also a lib for it, so wie could implement it: https://pypi.org/project/mcp3008/
Am 26. Juni 2020 23:01:09 MESZ schrieb barista123 <notifications@github.com>:
…I would like to add Capacitive Soil Moisture Sensors to my setup such
as these: [Capacitive Soil Moisture
Sensor](https://www.amazon.com/KeeYees-Capacitive-Moisture-Sensor-Module/dp/B07R174TM1/ref=asc_df_B07R174TM1/?tag=hyprod-20&linkCode=df0&hvadid=343269677504&hvpos=&hvnetw=g&hvrand=13432535740877640298&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9026229&hvtargid=pla-818669536757&psc=1&tag=&ref=&adgrpid=77503953508&hvpone=&hvptwo=&hvadid=343269677504&hvpos=&hvnetw=g&hvrand=13432535740877640298&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9026229&hvtargid=pla-818669536757)
to my setup. I know that they need a ADC. Is it possible with the
current state of this project? If so, please recommend hardware. I am
new to working with the GPIOs and I am not a programmer.
Thanks for the project
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#114
|
I do not currently have the MCP3008, but I am able to buy them. I will be ordering the moisture sensors next week. If you can implement the lib or tell me what I need to do, I will order MCP3008 at the same time and test it. |
Okay, I will prepare a feature branch the next days. So you may test it :-)
|
Thanks. It will probably be next weekend before I get the parts. I will also need some basic instructions on how to pull the branch for testing. I installed the master via pip3. |
@BenjiU I see that you created a pull request. I should be receiving the MCP3008 today or tomorrow and will be ready to test. Please let me know how to install the branch and I will give it a try. |
Hi, I already wrote something, but closed the browser, bevor saving :-D
|
Had to rebuild my pi. Just getting a chance to test. Got this error on startup 2020-07-03 14:22:24,341 mqtt_gpio (INFO): Startup |
Hi barista123, I got the same error, but I did not do the Step 0, because I don't have any spi hardware for testing. Can you see device /dev/spi0.0? |
ls /dev/spi0.0 and /dev/spi0.1 report "no such file or directory" It appears that the device is "/dev/spidev0.0" and "/dev/spidev0.1" I discovered this by running "ls /dev/spi*" Let me know what I can do next. |
Round two: I get this now (discovered that my spi were not enabled on first try) 2020-07-05 06:43:50,139 mqtt_gpio (INFO): Startup |
But you are on the the "feature/mcp3008" branch |
On branch feature/mcp3008 nothing to commit, working tree clean Where would I find the mcp3008.py file? I'm not seeing it in the directory |
Looks like it was an error in the way I was calling the program. It now started up, without error. Let me plug my sensor back in and see if I get any readings |
It appears to have gotten past the error, but I am not seeing any output from the sensor. Is it because we have not told the system which of the 8 channels to monitor? I am setting up another program real quick to see if I get any output to confirm that my hardware is working |
By default it should read CH0. Otherwise you may configure it with the channel parameter:
|
using these instructions, I have confirmed that the sensor works: https://learn.adafruit.com/raspberry-pi-analog-to-digital-converters/mcp3008 I will try assigning the channel and see if that helps. |
Now getting this error: /srv/ve/pi-mqtt-gpio/pi_mqtt_gpio/server.py:728: DeprecationWarning: fractions.gcd() is deprecated. Use math.gcd() instead. |
Hi, I fixed something: please do a |
Getting closer. . . |
I added some traces for debugging |
2020-07-05 08:35:44,788 mqtt_gpio (INFO): Startup |
sorry, my fault. :-( Please pull again! |
Got this:
When I ended the program with "ctrl+ c" I got this:
In contrast, the AdaFruit example that I linked above returns this: root@DietPi:/srv/ve1# sudo python3 simpletest.py
|
I should clarify, the second readings are from a dry sensor. A wet sensor provides the following readings: root@DietPi:/srv/ve1# sudo python3 simpletest.py
|
Okay, I'll try to implement the Adafruit lib :-) but I can't start before this evening. |
Thanks. I appreciate the help. |
Hi, I implemented the Adafruit lib. Please pull and run python3 with sudo. When i use python2, it can't load the adafruit lib. |
It appears to be working. Without a sensor installed I get a value of 3 which is comparable to the Adafruit simpletest script. I am in the process of moving the pi to a new enclosure. So I will reinstall the sensor this evening and try again.
Also, since I am using pip3, I had to manually install the Adafruit library. The script tried to use pip instead of pip3 and failed. I got an error ( unfortunately, I am testing on my cell phone and could not copy the error) I will uninstall the library later and try to get a copy of the error for you.
…Sent from my iPhone
On Jul 5, 2020, at 1:39 PM, Benji ***@***.***> wrote:
Hi, I implemented the Adafruit lib. Please pull and run python3 with sudo. When i use python2, it can't load the adafruit lib.
sudo python3 -m pi_mqtt_gpio.server config.mcp3008.yml
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Hi, sounds good. I had a look at my python environment and noticed, that |
Just tested this morning. I’m getting a reading from the sensor comparable to the test runs I ran yesterday. I will change the parameters this evening after work to confirm that it updates with changes. But it appears to be working.
…Sent from my iPhone
On Jul 6, 2020, at 12:59 AM, Benji ***@***.***> wrote:
Hi, sounds good. I had a look at my python environment and noticed, that pip installs to python3.6, but python runs python2.7 :-) when I manually do pip2 install Adafruit-xxx, I can run it with python (not python3). So maybe I works for you with python xxx.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I apologize. I did not get a chance to do further testing last night. I will try tonight and post my results. |
On a different topic, I can open a different issue if appropriate. My temperature sensor, DHT22, does not like the environment that I am using it in (greenhouse). If I cannot find a suitable location, I may move to a SHT-30 (https://www.adafruit.com/product/4099). Would it be difficult to incorporate this sensor? The system appears to be working great BTW, this is an extremely useful project. |
Information and python library for the sensor can be found here |
Great news, the sensor reacts as expected. It looks like this feature is working as expected. Thanks for all your help!
…Sent from my iPhone
On Jul 6, 2020, at 12:59 AM, Benji ***@***.***> wrote:
Hi, sounds good. I had a look at my python environment and noticed, that pip installs to python3.6, but python runs python2.7 :-) when I manually do pip2 install Adafruit-xxx, I can run it with python (not python3). So maybe I works for you with python xxx.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I would like to add Capacitive Soil Moisture Sensors to my setup such as these: Capacitive Soil Moisture Sensor to my setup. I know that they need a ADC. Is it possible with the current state of this project? If so, please recommend hardware. I am new to working with the GPIOs and I am not a programmer.
Thanks for the project
The text was updated successfully, but these errors were encountered: