Tag Archives: PyQt

PyQt5 Project to Control Arduino RGB LED Over WiFi

In this video lesson we add slider bars to our PyQt Widget allowing us to control the color of an RGB LED over WiFi. When using the breadvolt, or any battery power supply on a breadboard project, do not turn the power supply on while the Arduino is connected to USB, as you could generate voltage conflicts. It is an either or. If the USB is connected, the power supply should be OFF. Or if you are going to connect the USB, first turn off the power supply. The schematic for the project circuit is shown below:

Arduino Uno R4 Wifi
Schematic of our Arduino Uno R4 Wifi connected to an RGB LED

The server side code developed in the video is presented below:

Remember to add the secrets.h file by adding a tab to the project, as explained in the video.

And then on the client side, we have the following code:

 

Adding Slider Bars to Your PyQt Arduino Project

In this lesson we add slider bars to our PyQt widget. The slider bars will be used to control the color of an RGB LED, but this week we are simply getting the slider bars incorporated into the widget and then next week we will connect them to the Arduino. This is the schematic for the arduino we are using for the next few lessons:

Arduino Uno R4 Wifi
Schematic of our Arduino Uno R4 Wifi connected to an RGB LED

When using the breadvolt, or any battery power supply on a breadboard project, do not turn the power supply on while the Arduino is connected to USB, as you could generate voltage conflicts. It is an either or. If the USB is connected, the power supply should be OFF. Or if you are going to connect the USB, first turn off the power supply.

This is the code for the server on the Arduino:

Remember you will need the secrets.h tab in order to have your WiFi login credentials.

 

The code below creates a PyQt widget with three slider bars. In this code, we are just demonstrating use of Slider Bars. Next week we will connect the Slider bars to the Arduino over WiFi for controlling RGB Color.

 

PyQt5 Graphical User Interface for Control of Arduino Project Over WiFi

In this video lesson we create a client server connection between Python running on your desktop computer, and your Arduino project. We show how to make the connection over WiFi, and how to pass data and commands back and forth between your Arduino and your desktop computer. We then show how to build an attractive Graphical User Interface in PyQt5 to control your arduino project from your desktop wirelessly. For this simple example, we will control an RBG LED from the GUI.

This is the circuit schematic of the Arduino;

Arduino Uno R4 Wifi
Schematic of our Arduino Uno R4 Wifi connected to an RGB LED

When using the breadvolt, or any battery power supply on a breadboard project, do not turn the power supply on while the Raspberry Pi Pico is connected to USB, as you could generate voltage conflicts. It is an either or. If the USB is connected, the power supply should be OFF. Or if you are going to connect the USB, first turn off the power supply.

For your convenience we include the code developed in the video below. This first program is the server side program, for the arduino:

You will need to save your WiFi name and password in your ‘secrets.h’ file, which you create in a new tab, as explained in the video.

Now, for the client side, this is the Python code for creating the Graphical User Interface using PyQt5.

 

Remotely Control a DC Motor Over WiFi With Raspberry Pi Pico W

In this video lesson I will show you how you can control a remote DC motor using your Raspberry Pi Pico W. The Pi Pico is set up as a server, and is connected to a DC motor, and TA6586 Motor Controller. The motor is controlled by a client Python program running on your desktop PC. On the client side we create a Graphical Widget, which will allow you to control both the speed and direction of the motor. the schematic for the Raspberry Pi Pico W side is shown below:

Motor Controller
Schematic for TA6586 and Raspberry Pi Pico DC Motor Control

When using the breadvolt, or any battery power supply on a breadboard project, do not turn the power supply on while the Raspberry Pi Pico is connected to USB, as you could generate voltage conflicts. It is an either or. If the USB is connected, the power supply should be OFF. Or if you are going to connect the USB, first turn off the power supply.

Then in the video, we developed the following software for the server side on the Pi Pico

Then for the client side, the following program runs on Python on your PC:

 

 

Plotting Live Data in Python Using PyQT

In this video lesson we show how Live Data can be plotted using a PyQt window. Our eventual goal is to bring in live data from the Raspberry Pi Pico W using UDP over WiFi, but to learn the concepts today, we will be generating a live sin wave to show how the plotting works. Here is the code we developed in this lesson: