Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

PSoC™ 6 SDK Forum Discussions

Panometric
Level 5
Level 5
10 solutions authored First comment on KBA First comment on blog

I am working on a wearable device using CSD capsense to detect if it is being worn. 

I used manual tuning, cap sense tuner to find the setup values,  and no auto-reset.  If I start the device, and then put it on,  the sensors work great.  But if I suffer a reset while the device is being worn, they never sense anything until I take it off, then put it back on.  I presume this is because the baselines are being initialized while being worn at reset. 

I also presume something similar would occur if it were worn for a long time. So I guess I am looking for a way to not use baselines at all, and set them up with fixed values when the unit is assembled.  But it's not very clear how to do that in the API. 

I have been using: Cy_CapSense_ProcessAllWidgets() and Cy_CapSense_IsSensorActive() but if I don't want baselines, it appears I need to move down to lower level calls.  Can you suggest how to do this, or an an example?

 

 

0 Likes
1 Solution
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi @Panometric 

 

Your reasoning is correct, it is because the baselines are reset that you see no signal when the device is started while wearing it. There are a couple of solutions to this. 

1. If there is space, you can add a reference sensor, which is a dummy sensor that does not come in contact with the touch which can be used to track just the baseline values. The logic would then be that you would use the raw counts from this sensor as the baseline for your actual sensor. This will ensure temperature immunity but the reference sensor needs to be tuned carefully to have the same gain as the primary sensor. 

 

2. Another approach is to obtain the baseline once while it's not worn (during programming itself) and store it in the flash of the device. Subsequent scans can use this baseline value so that it is not reset while CapSense is re-initialized. However, there will be raw count drifts due to temperature changes and this method will not be able to compensate for that. 

To use a custom value of baseline, you can simply write that value into CapSense_dsRam.snsList.<widget name>[0].bsln[0]. With this, you can use the CapSense_ProcessWidgetExt which has the capability to ignore processing the baseline further. 

 

Best regards, 
Hari

View solution in original post

0 Likes
1 Reply
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi @Panometric 

 

Your reasoning is correct, it is because the baselines are reset that you see no signal when the device is started while wearing it. There are a couple of solutions to this. 

1. If there is space, you can add a reference sensor, which is a dummy sensor that does not come in contact with the touch which can be used to track just the baseline values. The logic would then be that you would use the raw counts from this sensor as the baseline for your actual sensor. This will ensure temperature immunity but the reference sensor needs to be tuned carefully to have the same gain as the primary sensor. 

 

2. Another approach is to obtain the baseline once while it's not worn (during programming itself) and store it in the flash of the device. Subsequent scans can use this baseline value so that it is not reset while CapSense is re-initialized. However, there will be raw count drifts due to temperature changes and this method will not be able to compensate for that. 

To use a custom value of baseline, you can simply write that value into CapSense_dsRam.snsList.<widget name>[0].bsln[0]. With this, you can use the CapSense_ProcessWidgetExt which has the capability to ignore processing the baseline further. 

 

Best regards, 
Hari

0 Likes