Robot communication

Now let's make the two robots communicate so they can coordinate safely when entering a shared space (in our case, the ramp area).

Step 3: Physically connect the robots for communication

We will use the digital I/O ports located on the back panel of each robot.

To enable communication in both directions, connect the robots as follows:

  • DI1 of Robot A → DO1 of Robot B
  • DI1 of Robot B → DO1 of Robot A
  • GND of Robot A ↔ GND of Robot B (common ground is essential for proper signal transmission)

Step 4: Programming robot communication in Blockly

Now that the robots are wired, let's make them talk! The idea is simple: whenever a robot wants to access the shared zone, it sends a signal to notify the other robot, and waits until the zone is free before moving in.

Here's how it works:

  1. Before entering the shared zone, the robot sets DO1 to HIGH -> saying "I'm going in."
  2. Once finished, it sets DO1 back to LOW -> saying "The area is free now."

In Blockly, we use these two blocks to control the output:

Set digital output in Blockly

Next, we make sure the robot checks the signal from the other one before entering the shared zone:

  • If DI1 is HIGH, the other robot is using the area → wait.
  • If DI1 is LOW, the area is free → proceed.

Use this block to wait until the shared area becomes available:

Wait until DI is LOW in Blockly

Step 5: Updated programs with communication logic

Master robot program

At the start of the program, we set DO1 to LOW to indicate we are not in the shared area. Then, before entering, we wait until DI1 is LOW (area is free), send our "I’m entering" signal (DO1 HIGH), and finally perform the task.

We’ve also added the conveyor activation at the beginning of the program.

Slave robot program

The logic is the same on the second robot. Before entering the shared zone, the robot waits for DI1 to be LOW, then sets DO1 to HIGH, performs its action, and sets DO1 back to LOW once it’s done.

Slave robot Blockly program with communication

That’s it! Your robots can now coordinate safely and avoid collisions in shared zones using simple digital signals.