Dfrobot kindly sent me a Huskylens for testing with SPIKE Prime. Huskylens is an ‘easy-to-use AI camera. I have had my eyes on it since the Kickstarter campaign. In this article, I’m sharing my first impressions, experiments, and tips.
What can the Huskylens do?
The Huskylens has a few typical computer vision algorithms onboard: color recognition, line recognition, face recognition, object classification, object recognition, and more. It neatly renders boxes around identified objects on the live screen. The framerates are reasonable: around 11-30 fps, depending on the algorithm.
The Huskylens can speak UART or I2c with your robot. There is a serial API to get the coordinates of the identified objects.
First impressions: the good
- The Huskylens is low-code. You can set a lot of parameters using the on-screen menu. Low-code still means code. So you’ll have to use Python to use it with LEGO.
- The 0.5 and higher firmware versions have more features like an extended API and the possibility of using an SD card.
- The 0.4 firmware versions are more stable and work with 115200 baud.
- The API is well documented. There is a Python library, but it has abysmal python standards, and it didn’t work on SPIKE Prime. So I wrote my own Huskylens SPIKE Prime library.
- The package includes some screws and brackets to mount the camera on your robot. I could screw it to a 7M beam with two M3x10mm bolts that I had lying around.
- The camera works on both 3v3 and 4v7. So you can use it on LEGO Robot Inventor, LEGO SPIKE Prime, and LEGO MINDSTORMS EV3. That is: in theory. The 3v3 power supply of the SPIKE Prime does not seem to have the oomph to power the Huskylens: I had regular brown-outs.
- The HuskyLens support UART and i2c. You can connect it straight to SPIKE prime, using a breakout board or by soldering your own wires.
- You can save your ‘learned’ vision algorithms to an SD card. Again, make sure you have 0.5+ firmware.
First impressions: the bad & the ugly
- I found the user interface not very intuitive. That’s OK if there is good documentation, but the Huskylens also lacks in that area. The docs are there, but they are not very detailed.
- I received the camera with firmware 0.4.7. All of the online documentation assumes you have at least firmware 0.5.
- The firmware upgrade process worked well, but the firmware GitHub repository lists about 15 different versions, and it’s very unclear what the differences are.
- On 0.5 and higher firmware versions, the maximum stable serial speed was 9600 baud. I couldn’t get it up to 115200 anymore.
- On the 0.5 and higher firmware versions, I had occasional brown-outs when connected to SPIKE Prime. The Huskylens would randomly reboot. The problem went away if I used a 5v power bank in the Huskylens USB port.
First experiment: a face tracker
To compare the Huskylens to OpenMV, I made a similar setup as my last OpenMV experiment: a face tracker. The performance is similar. The setup time was less because the OpenMV did not come with a built-in UART protocol. I had to build a protocol myself.
What I like about OpenMV is that it is easier to save and load neural networks. OpenMV also shows a camera feed on your laptop while developing. With Huskylens, you’re limited to the display on the back.
Dfrobot was also kindly sent me an LCD shield display for the OpenMV. The added display makes the OpenMV camera very similar to the Huskylens. In a later article, I’ll make a more detailed comparison.
Next steps with the Huskylens and LEGO SPIKE Prime
- I want to try soldering a dedicated wire for SPIKE Prime with a dc/dc voltage converter. I can then feed the lens using a motor lead and hopefully make the brown-outs go away.
- I’ll try a line follower on the EV3 playmat. That crazy red line is too hard for color sensors, but a camera might be able to deal with it.
- I also want to connect the Huskylens to EV3. Maybe the 4v7 logic is more stable than SPIKE Prime.
Do you have more ideas you want me to test? Let me know in the comments below.
I just followed your project. And I have some brown_out problem. In my case, my HL go off in face_rcognition mode, at 0.4.7, 0.4.7b and 0.5.1 version. I used same direct connect cable for each versions. And other modes like line_tracking, object_tracking etc are worked well, except object_classification and QR at 0.5.1 version. I think, the problem occured by some modes.
So can you check my opinion and correct me? I’m not sure about this problem.
And I always appreciate that your amazing projects. thx:)
I am 11 Years old and have no skills in Python. Is it possible to use the Camera for Object recognition with Mindstorms Robot inventor app (or Spike Prime) using Text Blocks (Scratch) ?
Not possible, but you have the right age to start learning python. It’s not so hard!