โ† Back to Missions
MEDIUM โ€ข 50 MINUTES

Mission 6: First Look ๐Ÿ‘๏ธ

Connect the AI vision camera and explore what it can see!

๐Ÿ‘๏ธ

๐ŸŽฏ What You'll Learn

๐Ÿ“ท Computer Vision

How cameras "see" and process images

๐Ÿค– AI Models

Pre-trained algorithms for object detection

๐Ÿ”Œ Hardware Integration

Connecting cameras to robots via I2C protocol

๐Ÿ“Š Data Communication

Sending visual information between devices

๐Ÿ“ฆ What You Need

โœจ This Changes Everything!

Up until now, the robot could sense distance and follow linesโ€”but it couldn't actually see. The HuskyLens is a game-changer: it has a camera, an AI processor, and can recognize faces, objects, colors, and even learn new things!

This is the same technology in self-driving cars, security cameras, and phone face unlock. Let's explore what this tiny AI computer can do! ๐Ÿš€

๐Ÿ› ๏ธ Let's Connect the Eyes!

1

Unbox the HuskyLens

Take out the HuskyLens from its box. You should see:

  • โ€ข The main camera unit (with a screen on it!)
  • โ€ข A 4-pin cable (red, black, blue, green wires)
  • โ€ข USB cable for firmware updates
  • โ€ข Mounting bracket (optional)
๐Ÿ’ก Cool Feature: The HuskyLens has its own LCD screen! You can see what the camera sees in real-timeโ€”no computer needed for testing!
2

Power It Up (Standalone Test)

Before connecting to the robot, let's test it independently. Use the USB cable to connect the HuskyLens to a USB power source (computer, phone charger, or power bank).

The screen should light up! You'll see a live camera view. Try pointing it at different objects, faces, or colors.

Screen Button Functions:

  • โ€ข Function button (left): Switch between detection modes
  • โ€ข Learning button (right): Train the AI on new objects
  • โ€ข Dial (center): Navigate menus and settings
๐ŸŽฎ Explore! Press the function button to cycle through modes: Face Recognition, Object Tracking, Line Following, Color Recognition, Tag Recognition, and more!
3

Connect to the Maqueen

Now let's wire it to the robot! Find the 4-pin port on the Maqueen labeled "I2C" or "HuskyLens". Connect the 4-pin cable:

Wire Color Guide:

  • โ€ข Red: Power (+5V)
  • โ€ข Black: Ground (GND)
  • โ€ข Green: Data (SDA - I2C)
  • โ€ข Blue: Clock (SCL - I2C)

Most pre-made cables are keyed (can only plug in one way), so it should be foolproof!

โšก Safety Check: Make sure the Maqueen is OFF when connecting cables. Once connected, turn on the Maqueenโ€”the HuskyLens should power up automatically!
4

Set HuskyLens to I2C Mode

By default, HuskyLens might be in UART mode. We need to switch it to I2C so the micro:bit can talk to it:

1. On the HuskyLens screen, press and hold the Function button
2. Turn the dial to navigate to "General Settings"
3. Find "Protocol" setting
4. Change from "UART" to "I2C"
5. Save and exit
๐Ÿ”„ What's I2C? It's a communication protocol that lets multiple devices talk on the same wire pair. Like a phone conversation where everyone can speak and listen!
5

Add HuskyLens Extension to MakeCode

Open MakeCode and create a new project. We need to add the HuskyLens library:

1. Click "Extensions" (bottom of block menu)
2. Search for "HuskyLens"
3. Click on the official DFRobot HuskyLens extension
4. Wait for it to loadโ€”new purple blocks will appear!
๐Ÿ“š Library Added! You now have access to all HuskyLens AI functions!
6

First Communication Test

Let's verify the micro:bit can "see" the HuskyLens data:

On Start:
  HuskyLens Initialize I2C
  Show Icon โœ“

Forever:
  HuskyLens Request
  If [HuskyLens is Learned]:
    Show Icon โ™ฅ
  Else:
    Show Icon โ€ข
  Pause 500ms

Upload this code. The micro:bit should show a checkmark, then dots. When the HuskyLens recognizes something it learned, the micro:bit shows a heart!

๐ŸŽ‰ Connection Successful! The robot can now read vision data from the camera!
7

Explore Detection Modes

The HuskyLens has multiple AI algorithms built-in. Let's explore each one:

Available Modes:

  • โ€ข Face Recognition: Detects and identifies faces (can learn who's who!)
  • โ€ข Object Tracking: Follows a specific object you train it on
  • โ€ข Object Classification: Recognizes 20+ pre-trained objects (ball, car, person, etc.)
  • โ€ข Line Tracking: Finds lines and arrows on surfaces
  • โ€ข Color Recognition: Detects and tracks specific colors
  • โ€ข Tag Recognition: Reads AprilTag markers (like QR codes)

Use the Function button on the HuskyLens to cycle through modes. The screen shows the current mode at the top (face icon, color wheel, tag symbol, etc.)

๐Ÿ”ฌ What's Happening Behind the Scenes?

The HuskyLens is actually a complete mini-computer! It has:

  • โ€ข Camera sensor: Captures 30 frames per second
  • โ€ข Kendryte K210 processor: A dual-core AI chip designed for computer vision
  • โ€ข Neural networks: Pre-trained models that run locally (no internet needed!)
  • โ€ข LCD screen: Shows what it sees and detected objects

When you point it at a face, the AI analyzes the image pixel-by-pixel, looking for patterns that match "face features" (eyes, nose, mouth proportions). It does this 30 times every second!

Real-World Connection: This is exactly how Face ID on phones works, how Tesla Autopilot sees pedestrians, and how security cameras detect intruders. Your nephews are using the same AI that runs billion-dollar companies! ๐Ÿค–๐Ÿ“ฑ

๐Ÿ’ก Tips for Best Results

โ˜€๏ธ Lighting Matters!

Computer vision needs good, even lighting. Avoid backlighting (bright window behind objects). Indoor ceiling lights work great!

๐Ÿ“ Distance Sweet Spot

For face detection: 1-3 feet away. For small objects: 6-12 inches. Too close = blurry, too far = too small to detect.

๐ŸŽฏ Contrasting Backgrounds

AI works best when objects stand out from the background. A red ball on a white table is easier to detect than a red ball on an orange carpet!

๐Ÿ”„ Be Patient

The first detection might take a second. Once it locks on, tracking is super fast! Give it time to "learn" what you're showing it.

โœ… Mission Success Checklist

๐Ÿš€ Ready to Teach the Robot?

Amazing! The robot now has EYES and AI vision! The boys have learned about computer vision, neural networks, and hardware communication protocols. This is cutting-edge technology that runs on billions of devices!

Next up: We'll teach the HuskyLens to recognize their faces! The robot will learn who they are and greet them by name. This is where the magic really happens! ๐Ÿ˜Š

Next Mission: Face Recognition ๐Ÿ˜Š โ†’
โ† Back to All Missions