Introduction: Automatic Gripping Using a Laser Sensor and Voice Commands
Grasping objects which seem to us simple and natural thing to do is in fact a complex task. Man uses the sense of sight to determine the distance from the object that he wants to grab. The hand automatically opens when it is in close proximity to the object being gripped and then it closes quickly to grip the object well. I've used this technique in a simplified way in this mini project, but instead of the camera I used a laser sensor to estimate the distance of the object from the gripper and voice commands for control.
Step 1: The List of Parts
In this small project you will only need a few of the parts listed below. As a controller I used Arduino mega 2560 but you can also use UNO or any other Arduino. As distance sensor I used a VL53L0X laser sensor which has good accuracy (about a few milimeters) and range up to 2 meters. In this project you can use for testing any gripper and servo but you should power it from a separate power source, e.g.: a 5V power supply or a LiPo battery (7.4V or 11.1V) through a step-down converter that reduces the voltage to 5V.
Parts needed in this project:
- VL53L0X Laser ToF Sensor x1
- Digital Servo x1
- Arduino mega 2560 x1
- Robot metal gripper x1
- Breadboard x1
- Tactile Push Button x1
- Bluetooth HC-06
- Resistor 10k x1
- Power supply 5V/2A
Step 2: Connection of Electronic Parts
The first figure shows all the necessary connections. On the following photos you can see the next steps of connecting of individual modules. At the beginning, the push button was connected to pin 2 of Arduino, then servo to pin 3 and finally the VL53L0X laser distance sensor via I2C bus (SDA, SCL).
The connections of electronic modules are the following:
VL53L0X Laser Sensor -> Arduino Mega 2560
- SDA - SDA
- SCL - SCL
- VCC - 5V
- GND - GND
Servo -> Arduino Mega 2560
- Signal (orange wire) - 3
Servo -> 5V/2A Power Supply
- GND (brown wire) - GND
- VCC (red wire) - 5V
Push Button -> Arduino Mega 2560
- Pin 1 - 3.3 or 5V
- Pin 2 - 2 (and through the 10k resistor to ground)
Bluetooth (HC-06) -> Arduino Mega 2560
- TXD - TX1 (19)
- RXD - RX1 (18)
- VCC - 5V
- GND - GND
Step 3: Arduino Mega Code
I've prepared the following sample Arduino programs available at my GitHub:
The first program named "VL53L0X_gripper_control" accomplishes the task of automatic gripping of an object that has been detected by the VL53L0X laser sensor. Before compiling and uploading the sample program, make sure that you have chosen "Arduino Mega 2560" as the target platform as shown above (Arduino IDE -> Tools -> Board -> Arduino Mega or Mega 2560). The Arduino program checks in the main loop - "void loop()" whether the new reading from laser sensor has come (function readRangeContinuousMillimeters()). If the distance read from the sensor "distance_mm" is greater than the value "THRESHOLD_CLOSING_DISTANCE_FAR" or less than "THRESHOLD_CLOSING_DISTANCE_NEAR" then the servo begins to close. In other cases, it begins to open. In the next part of the program, in the function "digitalRead(gripperOpenButtonPin)", the state of the push button is constantly controlled and if it is pressed, the gripper will open in spite of it is closed due to the proximity of the object (distance_mm is less than THRESHOLD_CLOSING_DISTANCE_NEAR).
The second program "Voice_VL53L0X_gripper_control" allows you to control the gripper using voice commands. The voice commands are processed by the BT Voice Control for Arduino app from Google Play and further sent via bluetooth to Arduino. The Arduino program checks in the main loop - "void loop()" whether the new command (character) has been sent from Android app via bluetooth. If there is any incoming character from bluetooth serial the program read the serial data until it encounters the end of the voice instruction "#". Then it starts execution of "void processInput() " function and depending on the voice command a specific control function is called.
Step 4: Testing Automatic Gripping
The video from "Step 1" show tests of robot gripper based on program from the previous section "Arduino Mega Code". This video is showing how it automatically opens when the object is close to it and then grasps this object if it is within reach of the gripper. The feedback from the laser distance sensor used here is clearly visible in the further part of the video when I move the bottle forward and backward what causes a quick reaction and change of gripper control.
Step 5: Voice Activated Automatic Gripping
In the next step in the development of this project, I added voice control to it. Thanks to the voice command, I can control the closing, opening and speed of the gripper. Voice control in this case is very useful when opening the gripper holding the object. It replaces the button and allows easy control of the gripper placed on the mobile robot.
If you like this project do not forget to vote and write in the comment what would you like to see in the next post as a further improvement of this project :)
Check out my other projects related to robotics, just visit:
We have a be nice policy.
Please be positive and constructive.