Raspberry pi ai hat

Hi, I’m wanting to use Rpi 5 with the new ai hat for real time object detection and tracking on a pan tilt arrangement which is operated with 2 stepper motors. Once the object is detected I would like to. operate a solenoid on and off until the object is no longer detected. The camera I want to use is the Arducam 64MP Hawkeye and I will install pi os on a ssd mounted to the pl5. can anyone give me any ideas and/or code on how to go about this?

1 Like

Hey @Eddie30826, long time no see!

This sounds like a cool project. Given that it will involve a few complicated elements, I would probably start this by individually figuring out each element of this project.

I would start with getting a basic Pi OS booted from your SSD, then move onto the object recognition side of things.

We have a great guide on how to recognise objects using the Raspberry Pi AI HAT using the YOLO software. I would start with this and get the object recognition side of this project working first as its likely going to be the most complicated part.

After you get this far, the solenoid operation should be much less involved in comparison.

The short answer is to break it down into smaller projects that you can complete using more generic advice and tutorials. Then put it all together once you have all the building blocks working individually.

Hope this helps! :slight_smile:

1 Like

Thanks for getting back to me Samuel, I have already taken a look at the yolo object detection video which initially peaked my interest.
It doesn’t really get into object tracking with pan̈ tilt set up, is there any information in regards to this. I’m very much a novice with this sort of project.

Hey @Eddie30826

The 3rd demo which gets the location of an object on screen is going to be your best bet to adapt. I would break it all down into steps and start by getting the pan and tilt system working. Get it so you can say go left, and it moves left at a comfortable rate, and repeat for all the directions.

Then I would use that location demo code to create the command of which direction you should use your system. If you plug that demo code into a large language model like ChatGPT or Claude, they should be able to give you a hand if you need it.

Also, be careful! The AI HAT uses the onboard PCIe slot, and so does the HAT for the SSD, but the Pi 5 only has 1 slot. We do have a guide on running the same models but without the AI hat if you wanna check that out

4 Likes

You can now have your cake and eat it too, we stock PCIe Expansion Board For Raspberry Pi 5 | Buy in Australia | WS-30490 | Core Electronics that will allow you to have the PCIe hat tower of your dreams.

3 Likes

Thanks Jarrod for getting back to me, I will take a look at the 3rd demo.
I was obsessed with object detection thinking that was the way to go. You may have just saved me a lot of unnecessary learning. Great video by the way, the way you explain the material is very easy to understand.
Thanks again
Eddie

You can proceed with the following parts.
Raspberry Pi 5 with Raspberry Pi AI Kit (Hailo-8)
Arducam 64MP Hawkeye (via CSI or USB interface)
Pan-Tilt Mechanism with 2 Stepper Motors (e.g., 28BYJ-48 or NEMA + A4988/DRV8825 drivers)
Solenoid controlled by a MOSFET or relay
Raspberry Pi 5 with Raspberry Pi AI Kit (Hailo-8)
Arducam 64MP Hawkeye (via CSI or USB interface)
Pan-Tilt Mechanism with 2 Stepper Motors (e.g., 28BYJ-48 or NEMA + A4988/DRV8825 drivers)
Solenoid controlled by a MOSFET or relay
SSD for OS and data storage
For AI interface, you can use
OpenCV + YOLOv5 or YOLO-NAS via Hailo-8 SDK or TensorFlow Lite / ONNX optimized for Hailo.
If you are looking forward to doing something simpler, you can use ESP32-CAM. Simple ESP32 CAM Object detection using Open CV - Share Project - PCBWay

Thanks Ahsrab,
That information helps a lot.