BBK About Projects Links News Contact

uPyBot with HuskyLens AI Camera Project

This page provides more details of how I connected HuskyLens AI camera into my uPyBot. Additionally, there are links provided to the source code on GitHub and the short video demo.

uPyBot with HuskyLens AI Camera Demo

This YouTube demo shows uPyBot hello greeting (quick left-right move with a beep) when on its attempt to move forward uPyBot recognizes my face.

uPyBot GutHub Repository

GitHub Micro Python source code to control my uPyBot as well as HuskyLens AI camera is available here .

uPyBot and HuskyLens AI Camera
Hardware Overview

uPyBot is controlled by the Micro Python Hardware Board (named pyboard) which is running Micro Python script. Both Micro Python as well as Micro Python Board are very well documented on the Micro Python Web Page (micropython.org). uPyBot is assembled from off-the-shelf components (see Botland ) supported by a small interface board (assembled by myself) which handles some additional required electronic components.

HuskyLens PRO AI camera is added to uPyBot using pyboard serial interface (UART 3). There are 4 cables required to interface to the HuskyLens AI camera. Two are used to power the camera (pyboard pins V+ 5[V], GND), and two others provide serial link TxD and RxD as shown on the schematic diagram. HuskyLens camera TxD line is connected to pybard pin Y10 (RxD) and camera RxD line is connected to pyboard pin Y9 (TxD).

uPyBot and HuskyLens AI Camera
Software Overview

I have extended original uPyBot script with HuskyLens related functions. Those functions use huskylensPythonLibrary.py library taken from the Interfacing Huskylens with Raspberry Pi Pico web page. I have had to modify one line in the library to let it uses pyboard UART3 interface. uPyBot class is extended to have HuskyLens camera as its member and next wait_until_move_done() method is modified to check if FACE ID 1 is recognized by the camera. HuskyLens camera has been taught my face which is identified as FACE ID 1. When uPyBot detects my face during its forward movement it stops and runs a greeting procedure turn_for_hello(). This procedure makes five quick left and right movements with a beep. After greeting uPyBot continues his random walk procedure until it recognizes FACE ID 1 again. To avoid blocking the robot with another greeting there is a timeout introduced which requires some time (currently 15 seconds) to expire between consecutive face recognitions. The original random walk Micro Python script was modified to eliminate rapid movement changes (like a motor hard stop) by adding 200[ms] delays between motor commands to not overload the power supply which generated HuskyLens camera resets.

<<