Electron, Vegetronix Soil Moisture and Analog input question

Hi all

First of all I am totally new to the world of electronics. I 'm trying to connect the humidity sensor Vegetronix VH400 ( http://www.vegetronix.com/Products/VH400/ ) to the Electron , obtaining very erratic analog input measures , which from what I understand are values ​​between 0-4093 . The sensor fully submerged shows a value of 3700 in the analog input .

Please could indicate me the right way to connect this sensor to Electron ?? I connect the sensor to the 3v3 and Vin Output.

I think 3700 is the correct value. The data sheet says the maximum output is 3.0V, which would correspond to a value of around 3723 from analogRead().

I’m thinking the supply voltage to the sensor is just a little too low, however. From the data sheet:

Supply Voltage: 3.5V to 20 VDC.

The 3V3 pin is 3.3V. To determine if this is the problem, I’d power the Electron by USB and try the VUSB pin to power the sensor instead of 3V3 and see if it works better. The data sheet says the analog output is a maximum of 3V so it should be safe.

1 Like

Thank you very much @rickkas7 i will give it a try :smile:

@rickkas7 can i make you a question please? Why is 3723 a correct max value for AnalogRead() ??

I dont understand why the max value is not 4093.

Thank you very much for your help.

The analog input of the Electron/Photon reads approximately 4095 with a 3.3V input.

The sensor data sheet says the maximum output is 3.0V.

3.0    x
--- = ----
3.3   4096

x = 3724

Thank you very much @rickkas7 !

Just for nit picking (as so often ;-))

I guess it should rather be

3.0    x
--- = ----
3.3   4095

given 3.3/3.3 would equate to 1.0, 4095.0/4095.0 would do the same, but 4095.0/4096.0 would not :wink:


@rickkas7 @ScruffR If i supply the sensor with 5V the max value of the analog input then is 2458??

Thank you very much for the help guys!

No, still 3724. The maximum analog output is 3V regardless of the supply voltage, according to the VH400 data sheet you linked to above:

Supply Voltage 3.5V to 20 VDC.
Output 0 to 3V related to moisture content


Thanks @rickkas7 !!!

Hey @rickkas7 can you help me with other question please? I have to connect 2 VH400 sensors to a Electron Board, is there a problem if i supply the 5V from the VUSB to the both sensor (interference, etc)??? Is a option to feed one of them with the LI+ and the other with the VUSB?


You can connect both sensors to the same power pin. If you’re powering by USB, then VUSB would be a good plan. If you’re using battery power, then LI+, or a step-up converter, will probably be necessary. The VH400 sensor uses very little power, but it does require 3.5V, more than the 3.3V from 3V3.

1 Like