Perfecting sensor calibration
Sensor calibration is a very important aspect of product development, especially when you have a plan to deploy your product in a real-time environment. So, before moving on, first we need to calibrate the capacitive soil moisture and DS18B20 sensors. The soil moisture sensor operation varies from area to area due to air humidity and water levels.
So firstly, we will calibrate the soil moisture sensor by taking the values of sensors in the air and then putting sensors in the water. These values will be used to bind the final readings and, finally, we will convert the soil moisture sensor value from 0 to 100% via the map method. The soil moisture sensor is an analog sensor, so there is no requirement for an extra helping library, except the ADS module library, which is shown in the following figure with the name Adafruit ADS1X15.
Figure 9.9 – ADS1115 library
Here, we need to install a library for ADS1115/ADS1015 in...