Human Follower Using Huskylens and Arduino
by MikeTheMaker in Circuits > Arduino
17 Views, 0 Favorites, 0 Comments
Human Follower Using Huskylens and Arduino
If you've ever wanted to detect and follow a human with a robot or device, this project shows how to provide three outputs--left of camera, center of camera, right of camera. This is fairly economical and can be easily set up in a few minutes.
Downloads
Supplies
The Huskylens attaches to the Arduino using four wires (an included cable). The wires are red (+5 volt), black (gnd), blue (scl) and green (sda). I attached Arduino pins 6, 7 and 8 to a breadboard--each pin to the anode of an led. The cathode of each led goes through a 220 ohm resistor to gnd.
I've included the code I used to detect a "trained" person (id1). To train a person, power on the Huskylens, then use the dial (upper left when viewing the Huskylens screen) to select object recognition. I stood in front of a mirror. When the Huskylens showed a "bounding box" and "id1," I pushed the button (top right on Huskylens) and the lens module "saved" my image as id1.
Now, there is a slightly tricky part for using the Arduino. The library needed to operate the Huskylens is not in the standard libraries--it must be loaded as a ZIP file. Go to this location https://github.com/HuskyLens/HUSKYLENSArduino and download the ZIP file. In the Arduino programming environment, goto "sketch," then "Include libraries," then "Add .ZIP libraries." Select the library you just downloaded.
The Huskylens is not super selective, so training it to one person means it will probably identify almost anyone as id1. This could be useful to create "large following eyeballs" or other holiday decorations.
Although the Huskylens instructions indicate that the Arduino 5 volt power line is not sufficient to operate the module, I have found no issues when using "genuine Arduino" boards.