Soil Sensor readings are not working properly

Hi john,

Hooked it up to the farmduino 1.4.

Pics are on this thread. Tried pretty much all the analog pins there.

I’m no electronics expert but I’m pretty sure I hooked it up correctly. I had an output from an analog pin on the arduino, increasing in value every 30 seconds. The sketch worked correctly with an LED so I know it was working as planned. Values bounced all over the place.

Thanks,
Mark

1 Like

@markgregory8, thanks.

The Genesis Pinout References seem to say that one should refer to A1 input as pin 1 ( Analogue ) in the WebApp . . what do you think ?

Getting a bit late for me here now but will test this more tomorrow :expressionless:

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

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:

2 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?