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 ...)

From 2D maps to 3D models with FreeCAD

November 28th, 2021

In the video below I show how you can take a 2D map and create a 3D model using FreeCAD. This is a manual process in mapping the contour lines from an OS map into FreeCAD. The model can then be printed using a 3D printer, or viewed online as a static image or through a 3D viewer.

I used this to help teach map and navigation skills to Cub Scouts. This helped them to visualise the contours so that they could understand how steep a hill is by looking at a map. This could also be a useful technique if you would like to visualize a hill before your walk or to create 3D models of places you have visited.

The example map used in the video is an Ordnance Survey Map, known as OS Maps. Ordnance Survey are the national mapping country for Great Britain and the standard for walking maps. You can use alternative maps (including Google Maps). OS Maps provide a free “standard” level map which is available through a free account. They also provide a premium account which provides additional maps, if you wanted more detail.

The maps are available online from https://osmaps.com/ .

3D Model of Lickey Hills

The map is first imported to FreeCAD using the Images Workbench. If you include the map scale on the map then you can set the scale using the scale tool. In my case I set a scale of 1mm to 1 meter. This makes it easier to determine the correct value when using the pad.

I then created a body for each layer and created a sketch mapping out one of the contour lines using the b-spline tool. This is achieved by clicking onto the contour line at regular intervals, zooming in and scrolling around the FreeCAD model as required.

The resulting sketch could then be extruded into a 3D object using the pad tool.

This was repeated with a new body, sketch and pad for each contour layer. I cleaned up the edges by cutting away any excess using tools in the FreeCAD part workbench.

Once it’s complete then it can be exported as an STL file which can viewed through a 3D viewer or imported to your slicer software for 3D printing. Depending upon the size of your model and the bed size of your 3D printer you may have to scale the model in the slicer so that it can be 3D printed.

For one of the models I printed it on white PLA and then using a sharpie I added some of the map symbols to help show how the map and the 3D model related to each other. This is of the local area of Redditch so the Cubs could also associate it with the places they know.

3D Model of Redditch with OS map symbols

Download 3D Models – FreeCAD and 3D printer files

Also see Walks in the UK from Days Out Diary

Pip – Raspberry Pi based Games Console / Development Device – Preview

November 8th, 2021

This is an initial review of the PIP. The PIP is a Raspberry Pi handheld games console from a successful Kickstarter.

Pip Raspberry Pi handheld games console

The pip has been a long time coming – arriving approximately 3 years later than planned, but they have finally reached the point where they are sending out preview models for backers that have requested an initial version. The rest of the backers will get theirs soon once the software is ready.

The hardware looks great, but the current software is limiting. There is no graphical interface and so there is very little you can actually do with it at the moment.

I was hoping to use the pip with the games that I wrote for my book Beginning Game Programming with Pygame Zero.

I hope to follow this up with another video in future once there is a full graphical interface and it’s possible to create graphical games to run on the pip.

For more details about the PIP see www.thisispip.com. For more details about the software see Pip hardware preview page.

New Raspberry Pi Zero 2 – The maker’s choice of Raspberry Pi

November 1st, 2021

The Raspberry Pi Zero 2 W is an updated version of the Raspberry Pi Zero. It uses the same form factor and has the same connectors in the same position, but what it does have a huge performance increase. It is only a tiny bit more expensive than the Pi Zero it replaces.

Raspberry Pi - Pi Zero 2 W

In the video below I explain about the board and how it is now perhaps the best choice for many maker projects. To test the new Raspberry PiZero2W I used the example of using NeoPixels with the Raspberry Pi Wi-Fi NeoPixel Server.

Updates Required

Please note that I had to make some modifications and recompile the rp_ws281x library. I then had to install the rpi-ws281x-python libraries against the updated library.

I created a pull-request so the updates are no in the main library. If you want to use them now then you will need to compile from source, but hopefully it shouldn’t be too long until these updates are included in the Raspberry Pi OS and PIP.

Raspberry Pi Projects

See some maker Raspberry Pi projects

Halloween – Raspberry Pi and Arduino Trick or Treat Trolley

October 31st, 2021

This year I did a trick or treat with a difference. I supported the local Scout group going around door to door, but instead of asking for sweets we asked for donations for the local support group / food bank.

As you can imagine the tins of food and non-perishable items weighted quite a bit more than candy and sweets which were lucky to get as far as a collection bag. We therefore used a trolley to collect the donations, and of course I pimped up the trolley with Raspberry Pi and Arduino flashing lights and color changing pumpkin.

Rasperry Pi and Arduino powered Trick or Treat trolley for Halloween

This is all based around my current NeoPixel based projects.

I’ve created a YouTube #shorts video showing the trolley in action.

As well as using my new custom PCB for the Arduino Nano RP2040 connect (based on the same processor as the Raspberry Pi Pico), this uses the new Raspberry Pi Zero 2 W.

The new PiZero2 has only been out a few days and I had to make some changes to the WS281x (NeoPixel) library to get it to work, but I’ve submitted a pull-request to get that included in the default library in future.

For more Halloween Projects see: Raspberry Pi and Arduino Halloween Projects

Raspberry Pi Zero 2 W

The Raspberry Pi Zero 2 W is an updated version of the Raspberry Pi Zero. It uses the same form factor and has the same connectors in the same position, but what it does have a huge performance increase. It is only a tiny bit more expensive than the Pi Zero it replaces.

In the video below I explain about the board and how well it works for a maker project using NeoPixels with the Raspberry Pi Wi-Fi NeoPixel Server.

Updates Required

Please note that I had to make some modifications and recompile the rp_ws281x library. I then had to install the rpi-ws281x-python libraries against the updated library.

I created a pull-request so the updates are no in the main library. If you want to use them now then you will need to compile from source, but hopefully it shouldn’t be too long until these updates are included in the Raspberry Pi OS and PIP.

Oh no! Something has gone wrong. Ubuntu upgrade 21.04 to 21.10 fails – here’s how to fix it.

October 19th, 2021

I recently upgraded my laptop from Ubuntu 21.04 to Ubuntu 21.10. Unfortunately it failed with the message:

Oh no! Something has gone wrong.
A problem has occured and the system can’t recover. Please log out and try again.

This sounded like it would leave the system unusable, but by switching to a terminal and booting into recovery mode I managed to fix this. This is explained in the video below:

This is a summary of the commands that I issued:

New terminal:
Ctrl-Alt-F3
Check that the upgrade wasn’t running

Boot into recovery mode with root shell
Configure the packages that were partially installed
dpkg --configure -a

Fix broken packages
apt --fix-broken install

Restart the upgrade
apt upgrade

Install Displaylink Drivers (see below).

Use Ubuntu upgrade tool

Install Firefox
sudo snap install firefox

Or to continue with debian dpkg firefox (faster startup)
sudo apt install firefox

Oh no! Something has gone wrong. Ubuntu upgrade fail

Also see the following video for how to install the DisplayLink drivers on Ubuntu (21.04+).

Supporting England Raspberry Pi Matrix Display for Euro 2020 Final

July 10th, 2021

This is a YouTube #shorts video showing my animated display supporting England Football team in the Euro 2021 final. This is controlled using a Raspberry Pi, which displays the animated video on a RGB LED Matrix displayed outside my house.

More details of the display are available from my Raspberry Pi RGB LED Matrix Display Project.

The animation is created using my PGZ Animation library. Which enables you to create video animations using simple Python code using the easy to use Pygame Zero. This is one of the reasons for creating PGZ Animation and it worked really well for this video. Find out more about PGZ Animation – guide to FREE tools for creating animations using a Linux computer.

I am working on other examples of animated videos created using PGZ Animation and Pygame Zero.
Please see the PenguinTutor YouTube channel for future videos.

England Raspberry Pi Matrix display

How to Create Animations for Free and Introducing PGZAnimation

July 4th, 2021

This post has three aims based around my latest YouTube video on creating 3D animations.

The first is to shows some FREE options for creating 2D animations on Linux, Windows and other operating system. Second is to ask the viewers if they have any other alternatives that I’ve missed (preferably ones with easy to use scripting / programming APIs). Finally to introduce a new programming library that I’m working on called PGZ Animation.

The best way to understand this is to watch the video below, then come back here to see some useful links for more information about the various tools.

Don’t forget to Subscribe to PenguinTutor on YouTube and click the notification icon to get notified of future videos. I’d also love a thumbs up if you enjoy the video.

Free and Open Source 2D Animation Tools

In the video I look at three different tools.

LibreOffice Impress (and Draw) with Simple Screen Recorder

The first 2D animation tool I look at is LibreOffice Impress. This is not a full 2D animation program like the others that follow, but can be used for simple visual effects. It does not include export as an animation, but using other tools such as Simple Screen Recorder it is possible to capture animations for use in a video.

Unfortunately Impress does not include features required for more complex animations, such as a keyframes and custom animations, but it is quick and easy to use.

An example of this in use is my video series on Digital Electronics.

Synfig Studio

Synfig Studio is a real 2D animation tool with all the features you expect, such as keyframes and automatic tweens. It is however quite difficult to use. An example is that changing fonts etc. is much harder than LibreOffice.

An example of a video I’ve created using Synfig Studio is:

Blender

Blender is a very powerful 3D design and animation tool. It is a professional tool used to create some amazing models and animations. It does have a steep learning curve. There are lots of resources available for Blender, but not many feature the 2D animation aspect. I’ve created my own videos explaining the 2D animation mode.

Any Alternatives?

If anyone has any alternatives then please let me know. I’m particularly interested in ways of creating animations using code which will allow for loops and variables.

The best way to let me know about alternatives is to leave a comment on my video on creating 2D animations. Alternatively you can contact me via other social media platforms.

PGZ Animation

My own alternative is called PGZ Aninmation, which stands for Pygame Zero Animation. It’s a Python library based around Pygame Zero. It allows you to create animations using simple code. The code is in Python based around the, easy to use, Pygame Zero. It includes special animation classes which I’ve created which make it trivial to create certain types of animations and tweens.

It’s in early development at the moment but the intention is to make it easy to create animations using simple code. In future it may even include a simple mark-up language, but that depends upon whether that is something that people would find useful.

One use for this is in creating animated electrical and electronic diagrams.

Animated electrical / electronic circuit diagram

More Information

See the PGZ Animation introduction information.

Or Download PGZ Animation – coding based animation tool from GitHub

RC Remote Control for a Raspberry Pi Pico

June 19th, 2021

One of the things missing from the Raspberry Pi Pico is the lack of network connectivity. There are other models that do provide that such as the Arduino version of the Raspberry Pi Pico – The Arduino Nano RP2040, but there are alternative ways to communicate. In this case I had an RC remote control which I thought would work well.

Model airplane RC transmitter and receiver used for a Raspberry Pi Pico

The model I used is the Flysky FS-i6 which is relatively inexpensive controller for RC model planes. Although designed for model airplanes it can be used with other models and in this case to send signals to a Raspberry Pi Pico. You could also use other types of controllers such as those designed for cars or boats, as long as they provide a PWM output pulse typically used for controlling servo motors.

In the video I show how I used a logic analyzer and digital oscilloscope to check the signal and how I set about creating the code to detect the PWM duty cycle on the Raspberry Pi Pico. This can then be used to control other devices such as robots or animatronics.

The demonstration source code for detecting the RC signals on a Raspberry Pi Pico is available from the link below.

Upgrade of laptop to Ubuntu 21.04 – Including how to use DisplayLink for USB-C and Wayland vs X.org

May 24th, 2021

I was holding off on upgrading my laptop to Linux Ubuntu 21.04 due to the bug that could leave computers unbootable. Since then I’ve been had the “Do you want to upgrade” message so presumably that’s been fixed. I went through the upgrade process and upgraded my laptop to Ubuntu 21.04.

I did come across two problems during the install. The first is that I have a USB-C dock which uses displaylink, the other relates to the new Wayland compositor and some applications that are not able to work correctly with Wayland.

Ubuntu 21.04 linux desktop screenshot

The displaylink drivers needed to be re-installed, but before this I needed to switch to the open source drivers Nouveau otherwise the screen wouldn’t load. In this video I explain how to change to the open source drivers before installing the displaylink drivers and even how to switch drivers if you end up with a system that boots up without a working screen driver.

Wayland compositor vs X.org - Ubuntu 21.04 Linux

I then show an example of an application that doesn’t work with Wayland (Simple Screen Recorder) and explain how you can switch between Wayland and X.org.

Ubuntu 21.04 on Raspberry Pi

Also see Guide to installing Ubuntu 21.04 desktop 64-bit linux on a Raspberry Pi 4.

RPi Ubuntu 21.04 – 64-bit Linux for Raspberry Pi

April 29th, 2021

There is a new version of Ubuntu which is now at version 21.04. The version number consists of the year and month it was released so this is from April 2021.

For this version (and the previous version 6 months ago) the Ubuntu releases now include a version of the 64-bit desktop version for the Raspberry Pi. I haven’t upgraded my PC yet because of a bug that’s resulted in a delay to the upgrades. The bug is mainly for older hardware. It shouldn’t be a problem with my laptop as it’s fairly modern and new installs should work okay. The bug won’t affect the Raspberry Pi version.

Installing Ubuntu 21.04

Installing Ubuntu on the Raspberry Pi is just as easy as Raspberry Pi OS. There is however one caveat in that you need a SD card with more than 9GB of space, so effectively you need at least a 16GB SD Card. This shouldn’t be a problem as that should cost less than £10 these days, but it does mean if you have a 4GB or 8GB SD card (I have dozens of theses) then you can’t use it for Ubuntu.

When you first boot with the new image then you need to spend a short time going through the setup process, but it just takes a few minutes to get up and running.

Installed applications

By default the desktop includes Firefox web browser and the usual LibreOffice. So there is everything you need to get started. It doesn’t include any programming applications that are included on the Raspberry Pi, but these can be installed through apt or the software installer.

Raspberry Pi OS vs Ubuntu

In the video I explain about some of the pros and cons for both the Raspberry Pi OS and Ubuntu. A summary is shown below.

Raspberry Pi OS vs Ubuntu

Which is best?

Choosing a distribution depends upon what you want to do with it and your personal preferences. If you are wanting to use the Raspberry Pi for programming and accessing the GPIO ports then Raspberry Pi OS. You will also need to use the Raspberry Pi OS if running on an older Raspberry Pi or the Pi Zero.

If you want to run a modern looking, 64-bit Linux distribution on a Raspberry Pi 4 then you may want to use Ubuntu.

Personally I’m going to use Raspberry Pi OS for most of my needs, but I do run Ubuntu on my laptop which I used in creating this and for editing the video.

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