» Electronics » Arduino »How to make a cheap DIY bend sensor for your Arduino!

How to make a cheap DIY bend sensor for your Arduino!


Good day lovers of arduino! As it was hanging in the Internet, I came across a rather entertaining article on how to make a hand manipulator that repeats the movements of a person’s hand, inspired by simplicity and effect homemade homemade decided to collect it. I found bend sensors on the Alliekspress for the transmitter’s hand and got a little dead, one thing stood in the region of $ 15-20, it turns out that 5 such sensors for only one hand will cost $ 75-100 and this is only for the sensors! After some time, I learned how to make such sensors do it yourselfIt turns out to be very simple and cheap.

And so for the bend sensor we need:
-pay Arduino Uno ()
-breadboard
- connecting wires like "father-mother" or "father-father"
-servomotor
-cardboard
-paper
-foil
-pencil
- power supply from 6 to 12 volts (I use 4 batteries connected in series at 1.5 V)

From the tools we need:
glue gun
-scissors

And so, the first thing we cut out of the cardboard is two strips 2 cm longer than your index finger and about 1 cm wide:


Cut one of the same strip of paper just a little less:

Pencil shade both sides of the paper strip as best as possible:


Cut two strips of foil smaller than paper:

Glue them to the cardboard strips as shown in the photo:

From the connecting wires “father-mother” we cut off the exit “mother” and we clean their ends from insulation:

We attach from tape or solder:

We attach a paper strip to one of the halves, so that it is in contact with the foil, then cover with the second half the side with the foil, press and glue on the sides:



We make such “snakes” on each side with the help of hot glue, they are needed so that the design is more flexible

We take an arduino and connect the 5v output to the plus of the breadboard, and Gnd to the minus:


Add the connecting wires to the servomotor and connect it to the arduino as follows:
Brown wire to gnd
red to 5v
orange to 9 pin



To our bend sensor, add two dad-to-dad wires

Connect them to the breadboard:

One of the ends of the sensor is connected to the plus of the breadboard through a 22 kilo-ohm resistor (unfortunately I mixed it up and connected it to another output, but this did not respond to operability), and the other to the minus:


On that breadboarda line on which the end of the sensor connected to the plus is located, add another wire and output it to the output A0 on Arduino:



Now we connect Arduino to the computer, start the Arduino IDE and load the following sketch into it:
#include

Servo servo1;
const int flexpin = 0;

void setup ()
{
  Serial.begin (9600);
  servo1.attach (9);
}


void loop ()
{
  int flexposition;
  int servoposition;
  flexposition = analogRead (flexpin);
  servoposition = map (flexposition, 1018, 1023, 0, 90);
  servoposition = constrain (servoposition, 0, 90);
  servo1.write (servoposition);
  Serial.print ("sensor:");
  Serial.print (flexposition);
  Serial.print ("servo:");
  Serial.println (servoposition);
  delay (1000);
}


Turn on the port monitor to which Arduino is connected and load the sketch

Now we observe the changes that occur in the port monitor when our sensor bends, we see that 1023 is 90 degrees, and 1020 and 1019 are 0, so in my case, I change the number 1018 in the sketch to 1020, you can have a different one. Now 1020 is 0 degrees, and 1023 is 90 degrees. After all the changes, upload the new customized sketch to the Arduino board



That's it! Our simplest and most importantly cheap bending sensor is ready!

If everything is done correctly, when the sensor is bent, the servo drive will make a 90-degree turn, and when extended, it will return to its original position. Of course, the accuracy of this sensor is inferior to the purchased one, but it is suitable for projects that are not particularly confused, and besides, if everything is done carefully and fine-tuned, it will turn out almost as purchased. I hope this article is useful to someone.


Thank you all for your attention!
9.4
8.1
7.4

Add a comment

    • smilesmilesxaxaokdontknowyahoonea
      bossscratchfoolyesyes-yesaggressivesecret
      sorrydancedance2dance3pardonhelpdrinks
      stopfriendsgoodgoodgoodwhistleswoontongue
      smokeclappingcraydeclarederisivedon-t_mentiondownload
      heatirefullaugh1mdameetingmoskingnegative
      not_ipopcornpunishreadscarescaressearch
      tauntthank_youthisto_clueumnikacuteagree
      badbeeeblack_eyeblum3blushboastboredom
      censoredpleasantrysecret2threatenvictoryyusun_bespectacled
      shokrespektlolprevedwelcomekrutoyya_za
      ya_dobryihelperne_huliganne_othodifludbanclose

We advise you to read:

Hand it for the smartphone ...