FLEX SENSOR CONTROLLED SERVO MOTOR

by linganiveth in Circuits > Arduino

6026 Views, 5 Favorites, 0 Comments

FLEX SENSOR CONTROLLED SERVO MOTOR

Snip - Circuit design FLEX CONTROLLED SERVO Tinkercad - Google Chrome #1.png

Hey Guys!

In this tutorial we will get to know how to interface Arduino UNO with flex sensor and a simple servo motor in an online simulation platform.

Also we will look into the circuit of flex sensor controlled servo motor and the code used.

That is it illustrates how the angular position of servo motor can be controlled with the help of flex sensor. It controls the angular position of the motor as per bending of flex sensor – means more the sensor is bent more the angle at motor rotates and vice versa.

HAPPY LEARNING !

Supplies

  1. Arduino Uno R3
  2. Positional Micro Servo
  3. 10 kΩ Resistor
  4. Flex Sensor
  5. Breadboard small

Know the Components Used !

Arduino Uno R3 : Arduino Uno is a microcontroller board based on the ATmega328P (datasheet).

Positional Micro Servo : A motor whose position can be controlled using a microcontroller like an Arduino.

Flex sensor : Flex senor is a such type of sensor which measures the amount of bending or defection.

Resistor : Restricts the flow of electricity in a circuit, reducing the voltage and current as a result.

Breadboard : A breadboard is a rectangular plastic board with a bunch of tiny holes in it. These holes let you easily insert electronic components to prototype (meaning to build and test an early version of) an electronic circuit, like this one with a battery, switch, resistor, and an LED (light-emitting diode).

Set It Up !

1.PNG

In the TINKERCAD software you may simulate any circuit of your own.

For setting up the circuit choose the components needed from the search box.

After choosing and placing the components on the working space, then set the value of the resistor accordingly.

For making the circuit clear and precise we could annotate them by naming each components.

If you are new to the software click here to learn the basics of using Tinkercad Circuits.

Connect It !

PIC.png

Micro servo and Arduino :

•Green wire connected between Arduino Uno R3 – D11 port and Micro Servo- Signal.

•Red wire connected between power port in Micro Servo and 5v port in Arduino Uno R3.

•Blue wire connected between GND in Arduino Uno R3 and Ground port in Micro Servo.

Flex sensor and Arduino :

•Red wire is connected to Flex sensor with a resistor and 5v port in Arduino.

•Blue wire is connected to Flex sensor and GND in Arduino .

Code and Simulate It !

Snip #2.png

To simulate the circuit formed according to the user's will, it must be coded accordingly!

As I am using the TINKERCAD software, I code it accordingly.

The code can be modified according to the user's need. For an example, I have set the delay time as 80 seconds but we could alter the value accordingly.

FIND MY CODE AS AN ATTACHMENT !

Know the Working Principles !

Flex-Sensor-bending-conditions.jpg
Capture.PNG
Capture123.PNG

FLEX SENSOR :

  • A flex sensor or bend sensor is a sensor that measures the amount of deflection or bending. Usually, the sensor is stuck to the surface, and resistance of sensor element is varied by bending the surface.

SERVO MOTOR :

  • Servo motor is a simple DC or AC motor which is controlled for specific angular rotation with the help of additional servomechanism (a typical closed loop feedback control system).

SUMMARY

FLEX SENSOR CONTROLLED SERVO MOTOR (ARDUINO INTERFACED)

Now we will take a look into the circuit operation.

• When flex sensor is straight its resistance is low. It gives corresponding analog voltage input to pin A0.

•The Arduino will convert this analog voltage into a digital value and depending upon it, it will generate PWM signal on analog output pin 11 to rotate the servo motor to desire angle.

• The actual angular position of the motor is read and displayed on serial monitor continuously after every second. The flex sensor bending value is also displayed on the serial monitor.

• As flex sensor is bent slowly its resistance will increase. So the analog voltage input at pin A0 will increase.

• The corresponding digital value will also increase and this will increase the width of output pulse at pin 11 to increase rotation angle of the servo motor.

• The servo motor rotation angle increases that is displayed on the serial monitor along with flex sensor bending value.

• When flex sensor is completely bent its resistance will be maximum and it gives max analog input. Its corresponding digital value is displayed on the serial monitor.

• The servo motor attains max angle that is 180 degrees.

• Again when flex sensor bending is slowly released its resistance decreases – analog input decreases – analog output pulse decreases – motor angle decreases (motor rotates reversely).

• The flex sensor min and max bending values are calibrated and mapped to min and max servo motor rotation angle as 0 degree to 180 degrees.

• So when flex sensor is at rest (not bent) the motor angle is 0 degree and when flex sensor is fully bent the motor angle is 180 degrees.

Have a look at the video for a clear perception. By doing above your motor should rotate proportionally to the bending of the sensor.

NOW YOU ARE DONE WITH IT !

HAPPY LEARNING GUYS !