.st0{fill:#FFFFFF;}

Raspberry Pi

Raspberry Pi Pico W: first connection 

 September 8, 2022

By  Peter

Join Our Mailing List

We publish fresh content each week. Read how-to's on Arduino, ESP32, KiCad, Node-RED, drones and more. Listen to interviews. Learn about new tech with our comprehensive reviews. Get discount offers for our courses and books. Interact with our community.

One email per week, no spam, unsubscribe at any time.

I got a brand-new Raspberry Pi Pico W, courtesy of Sunfounder, and took a day to play with it. In the video (above) and the article in this page I have documented my experimentation with this powerful new microcontroller board.

List of hardware, software, resources

In this experiment, I used this hardware:

I also used this software:

Other useful resources that I mention in the video:

Wiring

For the experiment, the wiring is very simple. As I have not decided what I want to do with my Raspberry Pi W, I decided not to solder the headers. I still wanted to use an external LED for the blink example.

So, I wrapped the LED and resistor pins together (no soldering needed). Here is how to do this:

  1. Find the cathode of the LED (the shorter of the two pins). If both pins have the same length, use the diode function of your multimeter to determine the cathode.
  2. Take one pin of the resistor, and wrap it around the cathode pin of the LED.
  3. Take the free pin of the resistor, pass it through the GND pad of the Raspberry Pi Pico. There are several GND pins on the Raspberry Pi Pico; you should use the one that is next to the GP2 pad, close to the USB connector. Gently bend the resistor pin in a loop and wrap it around it self to minimize movement.
  4. Take the free pin of the LED (the anode) and pass it through the GP2 pad of the Raspberry Pi Pico. Gently bend the LED pin in a loop and wrap it around it self to minimize movement.
  5. In the end, your resistor and LED should be attached to the Raspberry Pi like in the example in the photo (place your mouse pointer over the image to zoom in).

Example code

In this experiment I used simple Micropython code to control the LED, check the model of the Raspberry Pi Pico, and fetch data from the Internet. You can find this code here:

Make the LED blink

>>> from machine import Pin
>>> led = Pin(2, Pin.OUT)
>>> led.value(1)
>>> led.value(0)

Get the model of the Raspberry Pi Pico

>>> import sys
>>> sys.implementation
(name='micropython', version=(1, 19, 1), _machine='Raspberry Pi Pico W with RP2040', _mpy=4102)

Connect to Wifi and fetch data from the Internet

import network

ssid = 'wifi-id'
password = 'wifi-password'

wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(ssid, password)

# Make GET request
import urequests
#r = urequests.get("https://www.google.com")
r = urequests.get("http://date.jsontest.com")
print(r.content)
r.close()

Learn MicroPython with the ESP32

With this course, you will learn how to use the MicroPython programming language with the ESP32 microcontroller.

MicroPython is a high-level programming language specifically designed for microcontrollers and resource-limited embedded devices. Think of MicroPython as “Python for Microcontrollers”.

Learn more…


Tags


You may also like

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

I’m thrilled to announce that my upcoming course, Introduction to Electronics, is just a few weeks away from being released on both Udemy and Tech Explorations. This course was designed with the absolute beginner in

Read More
New Course Coming soon: Introduction to Electronics

Robotics is one of the most engaging and effective ways to teach programming, problem-solving, and critical thinking. Today, we’re diving into the CrowBot Bolt, a programmable robot car explicitly designed for STEAM (Science, Technology, Engineering,

Read More
Exploring the CrowBot Bolt: A Hands-On Robotics Kit for STEAM Education