Raspberry Pi Pico W: the little brother of the Raspberry Pi is entitled to Wi-Fi


The Raspberry Pi RP2040 microcontroller is a processor that offers a balance between power and flexibility. It’s also the company’s first system-on-chip (SoC), which until now has used off-the-shelf processors.

Based on a dual-core Arm Cortex M0 running at 133 MHz, it has 264 KB of on-chip memory. Designed to be integrated into hardware, each chip also features 26 GPIO pins, with a host of additional control tools, including eight programmable I/O state machines.

In addition to selling RP2040s to its customers for integration into their own devices, Raspberry Pi uses it in its own Pico boards – low-cost devices aimed at makers, hobbyists and tweakers. In addition to the RP2040, the Pico has an additional 2MB of flash memory for your code and device firmware. The device comes as a 21mm by 51mm circuit board, with 40 pins ready to be fitted with header pins for use on a breadboard or to be connected directly to sensors and actuators.

Technical characteristics

  • Dimensions: 21mm×51mm
  • SoCs: Raspberry Pi RP2040 (dual-core Arm Cortex-M0+ @ 133MHz)
  • RAM: 264 KB (on chip)
  • Storage : 2 MB (on-board QSPI flash)
  • Interface: 26 GPIO pins, including 3 analog inputs
  • Peripheral devices : 2 UARTs, 2 SPI controllers, 2 I2C controllers, 16 PWM channels, 1 USB 1.1 and PHY controller (with host and device support), 8 PIO state machines (programmable input/output)
  • Connectivity: 2.4 GHz 802.11b/g/n Wi-Fi (built-in antenna using Infineon’s CYW43439)
  • Power supply: 1.8 – 5.5 V DC
  • Operating temperature : – 20°C to + 70°C
  • Lifetime : the Raspberry Pi Pico W will remain in production until at least January 2028

New Pico – this time wirelessly

Raspberry Pi recently introduced two new versions of the Pico, and a third is planned for the end of the year. The Pico H adds a set of pre-soldered pins, intended for prototyping and experimentation, while the Pico W brings Wi-Fi to the board, allowing you to use it for standalone connected applications. They will eventually be joined by the WH, which adds connectors to the W. As with the original Pico, the Pico W can be purchased in bulk, and is ready for use in commercial projects.

Raspberry Pi Pico W

Raspberry Pi Pico W: The Infineon CYW43439 Wi-Fi chip under the silver casing also supports Bluetooth, although this is not yet enabled. Image: Simon Bisson.

The Pico W is a significant change, as it adds a 2.4GHz 802.11b/g/n Wi-Fi chip and an integrated antenna. All without changing the shape of the device, so you can swap out a Pico W for a standard Pico in existing projects. As with the standard Pico, basic power and connectivity goes through a micro-USB port, but you can also use the pins on the board to power the device, allowing you to plug it into enclosures and other devices. use batteries as alternative power sources.

The chip used to add Wi-Fi to the Pico W, the Infineon CYW43439, also supports Bluetooth and Bluetooth Low Energy (LE). Although this first version only supports Wi-Fi, Raspberry Pi says it may add Bluetooth support in the future. Currently, the wireless farm is based on the lwIP TCP/IP implementation, using libcyw43 to control the wireless hardware. Fortunately, Raspberry Pi has negotiated a free commercial use license for the normally non-commercial libcyw43, so you can continue to build commercial hardware using the Pico W or even build your own boards around the combination of the RP2040 and of CYW43439.

There are a few minor differences between the W and the original Pico, apart from the addition of Wi-Fi support. The most obvious is that the onboard LED is no longer connected to the RP2040’s GPIO pins, but works through the GPIO of the Wi-Fi chip. If you used this LED as an indicator for C or in MicroPython, you will need to modify your code to take advantage of the new hardware options.

Raspberry Pi is forking its build of MicroPython accordingly. You will find separate versions of firmware, so be sure to install the correct version for Pico W. Raspberry Pi provides two development models for Pico, using C to embed your own code into its firmware, or working with Raspberry Pi’s own firmware, which is configured with MicroPython and includes most of the necessary modules.

Programming the Pico W

You can develop for the Pico W using your desktop PC or Mac, or connect to it from a Raspberry Pi. I used a USB connection from a Windows PC, first in pressing the Pico W’s BOOTSEL button to put it into download mode, then installing the Raspberry Pi’s firmware by dropping the file into Pico W’s memory. Once installed, Pico automatically reboots, using its USB port as a connection serial to your development PC or the Pi.

You can use a terminal program to connect to the Pico W, using its MicroPython REPL to try some code (and for those nostalgic for 8-bit computing and Gen X), but it’s best to work with an environment MicroPython-ready development platform like Thonny. You can use it as a development editor and as a way to install Python code on your Pico.

Plug your Pico W into a development PC and launch Thonny. In the Shell pane below the editor, you’ll see Pico’s MicroPython REPL where you can quickly try out some code. However, most of your work will be done in the main editor.

Raspberry Pi Pico W: Thonny

Using the Pico W MicroPython shell to scan for wireless networks. Screenshot: Simon Bisson.

The first thing you’re likely to do with a Pico W is try to connect it to a wireless network. If you’re using MicroPython, it’s pretty easy, thanks to the new network module. Start by creating a wlan object, then configure it to be active and use its connect method to connect to an SSID and password. Wait a bit and retrieve the connection configuration to see the current IP address, DNS server and gateway addresses. The Raspberry Pi documentation contains a basic script to connect to your local Wi-Fi network. Other methods allow you to search for nearby access points, such as a quick test to see if your device is working.

Using Pico W with the Web

So what can you do with a connected Pico W? Two useful MicroPython modules, socket and urequests, allow you to start communicating with external services over HTTP. urequests is arguably the most useful, as it allows sending and receiving JSON files to an external service. This approach gives your connected Pico W many options: it can receive messages from an application or send data back to it. The ability to use JSON greatly increases utility, as your devices can now work with common webhook endpoints in home automation and industrial automation, connecting to all kinds of workflows .

Connecting such a microcontroller to a network removes many of its limitations, as it then becomes just a cog in a larger connected ecosystem. In a home, it could automate watering your houseplant, or in a garden, provide sensors that help you decide when to harvest your fruit. You can also use its PIO state machines in conjunction with GPIO pins to drive actuators in your own external circuits.

It’s even possible to build a simple MicroPython-powered web server on a Pico W, to give your hardware projects a basic dashboard. In this case, you will need to use the socket module to listen to HTTP requests and respond to them if necessary. Your web server can be connected to external hardware, allowing you to extend your devices to the web with low power consumption. It’s probably overkill to use sockets to build a web server with forms support so users can configure any application, but adding HTTP support to the code so users can download configuration files goes a long way of meaning.

Findings

There’s a lot to like about the Raspberry Pi Pico W. It takes a simple, familiar device and extends its usefulness significantly by adding wireless networking support. By giving you low-power connectivity, you don’t need a heavy power supply: you can run on battery power to build connected hardware that can work anywhere you can get a Wi-Fi signal.

At the same time, the default firmware and MicroPython make it easy to create your own software. It is therefore an ideal prototyping platform for commercial products that use the RP2020 and CYW43439. You can even choose to buy them in bulk from Raspberry Pi and include them in your own boards.

A cordless Pico is a surprisingly powerful tool, which I wholeheartedly recommend. For a low price, you can build connected devices that can do, well, just about anything you can imagine.

Source: ZDNet.com





Source link -97