Third party cookies may be stored when visiting this site. Please see the cookie information.

Home Family Days Out Raspberry Pi & Electronics Blog

Stewart's Blog

Stewart Watkiss website to the world ...

(Children, computing, first aid and other ramblings ...)

Raspberry Pi controlled Christmas Lighting including NeoPixels and RGB Matrix LED display

December 3rd, 2020

This video explains about the Christmas lighting display I have at my house and how it’s controlled using 3 Raspberry Pi computers. Two of these are automated, but one does require manual intervention to turn it on and off.

There are outdoor Christmas lights including Christmas Tree lights and light-up animals using LED lighting. These are run off mains electricity so needed a safe method to turn them on and off. I achieved this using the Energenie remote control sockets with a Pi-mote. See more about this in my Raspberry Pi home automation project

Christmas tree with decorations and Raspberry Pi controlled lights

There are also NeoPixels / addressable RGB LEDs which are controlled using my NeoPixel GUI application.
See video of the Raspberry Pi controlled RGB PixelStrip / NeoPixel LEDs and the Raspberry Pi NeoPixel LED GUI application.

Finally there is an RGB matrix LED display which I have programmed to play animations which are stored as a series of png files.
See more details on the video Raspberry Pi RGB LED Matrix display.

The animation shown is an animated advent calendar for the 1st of December. This is created manually by creating the individual frames in LibreOffice draw and then exporting them as individual PNG files. I also plan to create some more animations using Blender 2.9 using the 2D animation mode.
I’ve also created a video tutorial on 2D animation in Blender 2.8 and 2.9.

These are just some of the projects I’ve done using a Raspberry Pi.
You can find more on the PenguinTutor project page.

micro:bit v2 – New version of the educational coding tool

November 29th, 2020

The micro:bit version 2 is now available. This is a significant upgrade on the original micro:bit with a better processor, more memory, a speaker, microphone, touch sensitive area and more.

What is a micro:bit

The Micro:bit (or sometimes referred to as microbit) is a small electronic programming tool designed to teach coding to secondary school children (11 to 16 year olds). I have also used it in my Codeclubs with much younger children who have really enjoyed it. It was initially designed by the BBC and a micro:bit was given to each child in the UK in one year group during 2016. It contains a basic processor and can follow programs sent to it from a PC (Linux, Windows or Mac) or mobile device (Android or iOS). It has LEDs on the front which can be programmed to turn on and off individually, it also includes buttons to control the device, but also has an accelerometer and also supports Bluetooth for wireless communications.

It has an edge connector which can be used with crocodile clips (alligator clips) to connect to external electronic components, or connected to a certain addons for additional connections or to control a robot etc.

What’s new in the micro:bit version 2

The new version has a better processor as well as doubling the available RAM memory from 16kB to 32kB. This should increase what it is able to do.

It now includes audio support directly on board through a new built-in microphone and a small piezo speaker. It also adds a touch sensor to the micro:bit logo.

micro:bit v2 - new version 2 of coding device

Programming the micro:bit using MakeCode (by Microsoft)

There is a MakeCode editor available on the web which is created by Microsoft. This supports a drag and drop programming environment which works with code blocks. There is also a Javascript editor and the ability to move between the two. Through these you can download the code in the form of a hex file to your PC and then transfer it to the microbit as a USB drive. Alternatively you can connect directly and send the file direct from the Chrome (Chromium) browser to the micro:bit.

Programming the micro:bit using MicroPython

The micro:bit also supports micro python. This is a slimmer version of the regular Python programming language designed for low spec devices such as the micro:bit. This can be programmed through the web browser.

It is also possible to use the Mu editor to create code on a PC and send that to the micro:bit.

The one issue with Micro-Python on the version 1 micro:bit is that there was insufficient memory to include the Bluetooth code and still be able to run other programs. With the new hardware the version 2 has more memory, so hopefully this is something that can be improved in future (the documentation does not list which new features are now supported, but the code is in active development).

Summary

The micro:bit is a really useful tool for teaching programming to children. The new micro:bit v2 adds more features and makes it even better. The only downside is that for those with existing micro:bits then it may not be possible to use the new features in a classroom environment if there are insufficient version 2 models for the whole class.

New book – Learn Electronics with Raspberry Pi (second edition)

November 26th, 2020

My new book is now available. Learn Electronics with Raspberry Pi (2nd Edition).

This is an update on my first book which is now over 4 years old. My first book sold well and was even translated into Chinese. This new edition is a significant rewrite, bringing it up-to-date, but also improving the educational style, adding more projects and a new chapter on understanding Digital Logic Circuits.

The book provides a fun way to learn electronics and physical computing using a Raspberry Pi and electronic components. It is designed for beginners to intermediate makers starting with Scratch, developing further with Python gpiozero and even covering how to design your own circuit and have it made as a custom PCB.

When coming up with ideas for the book it started out as a projects book, but then I thought it would be useful for it to be educational rather than just covering projects. I added descriptions on how the projects worked and how to design your own projects, but it was mainly centered around projects. In this second edition I’ve been able to develop that further and provide more structure. In doing so I’ve expanded on the existing chapters and added new ones such as how different kinds of motors work. As well as explaining DC motors as I did before, it now also covers servo motors and stepper motors which are popular for use in electronic circuits. I also expanded the robots section to include some new robots that are now on the market including the STS-Pi robot, a tank robot and a mecanum wheel based robot that I 3D printed.

For more details see: Learn Electronics with Raspberry Pi book (with chapter details)

Learn Electronics with Raspberry Pi - 2nd Edition book

Buy the book

You can buy the book direct from Apress. Or from other book sellers. If ordering from an independant seller then quote ISBN 978-1-4842-5649-7.

If you do order through Amazon then please leave a review and let me know what you think. It’s very useful to have feedback when working on future books.

I’ve already covered some of the projects on the PenguinTutor YouTube channel and I’ll be adding some more videos soon, so please subscribe to my channel if you haven’t already.

Python testing made fun – testing code using unittest

November 9th, 2020

This video explains the benefits of using Python testing when programming. This is intended for makers who are coding software for physical computing, hobby software programmers and those looking to learn about software programming through school, college, university or adults looking to increase their skills.

Without any automated testing bugs can be harder to find and fix. Whilst I don’t believe every piece of code should follow a formal structured testing schedule adding some tests to your code can be beneficial and can be enjoyable by allowing you to spend more time on the main programming and can in itself be fun.

The video covers some of the theory behind testing programming code, including test-driven development, code coverage, data coverage and generating tests using code. The practical example shows creating some simple code to perform testing of python code using unittest. It then shows how they can be stored in a separate directory and how they can be run very easily when updating software code.

Raspberry Pi matrix animation display project.

Python Unittest library documentation.

Remembrance Day 2020

November 8th, 2020

Raspberry Pi RGB LED Matrix Display - showing field of poppies

Each year, I normally attend a service at the local war memorial to remember members of the armed forces who have died in the line of duty. This has usually been in uniform as a member of the Scouts or in the past as a member of St. John Ambulance.

Due to the Covid-19 situation I will not be attending this year, but I will be observing the 2 minutes silence at home, standing on my doorstep in my Scout uniform, along with my family.

I have also created the following video which is playing outside my house using a Raspberry Pi and a Matrix display.

For more details see Raspberry Pi Matrix RGB LED Display project.

Please stay safe, wear your poppy, and remember those that gave the ultimate sacrifice to protect our freedom.

Raspberry Pi Microscope with High Quality (HQ) camera

November 2nd, 2020

One of the great things about the Raspberry Pi is it’s versitility which allows it to be used in many different ways. The introduction of the high quality camera module has greatly increased the scope of what can be achieved in digital photography. This has been expanded further thanks to a professional quality lens now available from Pimoroni.

Raspberry Pi High Quality Camera Microscope

The camera module mounts directly on top of the lens which is available with a stand turning the Raspberry Pi into a professional quality microscope.

In this video review I look at some electronic components under the microscope and how useful the microscope is for a maker / electronic hobbyist. This includes zooming in on solder joints to look for faults or using it to assist with soldering SMD devices.

One thing I did learn was that light is key to getting good results with the microscope. You need a lot of light up and close to the subject to be able to see the items clearly.

Below are some of the photos taken within the microscope. Click on the image for the original full-size image.

Arduino image centered around the reset switch

Photo of an Arduino taken with a Raspberry Pi High Quality camera and a microscope

ATMEGA328P image showing the hard to read writing

Photo of a ATMEGA328p taken with a Raspberry Pi HQ camera and a microscope

Raspberry Pi image showing the Raspberry Pi logo

Photo of a Raspberry Pi logo on the Raspberry Pi, taken with a Raspberry Pi HQ camera and a microscope

Raspberry Pi Halloween Animated Light Display – RGB Matrix LED display with pumpkin and PIR sensor

October 29th, 2020

My Raspberry Pi Halloween project for this year is based around the Raspberry Pi RGB matrix display project. I have put the RGB Matrix outside of my house and wanted to display a Halloween animation on the display. I also wanted to include a PIR sensor which changed the display when someone approached the display. Changing from a friendly pumpkin jack-o-lantern display, but then changing to a scary pumpkin when someone approaches.

To display the animation I needed to create my own program code which could handle displaying static images and animations using PNG files. I also designed my own PIR mount using FreeCAD which allows the PIR to be mounted on the bottom of the LED matrix picture frame. This uses a program created in C/C++ (for maximum performance when displaying images) and a separate program which detects people using the PIR sensor and changes the images / sequences ate the appropriate date and time.

Halloween pumpkin animation powered by a Raspberry Pi and RGB matrix LED display

The code is available on GitHub, but please check the latest status as it’s under active development:

Raspberry Pi RGB matrix display project – step-by-step instructions

Code for Raspberry Pi RGB LED matrix image viewer and animation / video player

Download the files used in the Halloween 2020 Raspberry Pi RGB matrix LED display

Raspberry Pi official Ubuntu 20.10 Desktop Image – running a 64-bit desktop linux on the Raspberry Pi

October 26th, 2020

With the release of Ubuntu 20.10 the Raspberry Pi now gets an official desktop version of the popular Linux desktop. In the video below I go through the install and initial experience running Ubuntu desktop on the Raspberry Pi.

Getting started with Ubuntu desktop on the Raspberry Pi

Before you rush out to install there are a few caveats. You will need a Raspberry Pi 4 with at least 4GB of RAM. In the video I have an 8GB version. You also need to have a fairly large capacity micro SD Card. It needs around 9GB of usuable space on the SD-Card so effectively that means you need a 16GB or larger card.

Although the initial setup is through the standard Raspberry Pi imager it then continues much of the setup when plugged in to the Raspberry Pi which is slow (I’ve had to speed up many parts of the video by x10). Once the install is complete then it is not as fast as running Raspberry Pi OS (as you would expect with a full Gnome desktop environment). It takes a long time to boot and login, and launching applications feels quite slow as well. Although it is fast enough to be perfectly usable once you get past the boot and login.

There is no VNC server installed as standard (RealVNC is included with Raspberry Pi OS which is excellent, but that is commercial software provided free for individual use on the Raspberry Pi). Instead I installed X11VNC which works well, but you need to launch it on the Raspberry Pi first.

There don’t appear to be any of the Raspberry Pi specific libraries installed by default. It does look like these can be installed separately (such as Python 3 gpiozero), but I haven’t yet had time to test these. Hopefully I’ll add that to a future video.

If you have a Raspberry Pi 4 with lots of memory and you want a 64-bit operating system, and you want to run the full Gnome environment then Ubuntu 20.10 is now available. If you are more interested in running the same operating system as other Raspberry Pi models, want to get the best performance, or want the programming support for the GPIO “out of the box” then the Raspberry Pi OS still has the edge. It’s good to have a choice and it’s free so if you already have the hardware then it’s worth giving it a go.

Ubuntu Raspberry Pi webserver using Ubuntu server edition

If you don’t want the full desktop experience, but want to run it as a web server then I’ve already created a review of Setting up a webserver using Ubuntu 20.10 server edition (beta). I’ve included that video below:

More on Ubuntu for Raspberry Pi

If you are interested in seeing more on Ubuntu for the Raspberry Pi then please visit the PenguinTutor YouTube channel. Please leave a comment on one of the videos if there is something you’d like me to cover in a future video and please subscribe to find out more about my posts on maker topics including the Raspberry Pi.

Arduino Vs Raspberry Pi – Microcontroller Vs Computer for maker projects

October 12th, 2020

In this video I look at some of the features of the Arduino and the Raspberry Pi to see which is the best fit for your project.

Whilst it starts with the answer “it depends”, it gives scenarios where each is better and for those where either is a good fit I’ll give my own opinion of which is best.

I then explain about how you can get the best of both by combining a Raspberry Pi and Arduino and what the options are for communicating between the two.

This is really an introduction into a future video showing how both can be used together.

See more Arduino Videos on this playlist

Please subscribe to the PenguinTutor YouTube Channel to be notified of future videos.

Beginners Guide to the Arduino

Creating 2D Animations using Blender 2.8 and Blender 2.9

October 5th, 2020

Blender is well known as a 3D modelling tool, but it is also good for creating 2D animations. It includes the ability to create timeline based animations using Keyframes with automatic tweening and fine control over all the objects.

If you don’t know what that means then hopefully this video for beginners will provide a useful introduction. I’ve also created a video on using the shader editor for those ready to take the next step towards mastering 2D animations.

It’s always been possible to create 2D animations in Blender, but the video above introduces the new 2D Animation option on Blender 2.8 and Blender 2.9. This isn’t a separate tool, but a different workspace, and arrangment of the tools and camera to make it easier to create 2D animations. This is particularly useful for creating 2D animations which can be included in your YouTube videos. This is a relatively new feature which was introduced in Blender 2.8. It does not work with Blender 2.7 or earlier.

The tutorial is a beginners tutorial video which goes step-through-step explaining the process needed to create the animation. The example shown is of a airplane which flies across the screen.

2D Animation in Blender 2.9 - hiding an image

For the images it uses the Blender Add-on “Import-Export: Import Images as Planes”, which makes importing the images easier. It also demonstrates how text can be used in a 2D animation.

The technique used for hiding the image is to exclude it from the render. This is a simple technique for beginners, but does not offer much flexibility. I will provide details of how to use the Shader Editor in a future video.

Using the Blender Shader Editor

This video gives a much better way of manipulating images in blender by using the Shader Editor to manipulate the material output.

This provides a way of hiding the 2D images, but also shows how different textures can be used including using an image mask to hide parts of another image, all within blender. This solution also works well with keyframes and as well as rendering better.

The Shader Editor provides a way of performing mathematical operations on the alpha value which changes the transparency on a pixel by pixel level of details.

There are other textures that can be applied to the image and material.

The final example shows how a image mask can be used to show bullet holes in a plane.

The image files used in this 2D animation are the same as the files shown above.

An example video

Another example showing a simple animation in blender is included below. This shows a simple hammer and screwdriver example.

Twitter Status - follow stewartwatkiss


UK days out, children and holiday information is also available on the Days Out Diary web site
Linux, LPI and the Quiz / Test Program posts are also available on the Penguin Tutor website
First Aid Information, first aid games and first aid practice test / quiz entries are also available on the First Aid Quiz Web site