Categories
Electronics Raspberry Pi

Afternoon project with Raspberry Pi Pico Inky

In the past, I already did electronics projects with a lot of different platforms, e.g different versions of Raspberry Pi, Atmel microcontrollers, some Arduinos and of course Lego Mindstorms 😁. Today, I want to share with you how you can quickly get something running with a Raspberry Pi Pico and the Pico Inky add-on specifically made for it. If you did not hear about Pimoroni before, checkout their website. What they are doing or offering is just awesome: https://shop.pimoroni.com/. It is basically a shop with anything you need to get your weekend (or more) electronic projects up and running 🙂

Handling microcontrollers is easier than ever

As cheap as everything regarding electronics got, I defaulted to pre-soldered micro-controllers with a USB interface at some point. You can get these for under 5€ and do not need to hassle around with drivers/programming interfaces etc. Just plug them in and fire up your IDE. Gone are the times of broken micro-controllers because you did set the wrong “fuse bits” or did disconnect something at the wrong time 🥲

Soldering your own circuits or laying them out from nothing on a breadboard with some Atmega / Attiny or whatever you prefer can still be fun. But for a quick project in between I really do prefer keeping the soldering iron where it is 😅 As it’s way quicker to get everything up and running using pre-soldered boards with USB programmers and power supply already there.

There are plenty of available options nowadays, e.g. Arduino, microbit, adafruit, teensy. All of these have different purposes I would say, different target groups and also different sets of features. E.g. the microbit was initially created for educational purposes and does not have as much computing power as the teensys. However, the microbit already has a small LED display onboard and it is really easy to set up for complete beginners.

Long story short: It really depends on whether you are more interested in getting something quickly up and running (i.e. maybe not so interested in the electronics / hardware itself) or if you want to dive a little bit deeper into designing your own micro-controller circuit.

What if you need internet for your project?

For a long time, whenever I wanted my project to somehow connect to the internet, I did just order a Raspberry Pi Zero W. It was the smallest Raspberry Pi you could get for quite some time and it has built-in Wifi that is pretty easy to set up.

If you need help setting up your Pi Zero W, I have written a simple minimal setup guide to which I also come back whenever needed: https://mic.st/blog/minimal-setup-of-raspberry-pi-zero-w-with-ssh-over-wifi-connection/

Still, the Pi Zero is actually more of a small computer with a full Linux on top. It has all of the inputs and outputs you might or might not need and interacting with it always felt more like doing a project on my web server. I mean it’s cool and all but somehow this approach didn’t felt as exciting as working with micro-controllers. Luckily, there is a new gadget around for some time now, which is the Raspberry Pi Pico family!

Pi Pico

The Raspberry Pi Pico is equipped with Raspberry’s very own microcontroller, the RP2040 and if you get the Pi Pico “W” or “WH” version you also have wifi on-board. This means you get the lightweight feel of a microcontroller in contrast to the more web-server-ish experience of a Pi Zero W.

Of course you could also connect a wifi module (e.g. the famous ESP32) to your micro-controller. Still this requires more setup, eventually headaches and as cheap as the Pi Pico W is, personally I would not bother setting it up myself.

The default for programming a Pi Pico is C or C++ but you can install a “Micro Python” firmware which lets you program it using Python. However, it’s of course only a subset of Python (due to hardware limitations), it probably has some overhead and some stuff might not work as expected when coming from a usual Python environment.

Usually, I do program in Swift and I do not really like the syntax of Python whenever I use it. So, I might also switch to C or C++ at some point. But for beginners, Python might be a better choice.

Pimoroni’s addons

At Pimoroni you can get a lot of add-ons for popular development boards, e.g. sensors and displays which are fully compatible to Pi Pico, Arduino etc. I really love what they are doing 🥰 They also have preconfigured firmwares that let you start developing in seconds without having to install any drivers or fiddling around with data sheets.

Raspberry Pi Pico and Pimoroni add-ons (pico unicorn and pico scroll) laying on a table.
My order from Pimoroni plus some USB cable and another display from another shop.

If you consider starting a small project, I would recommend buying some Pi Pico there and some displays that look nice. A lot (if not all) of their displays have some buttons already on the PCB so you can also have a little bit of interactivity.

Pico Inky

One of the displays I ordered is the Pico Inky: https://shop.pimoroni.com/products/pico-inky-pack?variant=40044626051155. It is one of the more expensive ones as it’s not a standard LED / LCD displays. It is a real “E-Ink” display similar to what you get on an Amazon Kindle. This means it’s really nice for any projects where you want to show something that maybe needs a refresh only every few minutes or hours. You can even unplug it from any power and as it’s E-ink, it will still hold its content. Also it’s way friendlier to the eyes compared to the bright LED displays they do also offer.

How to get your display running

If you got your fresh Pi Pico and some display delivered, it is really easy to get everything up and running. Just plug the display on top of it, connect an USB cable, install their custom firmware and try any of their numerous demo projects. Here are the needed steps in a little more detail:

  1. Download Pimoroni’s custom firmware release for your device. These are available here: https://github.com/pimoroni/pimoroni-pico/releases. E.g. the custom Pi Pico firmware contains all the libraries and drivers you need to run the demo projects for all of their add-ons (Display, sensors, etc).
  2. Upload the custom firmware using “Thonny”. Thonny is also your IDE. It’s looking pretty basic but it does its job. You could also setup VSCode somehow but I did not bother yet.
  3. In case you are using the wifi version, make sure to download the “picow” version. First, I did not check this and wasted a lot of time trying to setup wifi manually 😅
  4. Add any of Pinoroni’s demo projects to your Pico Pi. The following are for the Inky pack, of course they have demos for anything else as well: https://github.com/pimoroni/pimoroni-pico/tree/main/micropython/examples/pico_inky
  5. Update and add network_manager.py and WIFI_CONFIG.py to connect to your wifi. You need to upload these to your Pi Pico’s root directory.
  6. In case you do need any other python libraries you can use Thonny’s built-in package manager or just upload any library’s .py file to your Pi Pico manually. E.g “urequest” was missing for me, you can download it here: https://pypi.org/project/micropython-urllib.urequest/#files

My first Pico Inky project

My first project with the Pico Inky is a little statistic display calling the endpoint of my iOS app’s (https://florra.app) in app purchases service (https://www.revenuecat.com/). It just fetches new data whenever I press button “A”. Pimoroni had demos for button input, display output and connecting to an endpoint so everything was kind of there already 🙂

The only hiccup I had was regarding the uurequests library used for doing server requests. As mentioned earlier any of the Python libraries are more or less lightweight. Regarding uurequests it does not really support adding headers. However, this is needed of course for basically any API that requires some auth token and is not completely public. I fiddled around trying to get urequest of urllib running (as this seems to have support for headers) but I failed installing it, got annoyed and ended up creating a simple PHP script on my personal webserver that calls the endpoint with the token.

Pico Inky showing stats fetched from revenuecat API.
My little RevenueCat status display using their API.

Conclusion

I hope this gave you a first glance of how easy and quickly it is possible nowadays to start electronics projects with micro-controller boards. In a lot of cases the Pi Pico W might be my new default.

However, as always it depends. The Zero W is only a few euros more expensive, it’s more powerful and more flexible (as it has Linux on top). But as long as you just want to drive some display with or without data from the internet, the Pi Pico with some Pimoroni add-on might be one of the best options.

Anyway, happy tinkering! I hope you got something from this little post 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *