i have a nrf52840 dk
i need to connect the flex sensor to the board and know the resistance value while bending
how to do it?
and what code should i dump
i have a nrf52840 dk
i need to connect the flex sensor to the board and know the resistance value while bending
how to do it?
and what code should i dump
Hi,
I do not have any experience with flex sensors, but I found these lines on SparkFun that enlightened me a bit on what this is and how it can be measured:
"Left flat, these sensors will look like a 30kΩ resistor. As it bends, the resistance between the two terminals will increase to as much as 70kΩ at a 90° angle. By combining the flex sensor with a static resistor to create a voltage divider, you can produce a variable voltage that can be read by a microcontroller's analog-to-digital converter."
You can find a SAADC example in our SDK that can be used to read the analog input from the voltage divider.
Best regards,
Jørgen
Without studying this too much, I think that if you use VDD/4 as the reference for the SAADC, GAIN setting of 1/4, and a 10-bit resolution, you should be able to use these lines pretty much without modification to get the resistance:
float flexV = flexADC * VCC / 1023.0; float flexR = R_DIV * (VCC / flexV - 1.0);
Without studying this too much, I think that if you use VDD/4 as the reference for the SAADC, GAIN setting of 1/4, and a 10-bit resolution, you should be able to use these lines pretty much without modification to get the resistance:
float flexV = flexADC * VCC / 1023.0; float flexR = R_DIV * (VCC / flexV - 1.0);