Enter the world of robotics with Grab-it – Part 2

Enter the world of robotics with Grab-it – Part 2

With the Grab-it robot arm from JOY-IT, hobbyists, school pupils, and students can gain their first experience of Python programming and complete simple projects using the Raspberry Pi or Arduino.

The first part of this article focused on assembling the robot arm, calibrating the servo motors and programming the robot arm’s initial movements. This second part provides developers with short examples and ideas for extensions that allow them to make even better use of Grab-it.

Creative projects & applications

Required hardware:

Recommended additional accessories:

Creative project – stacking components

For the first creative project, program the robot arm to grasp the building blocks, which were manufactured using a 3D printer, and stack them in the provided box (figure 1).

An interesting first project is stacking components with the Grab-it (figure 1).
An interesting first project is stacking components with the Grab-it (figure 1).

To do this, the following steps must first be carried out, as shown in Part 1:

  • Set up the Raspberry Pi with Moto Pi, or alternatively an Arduino Uno with Motorino, and connect it to the robot arm
  • Install the Raspberry Pi OS
  • Add the required libraries and calibrate the servo motors

The programme for stacking components can then be run on the Raspberry Pi.

The programme for stacking the components (figure 2).
The programme for stacking the components (figure 2).

Below is an excerpt from the code that makes Grab-it perform movements via the Raspberry Pi in conjunction with the Moto Pi.

Grab-it goes IoT

Control via web interface and app

The next step is to prepare the Grab-it for the Internet of Things (IoT). Similar to a smart home, the robot arm will be controlled via a web interface. The popular Flask web server acts as an interface between the HTML interface and the motor control. This allows the robot arm to be conveniently operated via the web interface.

As well as PC control, HTML control also works via an app and smartphone. When used with a Raspberry Pi, the Grab-it can easily be controlled via a smartphone. The idea behind this is as follows:

  • The Raspberry Pi controls the Grab-it via the PCA9685 servo driver. The PCA9685 is a component that can control up to 16 servo motors simultaneously using only two cables from the Raspberry Pi because it generates the required PWM signals itself, thus relieving the Pi.
  • A Flask web server runs on the Raspberry Pi. This is a lightweight web framework for Python that can be used to quickly create simple web applications or interfaces that enable devices such as the Grab-it to be controlled via a browser.
  • The arm can be conveniently controlled via a browser interface (on a PC or smartphone).

First, the system must be prepared for installation. Then, the servo control is implemented in Python, and the Flask web server and HTML interface are created.

1. Prepare the system:

  • Activate I2C:
  • Install the SMBus driver packages:
  • Check whether the PCA9685 has been found:

2. Prepare servo control:

3. Create Flask web server:

The Flask web server is created (figure 3).
The Flask web server is created (figure 3).

4. Create the HTML web interface:

This code is used to create the web interface (figure 4).
This code is used to create the web interface (figure 4).

5. JavaScript is also stored:

  • The JavaScript activates the button functions (figure 5).
Button functions are activated via JavaScript (figure 5).
Button functions are activated via JavaScript (figure 5).
Example view of the web interface for controlling the Grab-it (figure 6).
Example view of the web interface for controlling the Grab-it (figure 6).

You can also choose whether to start the Flask app manually or with Autostart. This is not specified in the code, but in the Raspberry Pi system.

1. Manual start:

2. Autostart:

Control via Xbox Controller

As well as controlling the robot arm via a smartphone or PC, it is also possible to operate it with a joystick or controller. An Xbox controller was connected to the Raspberry Pi via a USB interface. The arm can then be conveniently controlled via the controller using the Flask server that is already installed.

  1. Install the Xbox controller using the following command: sudo apt install python3-evdev.
  2. Install the Python script: XboxController.py (figure 7).

This allows the Grab-it to be quickly and easily moved to any desired position using the controller.

The arm can also be controlled via an Xbox controller and the USB interface (figure 7).
The arm can also be controlled via an Xbox controller and the USB interface (figure 7).

The following code excerpt shows how to activate the Xbox controller:

Extensions & modifications

If you want to get even more out of your Grab-it, you can significantly improve the robot arm with targeted mechanical and software optimisations.

Mechanical upgrades for the Grab-it from JOY-IT

The Grab-it robot arm can be adapted and optimised with simple mechanical upgrades. Particularly effective upgrades include gripper attachments, extended arms and camera holders, which can be produced with a 3D printer.

Different gripper shapes, such as rubberised tips for round objects or wide jaws for flat parts, improve versatility and precision when gripping. However, extended arm segments increase the working radius and should therefore be supported by more stable servos or lightweight materials, such as carbon, to prevent vibrations.

Mounting a camera above the gripper enables AI vision or colour recognition via OpenCV. To improve stability, replace wobbly plastic connections with metal joints or ball bearings. To connect a camera to the Grab-it, use this code to check the camera is correctly integrated, and then use it for colour or object recognition:

The servo mount can be reinforced or dampened to minimise vibrations. These modifications make the Grab-it more precise, stable and versatile, making it perfect for ambitious maker projects.

Software Upgrades for the Grab-it – More Intelligence with OpenCV

Targeted software upgrades make the Grab-it robot arm from JOY-IT significantly smarter and more autonomous. Integrating OpenCV is particularly effective for implementing colour, shape or object recognition using a USB or Raspberry Pi camera.

Simple OpenCV functions enable the robot to analyse live video data, filter colour ranges and determine the positions of objects. When combined with a servo driver, for instance, the robot can automatically approach and grasp recognised objects. Simple filters suffice for colour recognition, while contour recognition or AI-based models such as TensorFlow Lite deliver more precise results.

Example (object recognition with OpenCV):

Another upgrade is the addition of motion profiles that react flexibly based on camera data. Additionally, an API or Flask web interface can be used to accept commands from web or smartphone applications. These software enhancements make Grab-it an adaptive system that actively ‘perceives’ and reacts to tasks.

Community & resources

Although there are only a few dedicated projects on GitHub, the maker community surrounding the JOY-IT Grab-it robot arm provides valuable resources. GitHub has a small selection of repositories, including sample sketches for integrating OpenCV or Flask web interfaces.

It is also worth taking a look at platforms such as Thingiverse or MyMiniFactory for STL files for customised grippers or camera holders. Maker forums and DIY blogs, such as Reddit threads and Instagram stories, offer further insights and tips on topics such as improving the mechanics, fine-tuning the servos, and integrating a camera.

Although there is currently no large, central Grab-it community, you can find individual projects and tutorials by searching for keywords such as ‘JOY-IT Grab-it’. Use these resources as a starting point, adapt them to your setup and document your own development to become part of the growing community.

Grab-it in action and future prospects

The second part of the JOY-IT article on Grab-it shows how initial projects can be implemented using the robot arm. Grab-it has also been made ‘IoT-enabled’ and can be controlled via a controller, smartphone or PC.

As the community continues to grow, GitHub and other developer forums offer numerous projects, upgrades and other resources that can be used to expand Grab-it continuously, make it AI-capable and further develop it.

Bilder: Adobe Stock, reichelt elektronik


To the first part of the article:
Setup and Basics: Enter the world of robotics with Grab-it – Part 1

Leave a Reply

Your email address will not be published. Required fields are marked *