Connect the AI vision camera and explore what it can see!
How cameras "see" and process images
Pre-trained algorithms for object detection
Connecting cameras to robots via I2C protocol
Sending visual information between devices
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! ๐
Take out the HuskyLens from its box. You should see:
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.
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:
Most pre-made cables are keyed (can only plug in one way), so it should be foolproof!
By default, HuskyLens might be in UART mode. We need to switch it to I2C so the micro:bit can talk to it:
Open MakeCode and create a new project. We need to add the HuskyLens library:
Let's verify the micro:bit can "see" the HuskyLens data:
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!
The HuskyLens has multiple AI algorithms built-in. Let's explore each one:
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.)
The HuskyLens is actually a complete mini-computer! It has:
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! ๐ค๐ฑ
Computer vision needs good, even lighting. Avoid backlighting (bright window behind objects). Indoor ceiling lights work great!
For face detection: 1-3 feet away. For small objects: 6-12 inches. Too close = blurry, too far = too small to detect.
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!
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.
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 ๐ โ