The Raspberry Pi Foundation have released another single board computer. This time there is no SD memory card, no hdmi port or camera port because they have made microcontroller. A low powered device that can be programmed in C++ or Python to sense the world around.
The Raspberry Pi4 is great as a desktop computer in the Rpi range but requires a lot of power in comparison to the other Raspberry Pi's. If you want something more low powered then there is the Raspberry Pi Zero W which is a great device for sensors and building smaller projects. For some projects even the the Pi Zero seems over kill to just sense a button press or for motion detection, if you are not going to need Wifi to do something with the results. This is where microcontrollers are useful.
They run a small programs and manage inputs and outputs to real world devices. These microcontrollers are everywhere hidden away in everyday objects, often these are encountered where there is a control panel such as a vending machine, kitchen appliances, electronic toys.. There are loads of options around already for the hobbyist to build projects with microcontrollers. such as the Ardrunio boards amongst others.
So what does a Raspberry Pi microcontroller add to the current microcontroller market place?
I have always been interested in computing but didn't really get into electronics programming until the first Raspberry Pi was released in 2012. For Several of my projects I have thought a microcontroller would be a better option but it seemed you needed to know C++ for Ardruno and I didn't see any options for my preferred programming language of python. So I didn't pursue that route.
So for me a Raspberry Pi microcontroller that can programmed in C++ or MicroPython suddenly takes my interest. It is already familiar to me with similar GPIO features plus a few new ones and I can use my python knowledge to use with MicroPython. My first steps will be at a good pace.
So in answer to the question, it brings new users from the massive Raspberry Pi teaching and hobbyist community who will gain interest in a similar but different area of electronics. The Raspberry Pi Pico along with the BBC MicroBit will lead children, students and general users off into the diverse area of microcontroller programming with the wide range of boards available by many manufactures.
What can a Pico do that a Pi Zero W or Pi4 can't?
The Raspberry Pi single board computers are good at what they do but to make them a good all round machine at the low price some features have to be compromised. The limitations are usually are made available via add on boards for controlling servos, motors, analogue devices, real time clock. The Pico is able to use these devices natively.
The PI4 has 1 i2c, 2 SPi , 1 UART available as standard but these can be configured using the PI Operating system to have mutoiple of each. The Pico has mutiple features per GPIO pin which is selectable in your program.
Raspberry Pi Pico
Raspberry Pi 4
|Total Header Pins||40||40|
|User GPIO Pins||26||28|
|I2C - Inter-Integrated Circuit||2||1 (reconfigure to max of 6)|
|SPI - Serial Peripheral Interface||2||2 (reconfigure to max of 5)|
|UART - Universal Asynchronous Receiver/Transmitter||2||1 (reconfigure to max of 6)|
|PWM - Pulse-width modulation||16||1 (reconfigure to max of 2)|
|PCM - Pulse-code modulation||0||1|
|ADC- analogue-to-digital converter||3||0|
|PIO - Programmable IO||8||0|
The Pico can use analogue inputs where as the RPi4 only uses digital. Analogue inputs sense the change in voltage from devices such as a rotary switch as they are rotated or moisture sensor as they get wetter. Digital devices are just on or off and data specifically needs to be transferred to get readings such as temperature.
The Pico also has a new feature for any Raspberry Pi, 2 × Programmable IO (PIO) blocks,
8 state machines total Flexible, user-programmable high-speed IO Can emulate interfaces such as SD Card and VGA
Programming in Python
Micropython is the recommended python language on the release of the Pico. The default Python editor for the Raspberry Pi, Thonny, has been updated to use Micropython for the Pico directly from the interface.
There has been many setup guides to use Led's and Motion Sensors with the Pico to get started but I wanted to try it out with variouse sensors that use i2c such as a Spectral Light Sensor, Time of Flight device and Air Quality & Temperature sensor. This is where I found the difference with programming the microcontroller.
With python used on a desktop computer there are a wide range of libraries which work on any system. You type a few simple commands and you are off. With micropython there are libraries available for sensors but they are for specific devices or family of devices. This means that the code has to be adapted to the Pico.
When you want to communicate with the i2c sensor you have to specifically call memory addresses such as i2c.writeto_mem(0x39, 0x00 | 0x80, 3). This is usually hidden in the libraries of desktop python. After several hours rummaging around in datasheets and guides online I had no real results. So not as straight forward as I was hoping.
I then tried Circuit Python. This is an alternate version of Micropython adapted by adafriut that comes with libraries for their various addon boards and sensors. This was more like i'm use to. Drop a library on the Pico write your own code using the library and you are off.
As before thare are many microcontroillers and they all need different setups but Circuit Python standardises a lot of it. I still had to adapt the commands for the i2c pins I wanted to use but I found it far easier to use than Micropython and got results within an hour of starting.
I have not written my own program yet but getting the i2c connected AS7282 Spectral Sensor sending results to a SPi connects 1.3 inch ST7789 display felt like a win.
What I ike about the Pico, and probably all microcontroller devices, is that it dosn't need to be shutdown. So I can setup a VL53L0X Time of Flight sensor and ST7789 display for measuring or motion detection. Plug in the power and off it goes. When I have finished there is no shutting down, just switch of the power and it will be fine. This has been a limitation with a Raspberry Pi zero unless you have configured a shutdown button.
So in future it will be a decision between a larger Raspberry Pi, a Raspberry Pi Zero or a Raspberry Pi Pico on what is suitable for my projects and most probably other microcontroller devices as well.