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:

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;

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.

 

Powering Your Raspberry Pi Pico W from Battery for Portable Operation

In this video lesson we discuss powering your Raspberry Pi Pico W projects from a battery, allowing portable operation of the project. Most all of our earlier lessons can be powered by battery, allowing the project to operate without being connected to the USB cable. In this lesson I discuss the important issues that must be considered when powering your project from battery, and particularly issues associated with powering your project from battery, but then needing to download the code. I want to explicitly explain how to do this in this lesson, so in future lessons when you see me with the battery connected to the project, you will know what I am doing.

To get started, I will demonstrate with this simple circuit, so go ahead and build this circuit:

Simple Toggle LED
Simple circuit to demonstrate a LED toggle

Then, we will be using this simple code:

In the video, we will explain the ins and outs of now powering a project like the one above using a battery supply. Note for now though, that the wire from pin 36 to the bottom power rail establishes that rail as a 3.3 volt rail, defined by the Pi Pico.

Now, if we want to power the project remotely, that is, remove the USB cable and power from the battery, we will need to supply a suitable voltage both to the nonblinking LED (The Blue One) and the Pi Pico itself.

You can power the Pi Pico by applying a voltage to the VSYS pin, which is physical pin 39. The voltage should be between 1.8 and 5.5 volts. So, we can  power the LED and the Pi Pico by connecting a suitable power supply. For our examples, I use the Sunfounder Breadvolt (AVAILABLE HERE).

However, when we connect the breadvolt to the breadboard, and we we intend to power the project by the Breadvolt, we need to adjust the wiring where instead of pin 36, we should connect pin 39 to the power rail. This is because in using the breadvolt as the power supply, it will define the voltage of the power rail, not the Pi Pico. The Pi Pico will be a USER of the rail, not the one who supplies voltage to it. So, to power the Pico, we need to connect pin 39 to the power rail instead of 36. So, in using the Breadvolt to power the project, we should use this circuit:

Sunfounder Breadvolt
Notice that we now are connecting pin 39 to the Pi Pico

Now with this schematic, we can disconnect the USB, turn the breadvolt on, and  power the project (Pi Pico and the Blue LED) from the breadvolt.

Now the question arises, how would we now download code to the project? The bottom line is, it is never a good idea to have two different voltages supplies connected to the rail, or for that matter connected together. So, the simple solution is, turn the breadvolt OFF, before reconnecting the USB cable. Then download the code. Then disconnect the USB cable, and then turn the breadvolt back on.

What you will see, when the breadvolt is turned off, and the USB cable is reconnected to the project, VSYS will act as an output pin, powering the blue LED. Vsys pin is connected to the USB supply by a diode. There is a small voltage drop across the diode, so the voltage at the VSYS will be around 4.8 volts.

Please watch the video as we will be giving more specific examples of how to make this work.

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.

 

Getting Geared Up for the Ultimate GPS Tracker with Raspberry Pi Pico W

GPS Project
Gearing Up for the Ultimate GPS Challenge

Guys in this class we will be building the Ultimate GPS Tracker. This will build on all you learned in our most excellent Raspberry Pi Pico W class, and now we will begin working on a real project. Hopefully most of the gear you will already have from the various kits you already have, but I give amazon links to the gear we will be using in the project. You Will Need:

Making The World a Better Place One High Tech Project at a Time. Enjoy!