In this tutorial we are going to test the finger sensor with the Arduino.

We have two options:

-Test with a code directly on the Arduino.

-Test with a python code in MyRobotLab.

 

First option:

-Upload this code to your Arduino board:

 

-Connect your sensor (illustrated by a FSR sensor) and your servo motor. Some servo draw too much Amp current to be directly powered by the Arduino. If your servo motor jitters or move erraticaly, plug an extra power source for your servo and make sure to ground the Arduino to that extra power source as shown below:

-When the power is applied, the finger will close slowly by itself, if the sensor detects a pressure it will display in the Arduino.exe monitor an information.

-You may need to change the values of the sensor in the code to reach a better adjustement.

For to do that, check  the results on the monitor and change these values directly in the code to your need:

 

 

Second option:

Here we assume you already have installed MyRobotLab and know a little bit how to use it, if not go first to this page.

-Launch MyRobotLab by double clicking the “myrobotlab.jar” from your MRL directory.

-Make the same connections between your Arduino and servo motor as the image in the first option tutorial.

-Copy and paste this python script to the python tab in MyRobotLab.

-When the power is applied, the finger will close slowly by itself, if the sensor detects a pressure it will display in the python monitor an information and will stop to close and say something related to the pressure he felt.

-You may need to change the values of the sensor in the code to reach a better adjustement.

For to do that, check  the results on the monitor and change these values directly in the code to your need: