Simple Homemade Flex Sensor

Simple Homemade Flex Sensor © GPL3+

This project shows you how to make a homemade flex sensor.

  • 6,226 views
  • 1 comment
  • 11 respects

Components and supplies

Apps and online services

About this project

Introduction

This project shows you to make a homemade flex sensor and control servos with it. My homemade flex sensor.

Step 1

Lets make it. Take 13cm of 2 thick paper.

And also cut a 12 cm of 2 foil paper. Paste it together and paste to the other thick paper.

Step 2

Now take a 13cm paper. And rub it with a pencil:

Stick the two thick paper together.

REMEMBER: Keep the paper inside the two thick papers. Don't touch the foil papers with each other.

Step 3

Give one jumper wire to the foil paper and again to the other one.

Connect to the breadboard.

Code

#include <Servo.h> 
Servo servo1; 
const int flexpin = A0; 
void setup () 
{ 
 Serial.begin(115200); 
 servo1.attach(9); 
} 
void loop () 
{ 
 int flexposition; 
 int servoposition; 
 flexposition = analogRead(flexpin); 
 servoposition = map(flexposition, 1020, 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); 
} 

Upload it. Enjoy.

Code

code for controlling servo with flex sensorArduino
#include <Servo.h>

Servo servo1;
const int flexpin = 0;

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



void loop ()
{
  int flexposition;
  int servoposition;
  flexposition = analogRead(flexpin);
  servoposition = map(flexposition, 1020, 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);
}

Schematics

circuit diagram
Arduino circuit 09 02 01 pwnvnq9pqn

Comments

Similar projects you might like

Simple Obstacle Sensor with Arduino

Project tutorial by muhammed shameel k.v

  • 3,307 views
  • 2 comments
  • 7 respects

Simple Programmable Robotic Arm

Project showcase by Ryan Chan

  • 49,033 views
  • 63 comments
  • 145 respects

DHT11 Temperature/Humidity Sensor

Project tutorial by Zachary Haslam

  • 13,134 views
  • 1 comment
  • 30 respects

Complete Digital Clock Including Alarm and Motion Sensor

Project tutorial by LAGSILVA

  • 12,677 views
  • 11 comments
  • 50 respects

Arduino Temperature - Humidity - Rain Sensor

Project showcase by Rick_Findus

  • 7,412 views
  • 6 comments
  • 13 respects

Arduino Simple "Camera Slider" Electronics

Project tutorial by Ian Cumming

  • 5,758 views
  • 3 comments
  • 15 respects
Add projectSign up / Login