Plant moisture detector uses a Raspberry Pi Pico for a low-cost, easy to implement project – the 3D-printed enclosure is an added bonus

Spencer Organ recently went to the virtual Preston Raspberry Jam which had a gardening theme to talk about his project – a Raspberry Pi Pico watering can. You can see the innards above. Costing under £15, the project helps to monitor a single plant (in Spencer’s case a Sweetpea plant) and tell you the soil moisture level. The level is displayed  as a nice graph on a cheap SSD and the whole thing is powered by a Raspberry Pi Pico. A 3D-printed enclosure in the shape of a watering can keeps the whole thing tidy.

You can find details, including how to reproduce it, on Spencer’s Maker Cupboard blog.

You can watch Spencer talk about his project by going to this YouTube video – open up the full description of the video and then click to skip directly to his talk.

Taking the Cytron Maker Pi Pico out for a spin with the Raspberry Pi Pico

Tony Goodhew has been in touch about some experiments he has run on the new, low-cost Maker Pi Pico from Cytron. TL;DR – here’s the Instructable.

In the UK, the Maker Pi Pico is available from The Pi Hut (also as a version without the Pico pre-soldered, but with header sockets). Other distributors around the world can be found at the bottom of this page. The board is very well thought-out and contains a whole raft of features:

  • Access to all Raspberry Pi Pico’s pins on two 20-way pin headers.
  • LED indicators on all GPIO pins.
  • 3x momentary push buttons
  • 1x RGB “NeoPixel-like” LED
  • 1x Piezo buzzer
  • 1x 3.5mm stereo audio jack
  • 1x microSD card slot
  • 1x ESP-01 socket
  • 6x Grove ports

Tony’s experiments are written in CircuitPython and cover using the GPIO pins, reading from the SD card, using a potentiometer on an analog input and using an SSD1306 display to show results from various inputs including a Pimoroni BME680 breakout board.

You can read the Instructable here and you can see one of his demo videos below:

The PicoPicorder – a work-in-progress prototype using a Raspberry Pi Pico and lots of components from Pimoroni and Adafruit!

During March, and for the past week as well, I’ve been working on the latest iteration of my Picorder project. This project, which has been my “go-to project” for the past 9 years (gulp!) is now running from a Raspberry Pi Pico and uses lots and lots of sensors and a touchscreen. You can read all about the project on this page which I will update as I develop and improve the project. Let me know what you think of it so far! All my code is open source and available on GitHub.

Trying out a Raspberry Pi Pico carrier and experimentation board – the Pico 360

It’s always nice when something new arrives in the post and it’s unexpected! Andrew Gale from PocketMoneyTronics has done great things in the past with his subscription-based soldering kits. This time, he has created a carrier board for the Raspberry Pi Pico which helps you to get going on coding with simple components. It is called the Pico 360 and it comes as a solder-it-together-yourself kit.

TL;DR – if you want one, it’s £3.60 (not a typo!) for the kit (not including the Pico itself) and it’s available over on Etsy.

Kit contents

The components are as follows:

  • The PCB
  • 6 red LEDs
  • 1 yellow LED
  • 1 green LED
  • Resistors for all those LEDs
  • 2 momentary buttons/switches
  • 1 piezo buzzer
  • 1 trim potentiometer
  • 2 sets of female header pins (for the Pico to plug into)
  • 1 set of male header pins (to breakout some extra pins)
  • 3 sticky nubs to go on the bottom

The genius move in this case is to include 5 pads which can be attached to with crocodile clips, making this excellent for education where re-use is as important as anything else.

Putting it together

Soldering it together was simple and is best done, in my opinion, in the following order (from lowest height to highest height):

  • Resistors
  • Buttons
  • Potentiometer
  • Buzzer
  • LEDs
  • Male header
  • Female headers

The components are all through-hole, so it should be easy for someone with even “beginner” soldering skills. The only thing I did find was that some of the pads are quite close together. I only had one “oops” and needed a solder sucker. That’s about average for me, anyway!

Once soldered together, I plugged in a Raspberry Pi Pico (which I had already soldered male headers onto).

Example code and video

To my delight, I was able to get all of the included components working straight-off-the-bat by using CircuitPython (which happened to be loaded onto the Pico). My code is here on GitHub as a Gist and you can see the code in action in the video below. If you want a MicroPython demo program, you can find that on Andrew’s website.

Summary and recommendation

This is a great idea for education, especially, and for beginner hobbyists just getting started with the Pico. There are enough components to keep the ideas flowing, and it’s a breeze to solder together. The soldering might put off some educators, of course, but I daresay it will be popular anyway. Who knows? There could be enough demand to do a surface-mount pre-assembled version…

Either way, great job, Andrew! This comes highly recommended!

More information

Andrew has written about the kit over on his website.

Buying the kit

The kit is available for an impressive £3.60 over on Etsy.

Using Sublime Text 3 to code with your Raspberry Pi Pico

There are, of course, many options when it comes to editing files. Raspberry Pi’s suggested way of coding for the Raspberry Pi Pico is to use Visual Studio Code. I must admit, I struggled to get on with it. In order to make my life easier, I wanted to use Sublime Text 3, which is what I use for work. Familiarity with your IDE/editor helps a lot when you’re doing something new, so I looked at how I could use it. I’m on Windows, so expect those kind of file paths 🙂 I’m also using CircuitPython which means the Pico presents itself as a drive on your PC (like a Removable Disk).

First steps – direct editing

To start with, I created a Project and added the CIRCUITPY drive to the project. That way, I could see the files on the drive and just edit them.

I experimented for a while and tried to use the serial_monitor plugin to see the device and access the REPL. This plugin, though, doesn’t allow interaction at that level, so I’ve stuck with Putty for now. I have Sublime Text open on one screen and Putty on the other, but if you’ve only got one screen, just split it using Windows’ in-built facility.

Version control using Git / File synchronisation with the Pico

Of course, eventually you’re going to want to keep your code version controlled and backed up on GitHub… right? I mean, you wouldn’t want to just keep it on your Pico and then accidentally lose it? And version control is good, correct? Say “Yes, Mike”. 🙂

Having your repository keyed to be on the Pico itself is pretty bad form, in my opinion. Instead, you need a place for your code off of the Pico. This makes sense – that way if you want to do Git commits and pushes, you can do it from your hard drive, rather than direct from the Pico. But how to keep that “local” code in step with the Pico? That’s where file synchronisation comes in.

I looked at a few options, but what I really wanted was for the file system to be monitored for changes and then the code file(s) that had been changed to be automatically copied onto the Pico. I came across the FSync plugin. It is pretty bare bones, but it does what I want. You’ll need Package Control installed (see here for instructions). First of all, add a repository to Package Control and enter https://github.com/weverss/FSync into the text box. This links your ST3 installation to the specific GitHub for the plugin. Then, install the package by searching for FSync. Restart Sublime Text 3 and the package will be installed and ready.

In your menu, go to Preferences->Package Settings->FSync->Settings – User.

This will open up a blank file.

Now, go to Preferences->Package Settings->FSync->Settings – Default. Copy the whole thing and paste it into your User file and save it.

Now, edit the local_workspace and remote_workspace settings. Set them according to the location of your local folder and your Pico drive. Use / as the path delimited and do not add a trailing /.

Here’s mine:

{
    // File extensions list to ignore during sync
    "ignore_extensions": [".FSync", ".svn-base", "wc.db"] ,

    // WARNING: In both settings below, don't finish directories with '/'

    // Local directory to work...
    "local_workspace": "D:/Projects/Raspberry Pi/Pico/Pico Picorder/PicoPicorder (code)",

    // Remote directory to sync files from local directory ('local_workspace' setting above)
    "remote_workspace": "E:" // Don't finish it with '/'
}

Save it.

Now, what you should find is that each time you save a file in your LOCAL folder, it copies it to the CIRCUITPY drive.

And, because you have now moved your code to a local folder, you can now add it in the usual way to a GitHub repository.

Indentation

Don’t forget to change your Sublime Text 3 indents to “Spaces: 4”. This is at the bottom right of the screen in the grey strip. This is important as all the Adafruit libraries (and, indeed your code!) should use 4 spaces, not a tab character, otherwise you get indentation errors when it runs on the Pico.

Create a low-res thermal camera with a Raspberry Pi Pico, an AMG8833 sensor and an ILI9341 screen with CircuitPython

As part of an ongoing Raspberry Pi Pico-based project, I wanted to create a thermal camera. To do this, I first of all went shopping to find what I needed. Here are the two components for this mini project:

They’re not cheap components, but they’re what you need. You can get a better thermal sensor. This one is only 8×8, so quite low-resolution, but you get some nice results out of it (see the video below).

I chose CircuitPython for the project, because I’ve learned by now that CP has an enormous number libraries.

As always, Adafruit have provided great guides to both products. The screen tutorial is available here and deals with both wiring up and programming it. The tutorial for the AMG8833 thermal camera (there are two types of breakout boards for the sensor) is available here.

How to combine them, though, that’s the trick. I found this tutorial which uses an Adafruit Pygamer board and the Featherwing version of the AMG8833 breakout. This was enough to get me going with translating the array of pixel values returned from the camera denoting sensed temperatures into colour blocks. I had to strip out a lot of functionality relating to the Pygamer board, which was a bit of a pain if I’m honest, but what I was left with should fit nicely into the project I’m working on.

Here’s the wiring that I used:

and you can find my stripped-down code on GitHub. You will need to save the code onto your Pico as code.py to make it run automatically on power-up. You will also need to copy over some libraries to your Pico, so just take a look at the imports at the top of the code for those. You can find the library bundle here.

Here’s the result of the mini-project: