How to Make FLEX Sensor at Home | DIY Flex Sensor

28K17431

Intro: How to Make FLEX Sensor at Home | DIY Flex Sensor

Hello people, in this instructable you will be learning how to make a FLEX Sensor for almost no money at home. These kinds of sensors cost quite a lot in the market ranging from 10$ to 30$.

They are useful at an industry-level but for making DIY tech projects at home, that is too much of a cost to pay. Thus I bring to you an alternative solution to the sensor and I will show you how you can build one yourself at home very easily. So, let's dive right in!

Subscribe on YouTube for Updates!

STEP 1: Story, Research and Working

1.1 The Flex Sensor

A flex sensor or bend sensor is a sensor that measures the amount of deflection or bending. It is also referred to as a flexible potentiometer. It works on the principle of resistance and gives out various values based on the variations in resistance.

Its working is very simple. It has a low resistance when it is held straight because of the very low distance between the conductive particles present in the sensor. When it is bent, the distance between the particles increases which leads to higher resistance and a lower current passing through the sensor.

This way we can use a microcontroller board like Arduino very easily as what we need to do is just use the sensor as an input and we will get a value between 0 and 1023 where 0 will be when it is straight and 1023 when it is bent.

For more info regarding flex, sensor read this pdf from Sparkfun electronics!

1.2 Hacking The Sensor:

Now what we are going to be doing here is we will be replacing the inner resistive carbon elements with a paper that is shaded fully with a pencil. Pencil lead conducts electricity and we are going to use that to our advantage.

And for the main conducting plates of the sensor, we will be using two strips of tinfoil/aluminium foil as these conduct electricity quite well and again we will use these easily-accessible material found at every home, to our advantage.

The sensor will have two terminals and we can very easily connect it to an Arduino board. Flex sensors have a wide range of applications:

  • Automotive controls
  • Medical devices
  • Industrial controls
  • Computer peripherals
  • Fitness products
  • Musical instruments
  • Measuring devices
  • Virtual reality games
  • Consumer products
  • Physical therapy etc.

This was all about a flex sensor in easy terms and also how we will be hacking the sensor to meet our needs and also reduce the cost drastically using easily-accessible and low-cost material!

Now, let's move on to gathering the material required, to actually start building it!

STEP 2: Gather Required Stuff

You will need very few and easily accessible things for this project.

2.1 Material Required:

  • 2 x Cardboard Strips (10cm x 1.5cm)
  • 1 x Paper Strip (10cm x 1.5cm)
  • 2 x Tinfoil/Aluminium Foil Strips (9cm x 1cm)
  • Some Glue
  • A Pencil
  • 2 x Small Pieces of Jumper Wire

2.2 Tools (Optional):

  • Hot Glue Gun

Gather the above things and just move on to the next step!

I prefer Quartz Components personally for buying any kind of tech-related material.

STEP 3: Stick Tinfoil Strips to Cardboard Strips

This is a very easy step. All you need to do here is just stick the two tinfoil strips onto the two cardboard strips that you had earlier cutout. You can use any kind of glue to stick the tinfoil strips onto the cardboard strips.

Make sure that the tinfoil strips are centred with respect to the cardboard strips and not sticking out on the edges of the strips. This has a very important reason that you will see later on!

You can even make use of the images above to follow along. Now move on to the next step!

STEP 4: Shading the Paper Strip

This step too is going to be quite easy. The reason I am repeating this statement is that this project indeed is so easy to make that anyone can make it without any technical experience too. Now coming to this step, we just need to shade the paper strip that we had taken earlier on both sides. You can use any kind of pencil for it.

Just make sure that you shade the paper strip very dark. I am sure there is going to be a mess after you are done with black carbon prints everywhere but I guess that is OK :)

Without further ado, let's move ahead!

STEP 5: Connecting Wire Ends to Strips

Now what we need to do is we need to "create" the sensor terminals using which the sensor will actually be able to interact with other electric components. We just need two pieces of wire. I took two female-headed jumper wires and cut-off them near the female wire joint so that later on we can just plug in two jumper wires into the sensor terminals.

You can also use any normal conducting wire as per convenience. Now we just need to stick these wire ends to each of our previously prepared card-foil strips. You can use hot glue like I did or you can also use some tape for the task.

Just make sure that the wire ends are properly pressed onto the tinfoil because if there is no proper conduction then it won't work properly.

You know the drill, just move on to the next step!

STEP 6: Stacking the Material

Now we just need to bring together the previously made individual components. The stacking will be in this order:

  • Any Card-Foil Strip
  • Shaded Paper
  • Any Card-Foil Strip

But, make sure that the card-foil strips are faced inwards. Now just use some hot glue or tape to make sure that the ends are joined so the sensor stays firmly held together and doesn't fall apart.

STEP 7: Final Look

So that was it for the build of this DIY Flex Sensor. Make sure that after you are completing making it just bend it a couple of times and see whether the hot glue stays where it should be because at times what can happen is that upon bending the sensor the hot glue may rip off.

As you can see in the above images, our sensor has come out pretty neat. If you are in an artistic mood, you can also go ahead and customise it πŸ˜‚

Now it is time for the final part. The Testing

STEP 8: Building the Test Circuit

Now we need to test the sensor and see if it was really worth making it. We need an Arduino board and an LED to test our flex sensor out. We also need a 22kΞ© resistor. It will be better if we use a breadboard because that will make the circuit-building process easy and fast.

I have attached all the required resources like the schematic and the code which will help you test your own flex sensor out and see if it works.

Just follow the circuit diagram and use my code or write it yourself and hope that it works.

Code:

   ////////////////////////////////////////////////////////
  //                 DIY Flex Sensor                    //             
 //              By Aarav Garg - Tech Nuttiez          //
////////////////////////////////////////////////////////

//defining led and flex sensor pins
#define led_pin 9
#define flex_pin A0

//variables for flex sensor readings and led brightness output
int flex_reading;
int led_brightness;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600); //setup serial monitor 
}

void loop() {
  // put your main code here, to run repeatedly:
  
  flex_reading = analogRead(A0);
  Serial.println(flex_reading);
  
  led_brightness = map(flex_reading, 0, 300, 0, 1023);
  analogWrite(9, led_brightness);
  
  delay(200);
}<br>

STEP 9: Did It Work?

If you are here, then I assume that you have built the project and it either worked which is great or it didn't which is also great because you not only will know how you build something but also how you do not build it and this kind of learning is very useful.

9.1 It Did Not Work 😲:

If your sensor does not work then try doing some of the following things as measures of troubleshooting:

  • Try using a better quality of tinfoil
  • Make sure that the wire ends are firmly pressing on the strips and you can even do a small conduction test to test these out.
  • Make sure that the two foil strips do not touch each other.
  • Make sure that you have shaded the paper quite dark.

If after all of the fuss, you still have any problem you can always reach out to me.

9.2 It Worked πŸŽ‰πŸŽŠ:

Great job mate. You overcome all the obstacles and finally are here, touching victory yourself and that is amazing. There is also a section down here "I Made It". Meet me there.

Thank You :)

23 Comments

Could use use copper tape instead of tin foil? I found it to be easier to make.
Hey Aarav, thanks for the tutorial! Unfortunately, I've been having a lot of issues with building my flex sensor. I've followed all your steps (and even bought better tinfoil) and yet am not reading in an analog value.

When I touch the two metal strips together (in the voltage divider circuit w/ 22KΞ©), I do get a reading between 900-1000, so I know the wires/metals are properly connected. FYI: in my circuit I have the 5V input feeding into the flex sensor and then the resistor going to the ground, but I've tried your exact schematic (the opposite order) and do get a reading of about 2-10. I've tried resistors from 1K to 100K Ξ© and still reading 0 when I try attaching the lead-covered paper.

I've seen another tutorial that puts the strips on the same side of the paper, yet still seperated, and that also didn't work πŸ˜…. I'm not sure what to do!! I do not want to pay $15 x 5 for my project to get real sensors...
Congratulations!!! You're in the finals!!!! :) I love your instructibles! :)
Thank you so much!
Thanks for this! I created kind of a touch sensor by mixing graphite powder with glue as a cheap alternative to the conductive paint (probably learned from this site). I wonder if it worked here too instead of the shaded paper. Will definitely try.
Yeah, that is fairly a great idea. Do try it out and if it works, then you probably know about the Made It section here! πŸ˜€πŸ˜€
Great instructable. It might be that making multiples in a single process could be easier. Say 5 side by side, then cut the strips off and seal one by one as the end step.
on carbonising, take the lead out of the pencil and use it parallel to the paper so it’s easier to cover the material. Use a glass surface so it’s dead flat.
Yeah, that is a great thought for whoever wants to make multiples of it. Thanks for such a valuable perspective!
I don't get it. When the paper strip bends, the carbon particles get closer together on the inside of the bend, and farther apart on the outside. The resistance of the foil strips doesn't change but maybe the foil gets pressed harder against the paper, compensating for the increased resistance when the carbon particles get further apart. But you're measuring resistance from one side of the paper to the other side, not from one end to the other. How does the resistance THRU the paper change?

Also the diagram at Step 1 showing 30 Kohm straight and 70 Kohm bent shows a different construction -- maybe it shows two cardboard strips on the bottom with 1 foil strip between them. The left end of the foil strip has the wire connected, and the right end wraps around the far end of the top cardboard strip so the foil makes contact with the far end of the paper strip, which has carbon on only the bottom side.

Or, if the carbon is on both sides of the paper and each side has a wire at both ends (4 wires, no foil electrodes) you could measure the difference between the two carbon paper resistors (one on each side of the paper) and the inside bend will decrease in resistance while the outside increases.
The paper is darkly smeared with graphite which causes it to act as a semiconductor. If we connect it to two ends of the same strip it will not cause the value to change. The change is due to the paper and the carbon atoms it has as graphite is a form of carbon.
Refer: https://www.researchgate.net/publication/332564908...

Don't consider the paper to be shaded on both sides and consider the paper and the graphite as a single carbon strip and then things will surely be much clear! I hope it solves your doubt now. Do refer the link above for a much clearer understanding!
Thanks, now I understand -- the carbon is pushed into the paper far enough from each side to contact the carbon from the other side. I bet porous paper like newsprint works better than glossy paper.
Yes, exactly! πŸ˜€
This is exactly what I wanted! I want to make a suit that "reads" my movements and controls a robot or an exoskeleton accordingly. Of course I don't have that much money to spend on flex sensors but there's no need anymore! Thank you!

P.S.: You have my vote
Thank you. Happy to see myself creating some positive value! πŸ˜„
Although I have no need for a flex sensor (that I know of πŸ™‚), the ingenuity and complete description of this 'hack' is very impressive - excellent work! Got my vote.
Great! keep up the good work!
Thank You! Subscribe for updates!
Hey mate,
Nice Instructable, you appear to have a knack for teaching, keep it up!
I did, however, notice what I believe to be a mistake/mismatch in one of the steps...

Step 8: Building the Test Circuit
The first thing we're presented with in step eight, is what appears to be a screenshot made in either the 'Fritzing', or 'Wires' program. In it, we can see a piece of breadboard and an Arduino Uno, the 'flex-strip' and a resistor.
That resistor let's call it R1, according to the picture it should be a 220Ω (Ohm) resistor.
It is definitely a four band, 1/4 Watt (or 1/8 Watt?) resistor, with the first three colors being;
RED, RED and BROWN.
That makes it a 220Ω Resistor, the fourth band is tolerance, I didn't pay attention to that though, since that is not the problem here.

Then, underneath that picture you continue explaining what's next, and there you say this;

"Now we need to test [SNIP] We
also need a 22kΞ© resistor
.
It will be [SNIP]"

You probably know what I mean now, but in case you missed it, the picture clearly shows us a 220Ω resistor,whilst in the text underneath it you say we need a 22kΩ (=22,000Ω) resistor.Clearly only one of the two is correct, the one in the picture, or the value you wrote underneath it.

Cheers,

TFD
More Comments