My projects requires for me to measure the resistance and voltage for four sensors. All four sensors are flex sensors.
value1 = analogRead(flexPin1);
Serial.println(value1);//Read and save analog value from potentiometer
The above is line of code that I use to gain value from the flex sensor. FYI, flex sensor acts with the resistance increasing as the bending increases. With that being said, can I assume that the value obtained from the above line of code is the resistance??
Also, is it wrong for me to assume that the voltage is 5.5v for each sensor since I am using that source?
With that being said, can I assume that the value obtained from the above line of code is the resistance??
No, it's not. It is a value that represents the voltage on the analogue input derived from the potential divider formed by the flex sensor and the 10k resistor. It is not the resistance of the flex sensor. To get that you'd need to perform some maths.
Do you need the resistance? Often for this kind of thing you don't need the actual resistance, you just need to know the value from the A2D which you then compare to something meaningful, for example a limit value that you are not to exceed.
Yes, because I have to know the value of the voltage produce for each of the sensor.
PerryBebbington:
No, it's not. It is a value that represents the voltage on the analogue input derived from the potential divider formed by the flex sensor and the 10k resistor. It is not the resistance of the flex sensor. To get that you'd need to perform some maths.
Yes, because I have to know the value of the voltage produce for each of the sensor.
The output from the A2D is a number which is directly proportional to the voltage, you don't need to know the resistance to get that.
By some maths do you voltage divider rule?
I mean some maths that it would hurt my head too much to provide, sorry. However, if you really only want the voltage then, as commented above, you just read the A2D value.
I still question if you really need the voltage (or resistance). I suggest what you really need is the relationship between the values from the A2D and some particular amount of bending of each sensor.
Wire it up, send the values to the serial monitor, bend the sensors, see what you get. We can debate this all day, to really get an answer try it and see.
The ones highlighted in red are with some degree of bending, while the others are when the sensors are relatively untouched
PerryBebbington:
I still question if you really need the voltage (or resistance). I suggest what you really need is the relationship between the values from the A2D and some particular amount of bending of each sensor.
It took me a while, but after rereading it, I think you are right in a way. It doesn't have to be the exact voltage or resistance, just some sort of representation like the A2D would suffice.
My project aim is for rehabilitation: i.e. the rehabilitation focusing on finger movement. The reading in voltage and resistance will help to deduce the strength and frequency of bending the fingers
My project aim is for rehabilitation: i.e. the rehabilitation focusing on finger movement. The reading in voltage and resistance will help to deduce the strength and frequency of bending the fingers.
That's what I love about this forum, all the interesting things that people get involved in that I would otherwise know nothing about. Good luck.
PerryBebbington:
That's what I love about this forum, all the interesting things that people get involved in that I would otherwise know nothing about. Good luck.
Why do you insist in knowing the voltage (or resistance).
Are you building a voltmeter?
Are you sure the 5volt supply to the Arduino is always going to be 5.000 volt?
Because if it isn't (very likely), that "voltage display" is meaningless.
Better to work with the A/D values, and convert that with map() to some sort of bending ratio.
The current values of 981-985 (five steps) are almost useless.
Change the fixed resistor to a (higher) value that produces A/D values of about 512, e.g. 400-600.
That will give you the highest number of A/D values to work with (resolution).
Then map() it to a scale of your choice (0-10 or 0-100%).
Leo..