Arduino AI Project – Object Tracking Robot Hey, in the previous posts and videos of this Arduino AI Vision Sensor Tutorial series, I told you what a HuskyLens is, what you can do with it, and how you can connect HuskyLens to Arduino.
How about an Object Tracking Arduino Robot? Guys in this video, I will show you how you can make an Object Tracking Robot using Arduino. Stay tuned!
- Arduino Pro Mini
- L293D Motor Driver
- Robot Chassis
- Jumper Wires and
- Connecting Cables
Guys, I have designed a PCB layout where you can easily mount your Arduino Pro Mini and L293D, set this up without using messy wires and cables hanging around.
The board is lightweight and can be powered using a 9V battery or a 9-12 V power adapter.
Now, we need a robot chassis. This one I have is one of the best chassis I use to build Spinel Crux. If you want this, I will leave the link in the description. Go check it out! Spinal Crux - Gesture Controlled Robot.
You can use the mounting brackets and pieces that come with the HuskyLens camera to attach it to the chassis.
Once you attach the HuskyLens to the chassis, you can fix the assembled PCB and battery on top of the chassis.
The next thing we wanna do is install HuskyLens Library for Arduino.
In the below video, I have explained all the steps in order to install HuskyLens from Arduino IDE Download to first code upload. Check that out!
Now its time to code. In the previous video, I showed you how to upload basic code to Arduino and Read HuskyLens data from it. Check out the above video if you wanna know more about integrating Hukylens to Arduino.
Click Here to download the code for Object Tracking Robot.
Even though the code is lengthy, its very simple to understand. First, we set up the software serial library which will add an additional serial interface to Arduino at pin 10 and 11 where we connect the HuskyLens.
Then we initiate both the Serial interfaces at the provided baud rate. Then we set the pin for driving the motors including the enable pins.
Then down the program, you will see some functions to drive the motor as well as displaying the Huskylens output that is read by Arduino.
How about a test run? Now power on the bot and train an object by setting the Huskylens in Object tracking mode.
Once it is done, you can move the object left or right and the bot will start to follow the object.