- Mon Sep 18, 2017 11:12 am
#196204
Good day,
I just bought that rpoduct
https://www.sparkfun.com/products/13637
I also read the Hookup guide and theyspoke about calibration.
I understood, we have to take the measure when the soil is dry and when is wet.
Which parameter should we enter in map()
fromLow: I suppose is the value when the soil is dry
fromHigh: I suppose is when the soil is fullywet
but what about toLow and toHigh?
I am bt confused about the use of map while I only now the return value, the dry value and the wet value.
Some has experience with calibrating a moisture sensor?
Thank a lot
I just bought that rpoduct
https://www.sparkfun.com/products/13637
I also read the Hookup guide and theyspoke about calibration.
I understood, we have to take the measure when the soil is dry and when is wet.
Using the sketch above, note what values your sensor outputs when the sensor is completely dry vs when the sensor is completely submerged in a shallow cup of water. Depending on what microcontoller you’re using, the operating voltage of that microcontoller, and the resolution of its analog-to-digital converter, you’re results will vary.then
Once you have a good handle on the values you can expect, you can use the map() function to adjust your code accordingly.I am confuse about the map function.
Which parameter should we enter in map()
Code: Select all
I supose, the value, is the return value from the moisture sensor.map(value, fromLow, fromHigh, toLow, toHigh)
fromLow: I suppose is the value when the soil is dry
fromHigh: I suppose is when the soil is fullywet
but what about toLow and toHigh?
fromLow: the lower bound of the value's current rangeIn the case of my moisture sensor, how can get the target range, etc
fromHigh: the upper bound of the value's current range
toLow: the lower bound of the value's target range
toHigh: the upper bound of the value's target range
I am bt confused about the use of map while I only now the return value, the dry value and the wet value.
Some has experience with calibrating a moisture sensor?
Thank a lot