LOGIN
John Rodrigues
97
Community Expert
Product Designer|Entrepreneur |Founder of designwithjohn.com (Project Leader)
 · HonnavarIndia
Share
Report
Get Link
TASK
Open
Reward › Contribution Review
Assigned to
Carlton Rodrigues
Suraj Parasuram
Samuel Patole

Gripper with a sensor

Hey Guys I want the gripper open up when it detects hand in front of it
Can anyone help me write a code for arduino ?

I’m having a ultrasonic sensor and micro servo

5 likes 
Like
Award Contribution
Student
 · MangaluruIndia
Share
Report
Get Link

I Can Help out with that.

Applicant
Like
0 like 
Award Contribution
Suraj Parasuram
10
Top Contributor
Roboticist.
 · ChennaiIndia
Share
Report
Get Link

I too can help with this.

Applicant
Like
0 like 
Award Contribution
engineer
 · AurangabadIndia
Share
Report
Get Link

me too can

Applicant
Like
0 like 
Award Contribution
Jibin Lukose
22
Community Expert
Student / Entrepreneur
 · ThrissurIndia
Share
Report
Get Link

I have completed the coding. Did trial with ultrasonic sensor and micro servo. I can help out

Applicant
Like
0 like 
Award Contribution
Jibin Lukose
22
Community Expert
Student / Entrepreneur
 · ThrissurIndia
Share
Report
Get Link

Sharing the code

#include <Servo.h>
Servo myservo;
int pos=10;

const int trigPin = 6;
const int echoPin = 7;
// defines variables
long duration;
int distance;
void setup() {
myservo.attach(9);
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
Serial.begin(9600); // Starts the serial communication
}
void loop() {
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance= duration*0.034/2;
// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);

if(distance<10){
myservo.write(150);
}
else{
myservo.write(10);
}

}

John Rodrigues

Like
0 like 
Award Contribution
JOIN TASK
LEAVE A REPLY
DISCOVER
CHAT
HIRE
ACTIVITY
FEED
Chat with us!
Help
Write something before you submit it!
Photo updated
Request Sent!
Updated
Copied to Clipboard