Table of Contents

How to Build a Quarky Advanced Line Follower Robot in PictoBlox

Quarky Advance Line Follower
Example Description
Learn how Grade 7 students can build an Advanced Line Follower Robot using Quarky and PictoBlox. This step-by-step tutorial introduces sensor calibration, PID control, checkpoint detection, and autonomous robot navigation using the Quarky Advanced Line Follower extension.

Introduction

In this project, we will create an Advanced Line Follower Robot using Quarky and PictoBlox. The robot will use the Quarky Advanced Line Follower extension to detect and follow a black line on a white surface.

The Advanced Line Follower sensor uses IR sensors to identify the difference between the black line and the background. Based on the sensor readings, Quarky makes real-time decisions to move forward, turn left, or turn right so that it stays on the track.

This project also introduces students to PID control, which helps the robot follow the line more smoothly and accurately. By adjusting PID values, threshold values, and speed parameters, students can understand how autonomous robots correct their path while moving.

By completing this activity, students will learn how sensors, logic, calibration, and control algorithms work together in real-world robotic navigation.

Prerequisites

Before starting the activity, make sure you have:

  • Quarky device, charged and powered on
  • PictoBlox installed on your computer
  • USB cable
  • Latest Quarky firmware uploaded through PictoBlox

Note: Use PictoBlox version 9.1.0 or later for better support with the Quarky Advanced Line Follower extension.

Connecting Quarky with PictoBlox and Updating Firmware

Before creating the line follower program, connect Quarky to PictoBlox and update the firmware. If Quarky is running on older firmware, the Advanced Line Follower extension may not work properly.

Updating Quarky Firmware

Before using the Quarky Connect extension, ensure that your Quarky is updated to the latest firmware version 6.0 If you are using an older Quarky firmware, this feature may not work, as Quarky Connect is supported only in the latest firmware.

Follow the steps below to upload the latest firmware: 

Step 1: Make sure PictoBlox is installed on your device.

Please make sure to use PictoBlox version 9.1.0 or later for Quarky Connect Extension support. Click Download PictoBlox to visit the download page, select your operating system, and follow the on-screen instructions to install the latest version.Download PictoBlox

Step 2: Open PictoBlox and select the Block Coding environment.

Select the Block Coding environment

Step 3: Connect your Quarky to your computer using a USB cable.

USB-Attach

Step 4: Click on the Board button from the toolbar and select Quarky.

Select the Quarky Board

Step 5: Select the appropriate Serial Port and click Connect.

COM Port

Step 6: In the upper right corner of the PictoBlox window, you will see the Upload Firmware button. Click, and a status window will open.

Step 7: Wait for the confirmation message on the screen.

confirmation message on the screen

Connect Quarky Using USB or Bluetooth

Step 1: To connect your Quarky board, select the appropriate Serial Port (USB) or Bluetooth port from the list, find your device, and click on Connect.Click on connect button to connect Quarky

Step 2: Quarky is now successfully connected to PictoBlox. The status will change to Connected.

Step 3: Click on Go Editor to launch the coding environment and start programming with your Quarky board.
successfully connected, the status will change to Connected

Adding the Quarky Advanced Line Follower Extension

After Quarky is connected successfully, add the required extension.

Follow these steps:

  1. Click on the Add Extension button and search for Quarky Advanced Line Follower.
  2. Select and add the extension.
    Quarky Advance Line Follower extension addition
  3. The Advanced Line Follower blocks will now appear in the blocks palette.

You are now ready to create the line follower program.

Step-by-Step Block Coding Guide

Now, create the program to make Quarky follow the black line, detect checkpoints, and turn left after reaching the third checkpoint.

Start the Program

  1. Add the ‘when green flag clicked’ block from the Events palette. This block starts the program when the Green Flag is clicked.
  2. From the Quarky Advanced Line Follower palette, add the ‘initialize two iR advanced line follower’ block. This block activates and prepares both IR sensors for line detection.
    Initialize the Advanced Line Follower

Note: Always use this block before using any other Advanced Line Follower blocks.

Set the Turn Speed

  1. Add the ‘set turn speed to 50’ block from the Advanced Line Follower palette.
  2. This controls how strongly the robot turns while correcting its path.

Set the Turn Speed

This value helps the robot make smooth and stable turns.

Enable LED Feedback

  1. Add the ‘set line follower LED feedback ON’ block.
  2. When LED feedback is ON, the sensor LEDs turn on when the line follower detects the line. This helps during testing and calibration.
  3. When LED feedback is OFF, the LEDs remain off, which can help save power or reduce light interference in some situations.

Set the Left IR Sensor Threshold

  1. Add the ‘set Left IR sensor threshold to 750’ block. This threshold helps the left sensor identify the difference between the black line and the white background.

Value Used:
Left IR Sensor Threshold = 750

Set the Right IR Sensor Threshold

  1. Add the ‘set right IR sensor threshold to 710′ block. This threshold helps the right sensor detect the line accurately.

Set the Right IR Sensor Threshold

Configure PID Constants

Add the ‘set PID Kp 10, Ki 0.01, Kd 0.2′ block. PID control helps the robot adjust its motor speeds continuously so that it remains centered on the line.

Parameter Value Function
Kp 10 Corrects the present error
Ki 0.01 Corrects accumulated error
Kd 0.2 Reduces oscillations and predicts future error

These values help Quarky follow the line smoothly and avoid unstable movement.

Configure PID Speed Parameters

  1. Add the ‘set PID speed parameter base 40, min 0, max 80’ block. This block sets the speed range for the robot while it follows the line.

Values Used:

Parameter Value
Base Speed 40
Minimum Speed 0
Maximum Speed 80

Configure PID Speed Parameters

The robot automatically adjusts motor speeds within this range while following the line.

Start Line Following Until Checkpoints Are Detected

  1. Add the ‘do line following until 3 checkpoint detected’ block. The robot will start following the black line and continue until it detects three checkpoints on the track.

Turn Off LED Feedback

  1. After the robot reaches the third checkpoint, add the ‘set line follower LED feedback off’ block. This turns off the sensor LEDs after checkpoint detection is complete.

Start Line Following Until Checkpoints Are Detected

  1. Add the ‘set forward coast delay to 140 ms’ block. This makes the robot move forward for a short duration before turning. This helps the robot position itself properly at the intersection before making the turn.
  2. Add the ‘turn robot left to next line’ block. The robot will turn left and align itself with the next available line.

Configure PID Constants

Output

After running the program, Quarky should follow the black line smoothly and accurately.

You should observe the following:

Quarky should follow the black line smoothly

  • Quarky detects the black line using the Advanced Line Follower sensor.
  • The robot follows the line automatically.
  • It adjusts movement using PID control.
  • It detects checkpoints on the track.
  • After detecting the third checkpoint, it moves forward briefly.
  • Quarky turns left and aligns with the next line.

If Quarky follows the black line properly and turns left after the third checkpoint, your project is complete.