Control a Servo with a Force Resistive Sensor on Arduino © GPL3+

The force resistive sensor outputs the applied force to the Arduino, and we move the servo according to the amount of force.

  • 15,856 views
  • 8 comments
  • 25 respects

Components and supplies

Apps and online services

About this project

Introduction

A force resistive sensor changes its resistance based on the physical pressure or weight placed on it. We are using them in conjunction with an Arduino to rotate a servo according to the amount of pressure. It uses the following formula to calculate the output voltage:

Vo = Vcc ( R/(R+FSR) )

Making

Make all the connections and upload the code to the Arduino. After applying force to the sensor you will notice the values in the serial monitor.

Code

Arduino codeC/C++
 #include <Servo.h>
 Servo servo;
 int reading;   
 
void setup(void) {
 Serial.begin(9600);   
 servo.attach(9); //servo at digital pin 9
 servo.write(0); //initial point for servo

}
 
void loop(void) {
  reading = analogRead(A0); //attached to analog 0
  Serial.print("Sensor value = ");
  Serial.println(reading);
 
int value = map(reading, 0, 1023, 0, 255);

  servo.write(value);
 
  delay(100);
}

Schematics

Circuit diagram
6dc39afpjfrbtsvtjtko

Comments

Author

Default
Muhammad Anas
  • 3 projects
  • 35 followers

Additional contributors

  • Viscous.co 3D printing pakistan

Published on

December 22, 2016

Members who respect this project

DefaultPhotoScreen shot 2017 04 25 at 9 49 37 pm uwxhdcejvmDefaultEuDefaultDefaultPhoto

and 18 others

See similar projects
you might like

Similar projects you might like

Servo Control with TV Remote Control

Project showcase by eldo85

  • 13,026 views
  • 6 comments
  • 35 respects

Temperature Sensor To control Servo Motor

by Jasleen

  • 16,096 views
  • 3 comments
  • 18 respects

Servo Control Panel

Project tutorial by dancili

  • 2,413 views
  • 2 comments
  • 7 respects

Use a PC Fan as a Sensor

by Daniel Porrey

  • 59,375 views
  • 24 comments
  • 115 respects
Add projectSign up / Login