Tag Archives: PyQt5

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;

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.

 

Use PyQt5 to Create a Graphical User Interface for Arduino Project Over WiFi


 

In this video lesson we introduce you to creating Graphical User Interfaces (GUI) to control your arduino project over WiFi using PyQt5. For this first introduction, we show you how to create the PyQt5 Widget on your PC using Python. Then your homework will be to control your arduino using the widget over WiFi. For your convenience, the code we developed in the lesson is presented below.

 

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:

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: