Tag Archives: Pi Pico

Sending Data Over WiFi Between Raspberry Pi Pico W and Your PC

In this video lesson we show how we can send and receive data between the Raspberry Pi Pico W, and your PC. We will be running python on the PC, and we will exchange data using the UDP protocol. UDP is simple, and a very reliable way to send data packets back and forth. In this example, we will be demonstrating a simple Client Server relationship between the Pi Pico and PC using UDP over WiFi.

In this lesson, we will just be showing simple exchange of data, but in preparation for future lessons, go ahead and build this circuit.

LED and Buttons
Schematic for Circuit to Demonstrate a Client Server Example on Pi Pico

For your convenience, this is the “Server” software you will run on the Pi Pico.

Notice that the above code wants to load a “secrets” file that contain your WiFi name, and password

You should edit the code below with your WiFi username and your password, and then save the file in the Pi Pico lib folder, with the name secrets.py (don’t forget the .py)

Now, on the PC side, you will run your client, which will be run in Python. Here is the client software:

 

Measure Distance Using the HC-SR04 Ultrasonic Sensor on the Raspberry Pi Pico

In this Video Lesson I will teach you how to use echolocation to measure distances. We will use the HC-SR04 Ultrasonic Sensor, and will use the Raspberry Pi Pico W. We will explain how echolocation works, and show you how the sensor works. We will do the math, and then create the code for making measurements.