Tag Archives: Fusion HAT+

AI on the Edge LESSON 6: Digitial Out, Servos, Analog In and PWM on the Fusion HAT+

n Lesson 6, we’re really starting to get our hands dirty with real hardware control. Today we dive into the core fundamentals of physical computing on the SunFounder Fusion AI Hat — learning how to use Digital Outputs, control Servos, read Analog Inputs, and generate PWM signals.

This is a big lesson because it bridges the gap between writing simple Python scripts and actually making the Raspberry Pi interact with the physical world. You’ll learn how to turn LEDs on and off using digital outputs, precisely control the position of a servo motor, read values from a potentiometer using the Analog-to-Digital Converter, and smoothly adjust brightness using PWM (Pulse Width Modulation).

I take my time in this video to explain not just how to do these things, but why they work the way they do. Understanding PWM is especially important because it’s a technique we’ll use heavily later in the class when controlling motors, adjusting LED brightness, generating audio tones, and more.

By the end of this lesson, you’ll have a solid foundation in hardware control using the Fusion HAT. These skills are critical as we move forward in the AI on the Edge journey — because no matter how smart your AI code is, it eventually has to do something useful in the real world, whether that’s moving a camera, turning on lights, or controlling a robot.

This lesson marks the point where we shift from just blinking LEDs to building real, useful control systems. The combination of reading sensors (Analog In) and controlling actuators (Servos + PWM) is exactly what intelligent edge devices need to sense and act.

So grab your Fusion AI Hat, hook up an LED, a servo, and a potentiometer, and let’s start giving your Raspberry Pi real physical superpowers!

As always, I strongly encourage you to code along with me in the video. Try different servo angles, change the PWM frequency, and experiment with mapping the potentiometer to different outputs. That hands-on practice is where the real learning happens.

You’re doing great — we’re building something special here. Let’s keep going!

The schematic for the circuit we will be using in today’s lesson if below. We describe it in more detail in the video. The schematic is:

Fusion Hat Circuit Diagram
This is the circuit we will use moving forward in the class

In the video lesson we demonstrated the following programs:

Digital output to blink an LED:

PWM Example to Control RGB LED Color and Brightness.

Reading Analog Voltages on the Pi 5 Using the Fusion HAT+

Controlling Servos With the Fusion AI HAT+

 

AI on the Edge LESSON 2: Raspberry Pi Operating System for Artificial Intelligence

The major challenge we face in this AI on the Edge class is getting a Raspberry Pi 5 configures where you have all the AI Models, Libraries, Modules and Methods installed, and where they all play nicely together. Often, when you add a new model, the old model becomes broken. This is because when you install something new, it often times updates the dependencies. That means it updates a library already on your system. For example, lets say you have numpy 14, working with YOLO 11. Now you install mediapipe, and it updates numpy 14 to numpy 15. This then ‘Breaks’ your YOLO, as it wanted a different version of numpy.  Likely you will get frustrated and quit before you get the dependency problems solved. In order to get around this, you can use a special education version of the Bookworm OS, which has all the needed libraries installed already and working nicely with each other. The video above shows you how to install this OS. Once you do, no not update it, do not upgrade it, do not touch it. Use it to develop your programs and projects for this class. If you want to do something else with your pi, have a separate SD card.