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.

  • 8,965 views
  • 3 comments
  • 17 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

Similar projects you might like

Servo Control with TV Remote Control

Project showcase by eldo85

  • 5,591 views
  • 5 comments
  • 17 respects

Temperature Sensor To control Servo Motor

by Jasleen

  • 7,808 views
  • 2 comments
  • 10 respects

Servo Control Panel

Project tutorial by dancili

  • 1,448 views
  • 2 comments
  • 6 respects
Add projectSign up / Login