1. No, environmental compensation is not done in the CapSense CSD component for liquid level sensing. This must be taken care separately in the application.
2. You are correct, as the temperature changes, the initial calibration will not be valid anymore and the change will cause the raw counts also to change and this might be interpreted as a signal. So the environmental changes must be compensated.
You can refer this kba Using a CapSense Reference Sensor to Compensate Environmental Changes - KBA227366 where an example of checking the baseline to determine the environmental change is provided. Note that this implementation requires a reference sensor that is placed outside the normal LLS system that is not subject to these changes.
If that is not possible, then, you can use a reference sensor which is placed such that it does not come in contact with any liquid and the raw counts of this sensor can be used as baseline for the LLS sensors.
Thanks for the reply.
According to your reply and the information in below thread on cypress community, we really need the baseline information to eliminate the environmental changes after calibration.
//Calculate difference between baselines
baseline_diff = CapSense_dsRam.snsList.button1[0u].bsln[0u] - CapSense_dsRam.snsList.button0[0u].bsln[0u];
The above baseline information comes from CapSense library base on button example, but I am not able to find any baseline information from CapSense_CSD component, how can I get the baseline information from CapSense_CSD library?
Thanks and regards,
It is recommended to use the CapSense V7 component for any new projects as it is an updated version with several bug fixes and improved functionality.
However, to answer your question, you need to use the CapSense_GetBaselineData() API that takes the sensor number as a parameter (Sensor numbers are defined in CapSense.h file) and returns the baseline data.
I am not able to use "CapSense_GetBaselineData() API since my project bases on CY8CKIT-022 CapSense Liquid Level Sensing shield which is using "Generics" in widgets config.
If that is the case, do you have any suggestion if implementing environmental compensation in my project?
For generic sensors, there is no baseline maintained in the CapSense configuration. So, you can use the raw count from the reference sensor and process accordingly. That is, currently you are processing the sensor status based on a previously stored raw count value, which is stored using the StoreCalibration API.
Instead, you can modify the logic to process sensorDiff as (current Raw count of sensor) - (current raw count of reference sensor).