Table of Contents

How to Build an Intellio AprilTag Distance Alert in PictoBlox

Example Description
Learn how to build an onboard AprilTag Distance Alert system using Quarky Intellio in PictoBlox! In this project, Quarky Intellio uses its built-in camera to detect AprilTag ID 1, measures its real-time 3D distance from the camera, and triggers a green LED and sound alert whenever the tag comes within 20 cm.

Introduction

An AprilTag is a machine-readable visual marker featuring a black square border and a unique internal pattern that acts as a visual landmark for cameras and robots. Using the AprilTags Extension (Intellio Vision) in Upload Mode, Quarky Intellio performs image capture, processing, and tag detection directly on the board without needing a continuous connection to PictoBlox.

In this project, Quarky Intellio displays the live camera feed and bounding box on its TFT screen while continuously checking the distance (3D position z) of AprilTag ID 1:

  • When AprilTag ID 1 is detected at a distance of less than 20 cm, Quarky Intellio plays the Detected sound and lights up its LED in green.
  • When the tag is 20 cm or farther away, the LED switches to red.

Prerequisites

Step 1: Required Components

Before starting, make sure you have the following:

  • Quarky Intellio 3 Wheeled Robot.
  • Printed or displayed 16h5 AprilTag (ID 1)
  • USB Type-C cable for connecting Quarky Intellio to your computer
  • Computer/Laptop with the latest version of PictoBlox installed

Step 2: Select Quarky Intellio and Add the Extension in PictoBlox

  • Slide up the power switch to turn on Quarky Intellio.
  • Open PictoBlox on your computer and log in to your account.
  • Select the Block Coding environment.

  • Click on the Board tab in the top menu bar and select Quarky Intellio.

  • Connect Quarky Intellio to your computer via the USB cable, select the appropriate serial port, and switch to Upload Mode.

  • Click the Add Extension button in the bottom-left corner of the Blocks Palette.

  • Search for AprilTags (Inellio Vision) and add it to your project.

Step-by-Step Block Coding Guide

Step 1: Initialize the AprilTag Detector and TFT Display.

  1. Drag and drop when Quarky Intellio starts up that block onto the scripting area.
  2. Attach the initialize () apriltag & set camera resolution to () block and select 16h5 and 160×120.
  3. Add the set detection quality to () block and select balanced.
  4. Attach the turn () extra edge precision block and select on.
  5. Add the turn () camera feed on the tft display block and select on to view the live camera feed on the screen.
  6. Attach the show/hide tag box on the tft display block and select show so detected tags are highlighted with a bounding box.
  7. Add the set confidence threshold to () block and set the value to 80.

Step 2: Analyze Camera Feed and Check AprilTag Distance

  1. Attach a forever loop block from the Control palette.
  2. Inside the forever loop, add the analyse image from camera block.
  3. Add an if () then block and insert the get # of tags > 0 condition to confirm that at least one AprilTag is visible.
  4. Inside that condition, place a second if () then block with the condition id of tag index 0 = 1 to check if the detected tag is Tag ID 1.
  5. Inside the Tag ID condition, add an if () then else block:
    1. In the if condition, check if 3D position z (cm) of tag index 0 < 20.
    2. Inside the if branch, attach play sound Detected and set LED to green with brightness 30%.
    3. Inside the else branch, attach set LED to red with brightness 30%.

Final Code:

Step 3: Upload the Program to Quarky Intellio

Verify that Quarky Intellio is connected to PictoBlox via the serial port.

Click the Upload Code button in the top-right corner of the workspace.

Wait until the code finishes uploading—Quarky Intellio will automatically run the program standalone upon startup.

Output

Once uploaded, Quarky Intellio displays the live camera feed with a bounding box around any detected 16h5 AprilTag on its TFT screen. When you hold AprilTag ID 1 within 20 cm of the camera, Quarky Intellio plays the Detected sound and turns its onboard LED green; moving the tag farther than 20 cm turns the LED red.

Conclusion

In this project, we built a standalone AprilTag Distance Alert system using Quarky Intellio and PictoBlox. We configured onboard AprilTag detection, live TFT display visualization, and 3D depth (z-axis) tracking in Upload Mode. The project demonstrates how vision-based distance measurement can trigger real-time audio and LED feedback without a computer connection. You can expand this project by adding different alerts for multiple tag IDs or programming motor actions for autonomous docking.