4 Replies Latest reply on May 10, 2019 5:06 AM by user_4082536

    CapSense Level Sensing with PSoC 4



      I’m a student in Geneva, I recently acquired CY8CKIT-022 CapSense Liquid Level Sensing Shield and CY8CKIT-042 PSoC 4 Pioneer Kit to work with.

      I have some questions:

      • It is possible to adapt this concept to sense the level of solid materials (essentially copper)?
      • If I want to sense a 1mm change, can I do the measure with the 12 Sensor Flex? With the code example the value only changes every half sensor covered, what precision can I reach with each sensor? Or the only solution is to make my own PCB with a bigger number of sensors?
      • I’ve read the documentation but have some difficulties to understand how works the current to digital converter in the capsense CSD method. When I measure directly on the sensors it looks like a normal output of the sigma-delta converter, but then how does it sense the current from each sensor? I was expecting to see the periodic charge and discharge of the sensor capacitor, I’m a bit confused with this part of the method.



      Best regards



      Oscar Feijo Aste

        • 1. Re: CapSense Level Sensing with PSoC 4

          Hi user_4082536,


          1. The Capsense liquid level sensing is made for liquid level measurements. We have not tested the same for solid level measurements. Hence you may have to experiment with this and find out. All the sensor patterns and example project were created for liquid. Perhaps, the entire firmware and hardware needs to changed even in case of a different liquid. It is all based on your liquid or solid in your case. You may have to write your entire firmware.


          But first check if solid is being detected as per your requirement and then go ahead.


          2. When you are using segmented sensors for your application, the resolution is determined by the max height of the container divided by the total no of sensors, if they are of equal height. Now, if you want high resolution at the bottom of the container or at the top, you need to reduce the height of the sensor and cluster more sensors at that position. And you need to report the level based on the sensor height and no of reported ON status of the sensors.


          Please note that in a segmented sensor #2 you can achieve only point measurement (ON/ OFF). By placing a array of sensors you can achieve a ladder type continuous measurement.

          But you can implement sensor #1 , such that when water is there in one sensor it touches a part of the other sensor. You develop a centroid algorithm to detect intermediate liquid positions. But again the resolution depends on your algorithm here.


          Now there is one more option to detect 1 mm change in level. You can use differential sensor, that uses the ratio value of two sensors with triangular patterns and provides a low-cost method of determining the liquid level. The differential method provides a reduced accuracy compared to the segmented sensor but requires only two sensors for reduced sensor cost. The sensor pattern is composed of two sensors shaped so that the ratio of their values is equal to the percent value of the liquid level.

          But there are some disadvantages in using this method that is well described in our app note (PSoC 4 Liquid level sensing )  - https://www.cypress.com/file/218531/download



          With the code example the value only changes every half sensor covered, what precision can I reach with each sensor? Or the only solution is to make my own PCB with a bigger number of sensors?


          Yes, it is because that is how the threshold values of the sensors are set. Threshold values determine whether the sensor status is ON/ OFF. The threshold values in the example project are set such that it triggers only when the sensor are half filled. This is done to accommodate for the changes in operating conditions and the board to board Cp  variations.


          3. Yes you will be able to see charge and discharge waveform when you probe the sensors directly. Can you please let us know how you are measuring the signal. Also your point of measurement in the board.




          1 of 1 people found this helpful
          • 2. Re: CapSense Level Sensing with PSoC 4

            Hi BragadeeshV_41,


            Thanks for your answer!


            For the measure, I loaded the 'LLS_CSD_12RX-042.cdwr' project on my board. I measure directly on the flexible PCB pins with an oscilloscope:


            I see the scanning of the sensors:



            But when I zoom into the RX0 sensor per exemple I observe this kind of waveform:



            For me this waveform  looks like the output of the sigma-delta converter, so is this the Raw count? Cause if we are supposed to have the charge and discharge of the sensors, I was expecting something periodic. I'm just confused on how is used the current-to-digital converter from the CSD sensing method:



            Thanks for helping me.



            Oscar Feijo Aste

            • 3. Re: CapSense Level Sensing with PSoC 4

              Hi user_4082536,


              You observe this waveform since you have used PRS (Pseudo Random Sequence) as the clock source for sense clock aka Analog switch drive source. Instead of having a fixed frequency and hence high energy in particular frequency in the frequency spectrum, the PRS varies the frequency of the sense clock and makes sure the energy is distributed in the frequency spectrum. We usually recommend PRS signal for reducing emissions in a particular frequency. So the waveform has varying charge and discharge cycles due to varying sense clock frequency.


              Now, if you want to observe periodic charge and discharge cycles, you have to set your sense clock source to Direct. This way sense clock is a derived from the mod Clock (Sense clock = Mod clock/ sense clk divider).


              Follow these steps to change the sense clk source to direct.


              1. Open the Capsense component.

              2. Navigate to Advanced tab.

              3. Choose Direct as Analog switch drive source




              • 4. Re: CapSense Level Sensing with PSoC 4

                BragadeeshV_41, thank you very much for your help.