The finger sensor can be used for various functions. Grabbing an egg or a bottle needs different pressures. Shaking a human hand needs also to detect the pressure applied. There is many ways to do touch sensors, I have done two versions, both are extremely low cost. The version with the hall sensor is much more accurate then the original foam version.

 

Summary :

  • ELECTRONIC (2 versions)
  • SETUP
  • UTILISATION

ELECTRONIC  WITH HALL SENSOR


-This version is done with a hall sensor and a magnet.

-When the magnet comes closer to the hall sensor, the value is measured by the sensor.

-The value is sent  to the analog Arduino pin.

-The assembly of the sensor on the finger is explained in the hand tutorial.


ELECTRONIC WITH FOAM SENSOR


-The original version of finger sensor was done with 2 copper plates connected to a piece of antistatic foam.

-When the foam is compressed, the current flows stronger between the 2 copper plates.

-The analog Arduino pin detects the variation.

-The assembly of the sensor on the finger is explained in the hand tutorial.


SETUP


Open InMoov/config/service_J_SensorFinger.config and setup like below.

[MAIN]

rightHandSensorActivated=True
rightHandSensorArduino=right

right_thumb_Psi_min=544Put here the max value when the sensor is NOT pressed
right_thumb_Psi_low=545In average cases take the min value and add +1 if using a AH3503 Hall Sensor
right_thumb_Psi_mid=547In average cases take the min value and add +4
right_thumb_Psi_max=550In average cases take the min value and add +7

right_index_Psi_min=538
right_index_Psi_low=539
right_index_Psi_mid=542
right_index_Psi_max=545

Add the values for each finger sensor…

To check if the finger sensors are worky and to see their values, you can type in the python window and execute:

sensorTimerStart()

And see the result in the python tab.

You can turn off the sensorTimer with:

sensorTimerStop()


UTILISATION


We have three options:

1-If you have set the sensor config file, some gestures will automatically use the sensors.

2-Test with a code directly on the Arduino.

3-Test with a python code in MyRobotLab.(if you are not running START_INMOOV)

First option:

The gesture shakehands() will automatically use the sensors when the hand closes itself.

You can adjust the desired pressure for a gesture between 0 to 3. When the sensor reach the desired pressure the finger servo stops its position and disables.

Second 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: