Pi Test-bed Upgraded to fan Cooled Pi4

image-6.jpgMy Pi test-bed dates back to the first Pi I got 2012, upgraded with each new release of h/w. Other than the Pi the only other change in that time has to modify the mounting when Pi’s with mounting holes first arrived on the scene !

The room I work in gets very hot in summer so with all the discussions around how hot the new Pi4 gets I decided to add a DIY fan ‘hat’. I probably should have made this on the 3d printer but as I had some plain prototyping board to hand it seemed a good idea to show how a very cheap ‘no complicated tools needed solution’ could be made.

I started by cutting out a 65mm x 55mm rectangle of prototype board, using the Pi as a image-4.jpgtemplate I then marked out and drilled (with a 3mm bit) the 4 corner holes.

The fan I used came from ebay, it is a 12v 40mm PC fan costing about £2.50. Here I am running it from 5 volts, while this means it will run slowly it does have the advantage is that is effectively noiseless.

Next I marked out the positions of the fan mounts a main cut out. Lastly using the Pi as a template again marked out the cutout for the PI header.

Prototype board can easily crack, to reduce this risk I made sure the cutouts followed the  matrix hole positions and then used a 2mm drill to ‘extend’ extend them. I could have been a bit neater doing this but it worked out ok. Any ridges I carefully filed down with a needle file. The tip here is to make sure you support the board on a flat surface.

Lastly I mounted the fan on the board with four 2mm nuts & bolts. To attach the ‘fan hat’ to the Pi I used 10mm spacers from ‘stock’.Image-5

The fan came with a 2 pin connector that I connected directly to 5V and Gnd on the Pi header.

The fan does not seem to move much air but importantly it ensures a continuous ‘disturbed’ airflow over the main chips on the Pi. With a room ambient of around 25C the Pi processor temp sits at 44-45C (Pi lightly loaded), disconnecting the fan this went up to 65C within a few minutes.

With a bit of extra filing I could improve access to the header pins but as I mainly use this Pi for s/w development my need to access the header is limited.



Posted in Uncategorized | Tagged ,

TEC-1 Computer Build Complete


Image-10Following a number soldering sessions during the week I finished the TEC-1D build over the weekend. The next stages was to check out the oscillator circuit and the keyboard circuit. The former as there was a warning that not all variants of the chip would work. the latter because I was re-using a chip I initially got about 40 years ago for simple computer I built out of discrete TTL. All was well with both so I inserted the remaining chips and powered up.

This went without a hitch with the monitor program running as expected. Next I mounted the TEC-1 on a slopping enclosure.

From here I spent a happy couple of hours running through  simple code examples from


Working boxed TEC-1D

the Talking Electronics Magazine.

Next I started to try a few things out on my own, the main difficultly here is that the information is all spread across 6 issues of the magazine including references to future material that I suspect was never published – the magazine only ran for 15 issues. to complicate things a little more there were at least 3 different monitor programs produced.

So my plan is to try and tees out the strands of information into a single list of functions and calls you can make from the monitor programs. I also need get an EPROM programmer so I can try out the last JMon monitor variant. but that is for the future. For now I am just enjoying playing with my new computer !


Boo the cat is very interested in Z80 machine code programming


Posted in Uncategorized

The TEC-1D Micro Computer


Tec-1-computerOver Christmas while randomly scrolling through my Twitter feed I saw some discussion about the TEC-1 computer. This is a single-board kit dating from the early80s based around the Z80. Instructions on how to build it were published in the computer Australian hobbyist electronics magazine Talking Electronics. The Magazine only ran for 15 issues which is a pity as it had the idea of giving away a blank PCBs for one of the projects featured with every issue and did not have any advertising!TalkingE iss 10 cover

Anyway digging around to find out a bit more about the TEC-1 I discovered that a retro computer club in Australia had got permission to reproduce the TEC-1 PCBs and that there were a few left on eBay. Also amazingly although the magazine only ran for a limited time Talking Electronics as a webshop for kits is still up and running and while the kit for the Tec 1 is no longer available you can download pdf’s of all the magazines. 

Given that the Z80 was my introduction to assembly language coding I decided this would be a great early 2019 project to tackle along side my other Raspberry Pi and Arduino activities. So a month or so later I have the bare board and have started to source the parts for it.

Scarily I have managed to find quite a number of the parts in my stocks of bits from long forgotten projects. The rest I have been able to find through eBay and people like Bitsbox.

Trying different switches

I am looking forward to start the build in earnest this week and hopefully post a blog update with some parts soldered on next weekend !

Posted in Uncategorized

Re-purposed PiMuxClock

IMG_1711It’s been a good while since I have posted any blog updates, no excuse just distracted by life in general. This is quick weekend project at my daughters request. Concerned that some of the plants in her student flat would struggle in the cooler weather she requested a temperature display. Looking around the options I remembered my first Kickstarter was also set up to display temperature along with time. So a quick hack to remove the time element, change the board mounted DS18B20 sensor to cabled version and add max / min logging and it’s ready to take down to her.

Using it with a Pi2B is a bit of overkill but I am gradually changing out existing projects to Pi3s so have a few ‘spare’ hanging around.


The hardest bit was stopping one of the cats helping – I just managed to apprehend Pinky as she ran off with an ESP8266 board which clearly looked like a mouse to her !

I’m guessing the next request will be to add some form of push notification, if the temperature drops to a certain point but that is for another day.

The code is available on my GitHub site if you are interested.


Posted in Uncategorized | Tagged , ,

6 Years of Pi – Then and Now

Ok so in addition to losing about 5st (31kg) over the last 6 years RaspberyPi’s have really reignited electronics as a hobby. So for a 6th birthday post I thought I would have a dig around and see what my oldest still ‘working’ project was. I remember I got 2 Pi B early on – one was used for a chicken water heating project and eventually suffering Chiltern-20131201-00348terminal water damage when the enclosure leaked  (to date this is the only Pi of in excess of 30 I have killed). So continuing the hunt I found the news reader Pi I built for my wife based around an article in one of the early Pi magazines. Amazingly it is still working. I plugged it into a monitor just to remember

new box screenwhat the old LX  GUI looked like!

news box

As you can see it’s warning us about Storm Emma.




Going on from the Pi’s  it’s worth recognizing that somewhere down the line I have gained a workable knowledge of :-

  • Python
  • Arduino’s that oddly I had never used before – thanks to the RasPiO® Duino for getting me into this.
  • BBC microbits

Oh yes and run 3 successful kick-starters.

This year things are a little quiet on maker front mainly because out of a shear madness I have signed up to run the London Marathon, training for which is taking up a lot of time a weekends. The charity I am raising money for is the MS Trust. I picked the MS Trust having heard about the support they gave the mother of a colleague. They are not a big charity, so sponsorship money raised through events like this is really important to them. The Trust focuses on helping people live well with MS, helping them to receive the best possible care and the highest quality information. Over 100,000 people in the UK as diagnosed with MS, which remains the most common cause of neurological disability in young adults. Because diagnosis is usually in their 20s and 30s, the impact on the individual and their family if life changing and life-long.

The link to my Virgin just giving page is https://uk.virginmoneygiving.com/DavidMSaul





Posted in Uncategorized | Tagged , ,

TF WordClock S/W Updated

IMG_2102Just a quick post to say I have updated the TF Wordclock s/w to rev 5, the existing rev 3 s/w was not working reliably with the Nov29 2017 Raspbian update, in truth it had been on borrowed time since early 2017 when there was a major change to the Max7219 library. This did not offer an upgrade path so the TF was stuck with using a depreciated version  of the library.

Luckily the library author, Richard Hull suggested a way I could implement required functionality with the updated library –  now called luma.led_matrix.

This has required quite an extensive change to the TF with English, French and Dutch Wordclock versions  now available – unfortunately Latin is not currently supported.

If you want / or need to move to the rev 5 code you should do this from a clean installation of Raspbain.

Staying with the rev 3 code this is fine but be careful not to do an apt-upgrade as you will almost certainly find your TF will stop working.

The Nano version is not affected by this change.

Posted in Uncategorized

Standalone Video display with a Raspberry Pi

IMG_0785A couple of weeks ago my wife arrived back from Lindengate a local mental health gardening charity she volunteers at with an old PC monitor and asked if I could set it up to continuously display a series of videos, she had created to highlight the charities work. Typically the when was the following week and the where was a local doctors surgery. The when meant I was limited to ‘in stock’ parts and the where meant untended operation in a public place. I knew there were various existing instructions for doing this sort of thing with a Raspberry Pi and after a bit of internet searching found an article for a video looper on the Adafruit website which simply automatically plays video files from memory stick  inserted into one of the Pi’s USB sockets. I tried this out on a Pi3 and it ticked all the boxes in terms of play back and ease of use, so that was the s/w sorted.IMG_0782

Looking at where display was going  it needed not only to start-up without the user having to do anything but also not look too much like a DIY project built out of parts from my garage one night !  To get the size down I moved to a Pi Zero, with a VGA converter dongle [VGA being the only input available on the monitor] and a short micro USB to ‘type A’ converter lead. This all worked fine but did leave the perennial problem of how to safely turn the Pi off. Given a keyboard or VNC connection was out of the question I opted to fit a on/off switch to the Reset / run connector on the Pi. This way we could include a clear instruction to set this switch before removing the power. Now on paper I know this is not the best way to power down a Pi but in practice I have found it does seem to avoid corrupting the SD card.

IMG_0700Once tested this was all packaged in a small box  left over from another project. This I was able to mount on to the back of the monitor using one of the VESA mounting points on the back of the screen. The end result looked really quite professional with no unnecessary bits of wire hanging out !




So far the display has been put to good use in the doctors surgery and at the charities Autumn fair. The total parts cost excluding the monitor was around £32 using a Zero 1.3

Link to the Lindengate Facebook page

Posted in Uncategorized | Tagged , , | 1 Comment

BBC micro:bit Scrolling display

IMG_0682(1)Looking at my distributed BBC micro:bit clock I got to thinking, could I make a display screen using a number of micro:bits, using the radio functionality to update the screens ?To see if the basic timing would work I created some very rudimentary code on 4 micro:bits. Initially I tried to use the ‘display.scroll’ function. After much fiddling I did get this to work after a fashion, but in truth it looked rubbish. On the point of giving up I thought I would see what it would look like using the ‘display.show’ function. This produced a much more readable result so I decided IMG_0694to go on and develop some ‘proper code’. I had previously looked at with David Whale’s python ‘microbit’ module and this seemed a great way to get the text strings ‘into’ the micro:bit. which solved the problem of how to front end the display. The remaining s/w built used in my distributed micro:bit clock.


The software for the scrolling display has 3 elements;
[the pink x in the names indicates the rev number where I plan to develop the s/w further]

1) The micro:bit display node application [node_scroll_showx.py]

This is a simple python app you need to download on to each of the micro:bits that form the message display. The s/w for each micro:bit is identical. The software listens using using the radio function for any messages addressed to it coming from the gateway micro:bit displaying any valid character using the display.show function. It will keep displaying this until it receives a new valid message. The address of each display node is set the first time the s/w is run (normally this would be directly after download). The micro:bit will display a ‘?’, to show the address needs to be configured. The address is set using button ‘a’ and once correct store it using button ‘b’ – the address is stored in non volatile memory. On subsequent restarts it will be automatically selected, but you can change it by holding down button ‘a’ and resetting the micro:bit.

2) the micro:bit scroll display gateway application [gate_scroll_rx.py]

This is a somewhat more complex python app, performing 4 functions receiving messages from the Pi, creating the scroll effect, segmenting the message and finally transmitting the individual character information to the display node micro:bits.

Information is received from the Pi via a USB connection, this is described further in the RPi gateway application section.

Message format

The basic message format is <type><message>. ‘type’ is either ‘1’ to display a static message or ‘2’ for a scrolling message. So for examples if the gateway micro:bit receives the following message ‘2HELLO WORLD’ you would see ‘HELLO WORLD’ scrolled across the display node micro:bits. This would be repeated until the next message is received.
Static messages are automatically truncated to the number of characters in the display. If you want to see how the scroll process works the best way is to look at the python code but in simple terms I create a shift register in s/w and simply cycle it.

Setting the number of nodes

The gateway micro:bit needs to know how many display nodes it is talking to, this is set the first time the s/w is run (normally this would be directly after download). The gateway micro:bit will display a ‘D’, to show the number of nodes needs to be configured. This is set using button ‘a’ and once correct stored using button ‘b’ – the number is stored in non volatile memory. On subsequent restarts it will be automatically selected, but you and change it by holding down button ‘a’ and resetting the micro:bit.

3) The RPi gateway applications

The gateway application running on the RaspberryPi communicates with the micro:bit gateway via a USB connection, using a python module called ‘microbit’ (thanks to David Whale) for telling me about this – here is a link to his github. To date I have just written a few demo applications using the microbit module. When you first run an application using the microbit module it will take you through a setup process to allow the s/w to identify USB connection name. It will attempt to use this name for future connections. If this fails you will need to go through the identification process again, you may also need to restart the Raspberry Pi. The 4 apps I have currently uploaded on to GitHub are;

  • A simple program to display a user inputted string,  [gateway1.py]
  • A clock demo [gatewaytime_date.py]
  • A Tweepy application which will scroll any messages with a specific prefix. [tweepy8a_microbitxx.py]
  • A basic GUI that allows you to scroll / show strings or display time in a range of formats [scroll_GUIx.pyw]

The GUI app is my first real attempt to use Tkinter and I am sure I have broken a number of, but it seems to work and was interesting to code


One of my goals in developing the scrolling display was to avoid any extra hardware or the need for expensive sockets etc. To get the best effect the node micro:bits need to be mounted in a straight line as close together as possible. The mounting board I used is just a bit of fibre board I had spare. Having worked out the required spacing I drilled a series of 3mm hole, then used 2.5mm stand-offs and screws to mount using just the 0v and 3v ‘holes’. Using 3mm img_0697-e1505571864514.jpgholes with 2.5mm screws gave a bit of ‘slop’ to get everything aligned neatly. You can find a copy of the dimensions I drilled to at the end of this post.

Initially I just used individual batteries to power each micro:bit. Once I was happy the with the mechanical arrangement I found a suitably rated 3.3v supply and changed to power the node micro:bits via the GND and 3v pins – if you go down this route you need to be very careful as an error here could end up destroying all the node micro:bits. Also most importantly you have to include a diode on the 3V line.IMG_0671(1)

This stops a micro:bit ‘back powering’ all the others when you are downloading code to it via the USB line – I am guessing the USB supply on the micro:bit is not rated to drive 10 micro:bits ! You can see how it is wired up in the picture below



Rear wiring detail


Front face of 10 digit display


The dimensions I used for drilling the mounting board


You can have a look at some short videos of the scroll display working on my YouTube channel

Initial demo

10 digit display demo

Tweet display demo


Posted in Uncategorized | 1 Comment

Distributed BBC micro:bit Clock

IMG_0619The idea for this project came from a tweet by David Whale [@whaleygeek] showing a font he had come up with for the micro:bit that managed to squeeze 2 digits on to the 5×5 led display. I have taken initial clock code he wrote and added functionality to read a Real Time Clock module connected via the I2C port together together with some other bits.

The time display is spread over 3 microbits [ 2 if you don’t want seconds ], these communicate using the radio function in micropython . You can also have a single micro:bit with a scrolling display. There is no limit to the number of slave micro:bits, but do only connect the RTC to a single micro:bit.IMG_0581

The clever bit, [well I think it it is !] is that all the micro:bit’s all run exactly the same code. You configure the display to hours / minutes / seconds or scrolling by connecting the P0-3 lines high. The software automatically identifies if it has the RTC connected to it and if so makes it’self the master synchronizing the other micro:bits every minute.

The whole thing is written in micro-python programmed using MU running on a Raspberry Pi. You can find instructions on how to install the latest version of MU in the micro:bit section of my site.  The code listing is commented so you can sort out which bit does what. If you want to change to code it is worth noting that it basically maxes out the available micro:bit memory as it stands.

IMG_0620Hardware, it is really up to you, I have used small ‘maker’ interface boards I got made to up allow me to mount the micro:bits vertically on a bit 0.1″ matrix board, but you can easily use one of the commercially available breakout boards. The RTC is a DS3231 RTC module. The only other bit I added was a simple 3.3volt PSU using a 78L33 and microUSB adapter board.IMG_0587(1)

if you don’t want to build the power supply you can simply power one of the micro:bits from it’s battery or micro:USB connection and it will feed the others and RTC.

You can download the micropython code and also a basic schematic showing how I connected all the bits from my GitHub https://github.com/DavidMS51/whaley_clock .  (Do make sure you download the latest version of the code)

There is also a short YouTube video of the clock here


Posted in Uncategorized | 1 Comment

Cheap DIY Weatherproof Pi Camera

IMG_2453Always thinking about useful things I could do with a Raspberry Pi my wife asked me about making a time-lapse camera to record some building work at Lindengate, a local mental health gardening charity she volunteers at. While there are a number of Pi camera weatherproof products in the market the challenge here was to spend as little money as possible. You can see one of the short films my wife created using the camera by following this link to Lindergate’s facebook page.

The detail of the build is follows….


From a practical perspective the camera needed to be left unattended for at least 3-4 days at a time, not a problem from a storage perspective but it was an issue in terms of power the site is quite spread out and there was no practical way to get power to the place she wanted to film from.


The obvious logical choice of electronics was a Pi Zero and Pi camera, then looking around the garage a realised that if I stripped out the internals from a spare security light I could easily attach the pi to the glass window using a ‘zeroview’ I already had – effectively for free. This setup also have the advantage of not looking very interesting as people are used to seeing this sort of security light around.


Rather than try and fit batteries inside the enclosure I opted for taking out a lead  long enough to get to a separate waterproof box with the power supply in. As you can see in the picture I have soldered the power lines onto the Pi, this was simply because I did not have a long USB to micro-USB cable.

The only other change I made was to include a light dependent resistor [LDR] this is attached between GPIO pins 39 [0V] and 50 [GPIO 21] and is mounted through the zeroview board by cutting a small slot with a needle file. The GPIO 21 line is configured as an input with the weak internal pull up resistor enabled. This creates a potential divider so a low on this pin indicates daytime, a high darkness. This allows me to keep power usage to a minimum by not taking pictures after dark. This setup also avoided the need for any extra components other than the LDR.



There is no accessible wifi on the site so to download the captured pictures I simply plug in a USB wifi dongle to a short micro-USB to socket lead I brought out of the enclosure. Then connect via a laptop running VNC and locally a ‘created’  temporary network using a HooToo Wireless Travel Router.  Again this kept the power down as I could disconnect the dongle when not needed – protecting the USB connection with a plastic bag !


IMG_0563I tried a number of different power solutions the simplest being USB battery packs, with a large one I could get about 6 days, but main difficulty I had was that newer ones include a sensing circuit that shut the outputs down if the power drain is below a certain level. So they are fine to run a normal pi 3 but with the zero I found that periodically they would turn off which was not not much use. So going back to the garage I found a car battery, 12V to 5 volt converter and a solar panel from previous ‘projects’. With this combination I have kept the camera powered for over 2 weeks in good weather without a problem. I am doing a bit more work on monitoring the power usage so  I can understand how long it is safe to leave the camera for, a bit better – that will be the subject of later blog I hope.

I kept the s/w really quite simple – you can download a copy of the code from my github.  It is set up to take a picture every 10 minutes, but you can change this. The resulting pictures then stored in a single folder. The software is actually a cut down version of program I use to capture and upload pictures of our chicken run to the net !  It is setup to auto run on power up – you can see how I do this here on my site.

The actual video was created using iMovie on a mac portable but there are a variety of other free and paid for editing packages that will allow you to stitch still photos together to make a film. You can see the results here on Lindergate’s facebook page.


The new cabin mid build





Posted in Uncategorized | Tagged