Soil Sensor readings are not working properly

Hi john,

Yes you are correct. I think the photo that I took where it was hooked up to A1, I had changed the pin it referred to on the web app.

It was 6 months ago that I was working on it but it’s definitely worth giving it another crack.

Thanks,
Mark

To be sure :slight_smile:

I get 10-minute samplings on A1 ( with nothing connected to the physical pin )
which are quite stable ( range 390 to 400 ).

Will do further testing to satisfy my own curiosity :slight_smile:

Please note that an open analog input produces magic values. You need to have a defined potential, otherwise it reads rubbish. So either pull it up or down or connect an analog output device to it, but reading open leads is useless ;=) If you want to find out more search for pull up resistors :wink:

I agree . . but This Thread , the way I read the posts, seems to indicate that the ADC inputs on the Farmduino board do have pullups enabled “by firmware default” (?)
{ This might be a huge ASSUME by me :slight_smile: }

Can some kind person post a link to the Farmduino v1.4 board electronics schematic ?
That would be awesome ! I’m struggling to locate it.

1 Like

Hey @jsimmonds these are all the board references I have. I have used the picture sometimes as well. Note there is a Farmware pullup https://github.com/FarmBot-Labs/set-pin-io-mode.

https://cad.onshape.com/documents/6626b842adca229e69544ad1/w/89ac2637f82d915f22c2bcd0/e/3d45863fe03677daab019e4b


@whitecaps Great references to the physical hardware, thanks.

Maybe a better description of the thing I’m seeking is circuit diagram (?)

@jsimmonds here https://drive.google.com/drive/folders/1QjO80Qxxpn3aMxiYu_cNeXFhSkB6uhVC?usp=sharing

1 Like

Hey, no, there are no pullups in the schematic, afaik. And yes, the pullups are enabled on all analog input pins in Arduino firmware (farmbot_arduino_controller.cpp) to reduce the number of things that can go wrong with unused ports. The default soil moisture sensor seems (!?) to provide enough current to outvote the pullup. Experimenting with other sensors like capacitive moisture sensors or distance sensors will generate wrong values due to the enabled pullups.
At the moment there are two solutions:

  1. compile custom firmware for Arduino with pullup disabled (until next automatic firmware update…)
  2. use this farmware
    (3.) wait until new scheduled software fix in webapp, introducing a pin type “analog_no_pullup”

Analog pins without pullups and nothing connected read as random values, as can be tested using the above farmware on an unused pin.

Poking the moisture sensor twice in the same place, right after another, returns dryer readings the second time. This is due to a thin layer of air along the sensors surface in the second measurement. At least this is a result, I get repeatable with a capacitive sensor.

2 Likes

Hi qurzschluss,
I also use capacitive moisture sensors, but the farmware doesn’t seem to work for me when I try , what value do you choose (0, 1, 2)?

BTW, I can rebuild arduino code to fix it (comment out code below)
// pinMode(UTM_D,INPUT_PULLUP);

thanks :grinning:

Hi JoeHou,
I run the “Set Pin IO Mode” farmware with 0 for “input” in the beginning of any sequence measuring soil moisture. The readings I get, are between 370 (soaking wet) and 570 (air). This should correspond to 1.8V - 2.78V as sensor reading (the 10 bit A/D converter returns increments of 5V/1024).
I use a “homeengineer capacitive moisture sensor”
image
Its analog output voltage is 0-3V, so this corresponds fairly well. The values are quite stable although I do not have any experience with the temperature drift yet (still winter here).
Possible that some pins have additional connections on the board and behave differently therefore. I have my sensor wired on pin 59.
Georg (qurzschluss)

2 Likes

Hi qurzschluss,
I used the device is same as your.


I’ll try the farmware with 0-“input” parameter again, thanks! :grinning:

JoeHou

1 Like

Great! It’s work for me, thanks~😀


1 Like

What is the copper coloured extension on your UTM?

Hi @whitecaps,
It’s UTM that resize for minifarmbot.:metal:

3 Likes

This one https://youtu.be/dHGI75W_u_c?

No, I resize original farmbot design for my lab.

3 Likes

That looks like a lot of fun love the camera!

1 Like

I found it for sale online https://www.icshop.com.tw/product_info.php/products_id/26023

How much do they cost?

Hi whitecaps,
It was developed by me in FBTUG (Facebook: Farmbot Taiwan User Group) 3 years ago and sold by Icshop for STEM EDU.

However, due to changes in partnership, I do not recommend that you purchase it because there is no after-sales service.

I still recommend buying Farmbot v1.4/v1.5 to hack it!
Unless you are in Taiwan ~ :grin:

2 Likes

Hi @qurzschluss, due to my problems with the standard moisture sensor, I bought exactly the same capacitive sensor and mounted it to the UTM.
Then I tried naively just to read the sensor, but it didnt bring back senseful values.
I’m a software developer, but less a hardware guy and not too deep into arduino stuff.
I understand from your post that I need to set the “Pin IO Mode” somehow, could you explain in more details what needs to be done here?

Thanks in advance,
Markus