micro:IO Extender- a micro:bit IO Expansion Board Wiki - DFRobot

Introduction

This IO Extender is an easy-to-use and low-cost expansion board for micro:bit. It leads out all IO ports of micro:bit and has a specially-designed port for “HuskyLens AI camera”. This board can be used to provide stable 5V power supply for HuskyLens to make it run steadily in all modes. The silkscreens on the back clearly indicate the functions of all interfaces, which can help users to get started easily.

This product can be used in classroom teaching and after-school extended exercise for teaching students basics about micro:bit or used with HuskyLens AI camera to introduce AI to them.

Note: Please supply power via the USB port on this product when using with HuskyLens.

Features

Specification

Board Overview

IO Ports Project

Project 1 - LED Light Controlling

Project Introduction

Use IO Extender for micro:bit V2.0 port to simulate the light ON-OFF in daily life so as to familiarize with the basic usage of the product.

Shipping List

Name Number
Gravity: Digital Piranha LED Module - Red 1
Gravity: Digital Push Button (Green) 1
micro:bit - an Educational & Creative Tool for Kids 1
IO Extender for micro:bit V2.0 1

Hardware Connection

As shown below:

Hardware Connection

Program Design

When the switch is pressed and released, the LED light will be lit, and the LED light will be turned off after one press and release again. In this routine, two while loops are used to check whether the button is released after the press is completed. The delay in the while loop is used to eliminate the shaking of the button.

Program screenshot

As following picture shows: screenshot

HuskyLens Project

Preparation

  1. Search https://github.com/DFRobot/pxt-DFRobot_HuskyLens or "HusktLens", then click on the search button, you will see the HuskyLens plugin, and then click to add it. search

  2. Ports and Buttons

ports and buttons

3.The communication interface between HuskyLens and micro:bit is I2C interface. How to set the HuskyLens communication mode to I2C? First dial the function button to find the general settings, then long press the function button to enter the secondary menu of general settings. Dial the function button to find Protocol type and press the function button to enter the protocol type menu. Find I2C, click the function button to select, and then choose "Save and Return". Then HuskyLens is set I2C communication mode.

general settings

In this example, we only explain part function of the HuskyLens. Click to learn more about HuskyLens

Hardware Connection

Note: HuskyLens needs to be connected to the specific interface. The HuskyLens interface uses a 5V voltage supply to ensure stable operation, as shown in the figure:

interface

Project1-Music Mirror

Project Introduction

we can use HuskyLens to make a music mirror. When the learned face and unlearned one appear in the mirror, different expressions are displayed at micro:bit LED matrix, and different music is played by the buzzer.

Shipping List

Name Number
HuskyLens 1
micro:bit 1
IO Extender for micro:bit v20 1

Demonstration of face recognition of HuskyLens

  1. Dial the “function button” to the left until “face recognition” is displayed at the top of the screen.

demo1

  1. Point HUSKYLENS at the area with faces on it. When a face is detected, it will be automatically selected by a white frame with words "Face" on the screen.

Demo2

  1. Point the “+” symbol at a face, short press the "learning button" to learn the face. If the same face is detected by HuskyLens, a blue frame with words "Face: ID1" will be displayed on the screen,which indicates that HuskyLens has learned the face before and can recognize it now.

demo3

Program Design

HuskyLens will play "ode" and display a smile face on the micro:bit when recognizing the learned face, while play "funk" and display a crying face when the face is unlearned.

Program Screenshot

As shown below:

screenshot

https://makecode.microbit.org/_T8EgAK60AEat

Program2-Color Piano

Project Introduction

We can use the HuskyLens color recognition function to make an interesting color piano, using color cardboard to make the keys, and playing the piano notes corresponding to the colors by recognizing the 7 different colors that have been learned.

Shipping List

Name Number
HuskyLens 1
micro:bit 1
IO Extender for micro:bit v2.0 1
paperboard 7

Demonstration of color recognition of HuskyLens

Operation and Setting

  1. Dial the function button to the left until the word "Color recognition" is displayed at the top of the screen.

  2. Press and hold the "function button" to enter the secondary menu parameter settings.

  3. Dial the function button until "Learn Multiple" is displayed, then short press the function button, and dial to the right to turn on the "Learn Multiple" switch, that is, progress bar turns blue and the square icon on the progress bar moves to the right. Then short press the function button to confirm this parameter.

demo 3

  1. Dial the function button to the left until "Save & Return" shows. And the screen prompts "Do you want to save the parameters?" Select "Yes" in default, now short-press the function button to save the parameters and return automatically.

Learning and Recognition

  1. Color Detection

Point the icon "+" in the center of the HuskyLens screen to the target color block, and a white box will appear on the screen, which selects the target color block automatically. Adjust the angle and distance of the HuskyLens to the color block so that the white box frames the entire target color block as far as possible.

color detection

  1. Color Learning

After detecting the color, press the "learning button" to learn the first color, then release the "learning button" to end the learning, meanwhile, a message "Click again to continue! Click other button to finish" will be displayed. Please short press the "learning button" before the countdown ends if you want to learn other colors. If not, short press the "function button" before the countdown ends, or do not press any button to let the countdown ends. The color ID is consistent with the order of learning colors, that is: ID will be marked as "ID1", "ID2", "ID3" in order, and so on, and different colors correspond to different border colors.

color learning

  1. Color Recognition

When encountering the same or similar color blocks, a colored frame with an ID will be automatically displayed on the screen and track the blocks, and the size of the frame is same as the size of the color blocks. A variety of different colors can be recognized and tracked at the same time, and different colors correspond to different border colors.

color recognition 1

When there are multiple same or similar color blocks appearing at the same time, the other color blocks cannot be recognized, that is, only one color block can be recognized at each time.

color recognition 2

Note: Color recognition is greatly affected by ambient light. Sometimes HuskyLens may misidentify similar colors. Please try to keep the ambient light unchanged and use in a well-light environment.

Program Design

HuskyLens recognizes the different colors it has learned, and the buzzer plays the tone corresponding to the color. The tone and ID corresponding to the color are shown in the table below.

Color 1 2 3 4 5 6 7
Tone C D E F G A B
ID 1 2 3 4 5 6 7

Program Screen

As shown below:

screenshot2

https://makecode.microbit.org/_EXWfPW1AyHdm

Program3-Self-service Supermarket Cash Register

Program Introduction

Using the HuskyLens tag recognition, we can simulate the self-service checkout function in a supermarket by recognizing the learned tag on a product.

tag recognition

Shipping List

Name Number
HuskyLens 1
micro:bit 1
IO Extender for micro:bit v2.0 1
QR Code tag 3

Demonstration os tag recognition of HuskyLens

Operation and Settings

  1. Dial the function button to the right or left until the words "Tag Recognition" is displayed at the top of the screen.

  2. Press and hold the "function button" to enter the secondary menu parameter settings

  3. Dial the function button until "Learn Multiple" is displayed, then short press the function button, and dial to the right to turn on the "Learn Multiple" switch, that is, progress bar turns blue and the square icon on the progress bar moves to the right. Then short press the function button to confirm this parameter.

tag  multi-learning

  1. Dial the function button to the left until "Save & Return" shows. And the screen prompts "Do you want to save the parameters?" Select "Yes" in default, now short-press the function button to save the parameters and return automatically.

Learning and Recognition

HuskyLens can only recognize the QR codes as shown in the picture below, and you can choose three of them to label on the products.

QR codes

  1. Tag Detection

When Huskylens detects the tag, the tag will be automatically selected by the white frame on the screen.

tag detection

  1. Tag Learning

After detecting the tag, press the "learning button" to learn the first tag, then release the "learning button" to end the learning, meanwhile, a message "Click again to continue! Click other button to finish" will be displayed. Please short press the "learning button" before the countdown ends if you want to learn other tags. If not, short press the "function button" before the countdown ends, or do not press any button to let the countdown ends.

tag learning

The tag ID is consistent with the order of learning tags, that is: ID will be marked as "ID1", "ID2", "ID3" in order, and so on, and different tags correspond to different border tags.

  1. Tag Recognition

When encountering the learned tag, a colored frame with an ID will be automatically displayed on the screen to select the tag, and the size of the frame is same as the size of the QR Code tag.

multi-tag learning

Program Design

Press the A button to recognize the product, press the B button to settle the price and display it on the micro:bit LED matrix, for example, press the A button to recognize the QR code on the water cup, and press the B button to settle the price and display it on the micro:bit LED matrix.

Commodity Prices

Name Price
Water cup 20
Flaky pastry 5
Utility knife 15

Program Screenshot

Screenshot3

https://makecode.microbit.org/_CYx3HmKqT2Yw

Note: Click to check information about IO Extender for micro:bit V1.0.

FAQ

For any questions, advice or cool ideas to share, please visit the DFRobot Forum

More Documents