I'm working on a project that requires 3 flex sensors to be connected to the same Arduino Uno. Can I connect all the flex sensors to the same 5V input as shown in the figure?
Multiple flex sensors can share the same 5V and GND pins but be aware that there is a limit to how much current the Arduino can supply. This is unlikely to be a problem when using flex sensors
Your drawing is wrong as you only show 2 connections to sensor 2
Thanks for the response.
There is a third connection connecting the Flex sensor to a 330 ohms resistor that is connected to the ground pin on the Arduino. Have I made a mistake here?
Thanks.
What I was pointing out was that the wiring shown for the two sensors was inconsistent. Have you got a sketch working that reads one sensor ?
Please post a link to the flex sensors that you are using. The resistor value you are using seems unusually low
This is what I'm using right now for a single flex sensor.
I picked 330 ohms because it was being used in a YouTube tutorial that I followed. It doesn't seem to provide very consistent readings. Is there a better value that I should be trying?
This is where I purchased the sensor from. There doesn't seem to be much information here.
Thanks
What range of resistance does the flex sensor give ?
I don't have a multimeter with me at the moment but I'll get one in another 2-3 hours and check the resistance value.
When I run this code the values vary from 0 to around 30
int flexpin = A0;
void setup() {
Serial.begin(9600);
}
void loop() {
int flexVal;
flexVal = analogRead(flexpin);
Serial.print("Sensor: ");
Serial.println(flexVal);
delay(1000);
}
That looks like the voltage divider created by the sensor and the resistor is very imbalanced and that the resistor should be of a higher value
I swapped it with a 10k resistor and now the values are ranging from 15 to around 200. It's around 40 when there is no bending. Is this normal?
You really need to measure the resistance of the sensor to establish what is going on and you can also use it to measure the voltage at the Arduino input with various resistors in place
The resistance of the flex sensor is around 12k when it's not being bent and increases to around 27k after bending.
Anyway, although your diagram is a tad confusing, the answer is yes: you can connect all three sensors to the 5V rail, connect the three resistors to the GND rail, and the three separate junctions each to their own analog input port.
If the sensors had a much lower resistance value then they would be better powered from a separate 5V supply line, but at 12k each they aren't going to cause any problems driven directly off the Arduino 5V pin.
Use a 10K resistor and measure the output from analogRead() at the 2 extremes. Then use those values as the inLow and inHigh values for the map() function and map them to the required output range
Then the optimum value pull up resistor which gives you the highest A/D range is (12+27)/2 = 19.5k
18k is the closest standard E12 value.
10k will of course also work. 330 ohm is too far off.
Leo..
Just a hint: You should connect any two-terminal analog sensor - such as a flex sensor or LDR - between an Arduino input and ground. Then connect the pullup from the input to 5 V. This avoids having the 5 V supply running from the Arduino to the sensors so it is safer particularly if you have wiring damage, and minimises the possibility of interference being impressed on the 5 V supply.
The same of course applies to switches or contacts connected to digital inputs. ![]()
I note Wawa assumes this convention. ![]()
Wouldn't connecting it in that way not create a voltage divider? Most of the tutorials on Flex Sensors that I found online connect the pull-up to ground in order to create a voltage divider (unless I misunderstood it?)
If you have a bunch of 10k resistors, put two in series to get 20k. Very close to 19.5k.
Either way is a voltage divider.
And indeed you did. ![]()
There is a tendency for people to think in terms of more positive voltages representing a larger value, but this is entirely arbitrary.
Swapping the two parts - does not alter the function of the circuit - makes more sense in this situation and it is easy to invert the value read by subtracting it from the maximum value, but only if you actually need to. Generally you just make your decisions based on the value as it is read.
Because they are not actually experienced engineers. It's just a fact. We are always amused (or alarmed) by what people dredge up on "instructables". ![]()
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.

