Products > SoilWatch 10

Problems with soilwatch in mkr Fox 1200

(1/6) > >>

martin.i.tycgis:
Hello!

First of all, sorry about my english and i am kind a noob with arduino but i love to try new things out!  i really like soilwatch and i try it first on Arduino Uno and was accurate and work correctly.

The thing is i am starting with Mkr Fox 1200 and i do not know why i get on error on the code you provide to try the sensor in this line:

if(is1V1Output == true)
  analogReference(INTERNAL); //set ADC reference to internal 1.1V

i get this error:

exit status 1
'INTERNAL' was not declared in this scope


if i delete this line of code, the ADC turns to 900 in air and i really do not know the meaning of this.

As i said sorry for my english and sorry if this is a dumb question.

Thx you for your time.

Martín.

martin.i.tycgis:
Thinking about it, maybe is the Voltage ? I believe mkr Fox 1200 works with 3.3V maybe is this the problem ?

pinolec:
Hi Martin,

The code provided is optimized for Arduino Uno/Mini. It does require few tweaks to work with SAMD21 based boards.

Try to delete whole this section:

--- Code: ---if(is1V1Output == true)
  analogReference(INTERNAL); //set ADC reference to internal 1.1V

--- End code ---

Have you set correct ADC pin:

--- Code: ---const int analogInPin = A0;
--- End code ---

What readings do you get in the air and in water?
Which SoilWatch 10 version do you have?
How do you power the sensor? (what voltage and source)

BTW your English is fine  :)

martin.i.tycgis:
I get this readings now, wrong pin... haha

on air:
ADC = 34, Moisture value = 5
ADC = 34, Moisture value = 5
ADC = 35, Moisture value = 5
ADC = 34, Moisture value = 5
ADC = 34, Moisture value = 5
ADC = 46, Moisture value = 7
ADC = 41, Moisture value = 6
ADC = 40, Moisture value = 6
ADC = 66, Moisture value = 10
ADC = 45, Moisture value = 7

On water:
ADC = 873, Moisture value = 140
ADC = 883, Moisture value = 142
ADC = 884, Moisture value = 142
ADC = 883, Moisture value = 142
ADC = 882, Moisture value = 142
ADC = 885, Moisture value = 142
ADC = 885, Moisture value = 142
ADC = 883, Moisture value = 142
ADC = 883, Moisture value = 142

the adc is normal ? i now i have to change the min ADC and the max ADC, but i think that´s pretty normal i guess.

i power up with the vcc pin, i believe that in mkr fox 1200 is 3.3 V, now i am using USB but i will try it with 2X AA batteries

thanks for your time,

Martin

pinolec:
Great :)

The ADC output is good. Now just adjust min and max ADC.
Yes the VCC on this board is 3.3V. If you plan to use the sensor with batteries then consider adding a transistor to turn on the sensor only for the measurement. Sensor consumes around 24mA and it will drain your batteries rather quickly if powered constantly.

I have quickly looked at the schematics for Arduino MKR Fox 1200 and my concern is will you still have 3.3V at the VCC when powered from 2xAA batteries?
I can't see any boost converter. Have I missed something? Here is the schematic: https://content.arduino.cc/assets/MKRFox1200V2.0_sch.pdf

Navigation

[0] Message Index

[#] Next page

Go to full version