Friday, July 15, 2022

Pico W a first look

 For an index to all my stories click this text.

And suddenly Raspberry Pi surprised me again. Just like they did last year when the Raspberry Pi Pico was released out of the blue. This year they did it again. Out of the blue there was the Raspberry Pi Pico W. And the difference is that it has Wifi now.



Mind you this is not a linux board as we are used to from Raspberry Pi, but this is a microcontroller like the ESP8266 or ESP32.

The official language at this moment is MicroPython, just as on the original Pico.

I bought 4 of them and they work fantastic.
Loads of IO ports, loads of memory, USB for programming and an excellent price: 7,95 euro here in the Netherlands. This is a real competitor for the ESP8266 and ESP32. Even more because it is made in Europe and widely available here.

Lets first look at the specs which i copied shamelessly from the Raspberry Pi site:

21 mm × 51 mm form factor
RP2040 microcontroller chip designed by Raspberry Pi in the UK
Dual-core Arm Cortex-M0+ processor, flexible clock running up to 133 MHz
264kB on-chip SRAM
2MB on-board QSPI flash
2.4GHz 802.11n wireless LAN (Raspberry Pi Pico W and WH only)
26 multifunction GPIO pins, including 3 analogue inputs
2 × UART, 2 × SPI controllers, 2 × I2C controllers, 16 × PWM channels
1 × USB 1.1 controller and PHY, with host and device support
8 × Programmable I/O (PIO) state machines for custom peripheral support
Supported input power 1.8–5.5V DC
Operating temperature  -20°C to +70°C (Raspberry Pi Pico W and Pico WH)
Castellated module allows soldering direct to carrier boards (Raspberry Pi Pico and Pico W only)
Drag-and-drop programming using mass storage over USB
Low-power sleep and dormant modes
Accurate on-chip clock
Temperature sensor
Accelerated integer and floating-point libraries on-chip


Impressive !!!

Pico and Pico W


The picture shows an original Pico with the headers soldered on and the new Pico W. As you can see they have the same size and with headers the Pico W can be used on a breadboard. The difference shows in the big metal box on the left in which the Wifi part is housed. At the utmost left there is a triangle on the breadboard which is the Wifi Antenna. The design for the antenna was taken from the Raspberry pi Zero (Linux machines) series.

There are some changes which I want to share with you. As I just received them this just covers my first impressions and experiences.



Just like the original Pico the Pico W is sold without headers.
Headers are cheap but you have to solder them on yourself, so you will need some basic soldering experience.

Thonny

At first my Pico W's were not working. I really thought there was something wrong.

So I decided to have a look at the Thonny website. It seems that there is a new version. Thonny V 4.0. After installing that everything worked as a charm.

Make sure to install the latest version of Thonny to get started with your Pico W !!!

The internal Led

There is an on-board led just like the original pico has. The original Pico had the led attached to pin 25 but that is no longer the case. So to blink the on board led you need the following Micropython program:

import machine
import time

ledintern = machine.Pin("LED", machine.Pin.OUT)

while True:
    ledintern.on()
    time.sleep(1)
    ledintern.off()
    time.sleep(1)


The Timer library

The Timer library has changed a bit from the previous version.

Start with :

import time

then define a timer:

timer_one = Timer(period=5000, mode=Timer.ONE_SHOT, callback=lambda t:print(1))

and call the timer this way:

timer_one.init(period=5000, mode=Timer.PERIODIC, callback=BlinkLED)

More on this will be discussed in later stories.

Wifi !!!

For Wifi there is a new library that includes:
HTTP, Webserver, Websockets, Get requests.

I have been experimenting with the Wifi possibilities and they work like a charm. In the few days I have them in my posession I have already send and retrieved data from/to:
- Domoticz
- Dweet
- IFTTT
- Telegram
- Thingspeak

Update:

Also tested and working :
- HTTP webserver
- Socket webserver

Conclusion.

This is off course a very brief first look which I wrote 2 days after receiving my Pico W's and I am very impressed. The Raspberry foundation did a tremendous good job by supplying excellent hardware and a ready to work with software environment.
As the price is also excellent (as we are used from Raspberry Pi products) this will be a real winner and a serious contestant for the ESP series.

Till next time
Have fun

Luc Volders