Introduction: Grip Sensor
int led1 = 8;
led2 = 9;
int led3 = 10;
int led4 = 11;
int FSRanalogpin = 0;
int value;
int fsrReading;
void setup(void) {
Serial.begin(9600);
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
}
void loop(void){
value = analogRead(FSRanalogpin);
value = map(value, 0, 1023, 0, 500);
Serial.print("Analog reading = ");
Serial.println(value);
if (value < 10) {
digitalWrite(led1, LOW);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
} else if (value < 50 ) {
digitalWrite(led1, HIGH);
digitalWrite(led2, LOW);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
} else if (value < 95) {
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, LOW);
digitalWrite(led4, LOW);
} else if (value < 110) {
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, LOW);
} else {
digitalWrite(led1, HIGH);
digitalWrite(led2, HIGH);
digitalWrite(led3, HIGH);
digitalWrite(led4, HIGH);
}
delay(100); //Delay of 100 milliseconds
}
(instructions coming soon - still drafting it up)
Supplies
x1 Arduino nano
x1 FSR
a bunch of M-M / M-F jumper wires
x4 LEDs
x2 mini circuit boards
x2 330 ohm resistor
Comments
4 years ago
Hello there!
We're glad you want to share something with the Instructables community!
And we’re here to help you out.
In order to be published live on the site and be eligible to enter a contest, an Instructable must consist of the following things:
- Multiple written steps showing how you made your project
- Photos in each step
- Only your own original images
Check out our free online class that walks you through how to write an Instructable: https://www.instructables.com/class/How-to-Write-an-Instructable-Class/
Beyond making your Instructable simply publishable, this guide (https://www.instructables.com/id/How-to-Create-a-Feature-Worthy-Instructable/) explains what is required to have your Instructables featured by our site editors. It’s very helpful, and definitely worth checking out.
We would love to review your project again after you have made the necessary edits, and we will publish your project if it is eligible.
If you have any questions, please feel free to ask right here or send us an email to service@instructables.com.
Best,
Instructables Community Manager