Category Archives: Raspberry Pi

PyQt Generates a HSV Color Wheel on Raspberry Pi Pico Over Wifi Project

 In this video lesson we create an interesting project. We create a PyQt Window which  used 3 Sine Waves offset from each other by (2*Pi/). By offsetting the Sine Waves each by this amount creates 3 waves perfectly spaced across the domain. We then use the values from these sine waves to create the Red, Green and Blue values for the HSV color wheel. The x axis represents angle, in radians. Then the values of the sine wave represent the corresponding Red, Green, and Blue values. The program graphs the three waves on the PyQt widget, then passes the data via UDP over WiFi to the Pi Pico. The Pico then applies the values to the RGB LED.  We save the server side program on the Pi Pico as main.py, and power the project with the Breadboard Power Bank, meaning the Pi operates remote and untethered, and the LED is controlled by the desktop client software. This is a schematic of the Pi Pico circuit for the project.

RGB LED
Circuit Schematic for Connecting the RGB LED

This project has a server running on the Raspberry Pi Pico, and a Client running on your desktop PC. Here is the code for the server side for the Pi Pico.

Remember you must set up your ‘secrets.py’ file for your WiFi name and password. Create this file, put in your WiFi name and password, and then save the file on your Raspberry Pi Pico in the lib folder.

Then the code below is the program we developed for the client side. This will run on your PC.

 

LCD1602 Display Library for Micropython and the Raspberry Pi Pico W

This is some demonstration sample code showing use of the LCD1602 as an LCD display for the Raspberry Pi Pico W. The code is explained in the video above. It will prompt a user for his name, and then display a greeting on the LCD.

 

Below is the library for the Sunfounder Kepler Kit LCD1602 display. It allows the LCD display to operate with the Raspberry Pi Pico W. The code should be copied and pasted into Thonny, and then saved to your Raspberry Pi Pico W, to the same folder that contains you Python code. It MUST be saved with file name lcd1602.py

 

Raspberry Pi LESSON 63: Object Detection on Raspberry Pi Using Tensorflow Lite

In this lesson I show you how to do object detection on the Raspberry Pi using Tensorflow Lite. We will write our first program and by the end of the lesson you will have your Pi detecting objects, boxing them and labeling them in OpenCV.

The video demonstrates step-by-step how to install the tensorflow libraries.

For your convenience I have included the code below we develop in this lesson

 

Raspberry Pi LESSON 61: Finding and Tracking Faces and Eyes In OpenCV

In this video lesson we show how to use Haar Cascades in OpenCV on the Raspberry Pi to find and track  faces and eyes. We show the intelligent way to find eyes, such that CPU resources are not wasted. Below we show the code for your convenience.

 

Raspberry Pi LESSON 59: Improved Pan/Tilt Tracking Control Algorithm


 

In this Video Lesson we show an improved control algorithm for tracking an Object of Interest in OpenCV. We develop a simple example of Proportional control, where the correction signal is proportional to the error signal. We show this is a much improved algorithm over our earlier one, which simply applied 1 degree corrections independent of the size of the error. The code we develop in this lesson is included below for your convenience.