Thursday, November 8, 2018

Electronics Maker Christmas stocking fillers list

It's that time of year when my family ask me for ideas of presents for Christmas and my Birthday.  (both December)

With electronics bits being a bit specific/esoteric I stopped trusting that if I said what I wanted they would get me the right thing after I gave my wife a link without a description for a new CPU.
By the time she clicked it the link redirected to a few screws.  Luckily she checked before buying and I was able to get her the alternative link.

So, these day I provide a wish list email with more items than I expect to get so I still have the surprise when I open the packaging as to what they give me.

This year I've decided to share the list.  This list may be added to as I think of more things.
Before you ask things like Arduinos, Raspberry Pis, Circuit Playground boards are not on this list as these are things I have usually already got a stash of.  This list is for the other bits that make those things useful.  The kind of things it would be useful to have before starting a project but may not have already or may have run out of.

I try to keep the items to less than £20 so for many these are good stocking fillers.

USB Current Tester - £4.50
I buy random items off the Internet and for batteries and USB PSUs I want a way to see if they meet their stated ratings.

Heat Resist Soldering Mat£9.90 - £15.00 - There are bigger and smaller ones out there as well.
I have a regular A3 cutting mat but like this because of the different compartments to keep bits as I regularly drop screws and tools and hope this will help me be more organised when working on something.

I sometimes use buttons with spade connectors and at the moment I solder the wires on which is not ideal.  Want to start using the correct connectors for the correct job and not just bodge something that later causes a headache that I have to fix.

Anker 4-Port USB 3.0 Hub  - £10.99  
Sometimes for the Raspberry Pi I need to burn multiple SD cards.  The great Etcher will burn multiple images at the same time so with this I can add 3 more to be burned in parallel (it's not 4 as I lose a port to connect it)

Starting to try and be more organised so like the idea of this set of wires.  I have loose spools of wire around the place so the plan is to replenish the spools when they run out.

Saying that I still do breadboard stuff so it's always good to replenish the stock of Dupont jumper wires.

Having recently committed a project to an actual prototyping board rather than using a breadboard I want to do more of that for my Raspberry Pi projects so need a bunch of 2x20 female connectors to hand.  Last one I used I 'borrowed' form a Kickstarter I backed, so that's now an incomplete kit.

I'm always looking for microSD cards, so every year I add them to the stocking filler list.
They're small and I'm clumsy so replenishing stock is an ongoing activity. 

Friday, August 24, 2018

Workbench in the garage

I've been meaning for a while to set up a permanent workspace for doing electronics and finally cleared a corner of the garage.

Once cleared I of course needed a workbench and whenever I searched on line this steel bench kept coming up. Listed on the UK eBay for about £50 which to me seemed like an OK price to pay for a bench with main surface size of 120cm x 59cm and with a drawer the full length of the bench.

I asked on Twitter what it was like and a few people replied that the metal is quite light but it's sturdy once built.

I got one and for £50 I think it's definitely worth the price.

The metal frame is not the strongest or thickest metal I've seen and without the wood tops being in place it does flex. I expected to have to add braces at the side and back but in the end they are not needed as once the work surface and other wooden pieces are added it gets nice and rigid.
One thing to be aware of is the wood is MDF and so has limited strength in itself.
The lower shelf on mine is flexing already due to the boxes I have on it.  I note this in the video below and also my plan to add some wooden battens to support the lower shelf.
The lower shelf and the work surface are not screwed down and are held in by the frame so it will be easy enough to lift out the self add the battens and put the the shelf back on.

The draw was also pointed out to be quit flimsy and I agree. It's not robust but it works and for tool and storage for light parts it will do the job.  Again the base on the drawer is MDF.

The back pegboard on mine is slightly bowing out.  Not sure if I've done something wrong or if it's the kit.  The top shelf is OK.  Again I'm not expecting it to take much weight but as a place for odd small bits it will work well. It's also high enough above the main work surface that it should be ideal for adding additional lighting in the future.  Maybe some RGB LED strips 

Finally, the instructions are really poor.  The kit I received wasn't missing any parts but let's say with my flat pack skills it took me a fair while to get it all together. 
The one tip I'd give is watch the number of holes in the metal parts to figure out which way is up.

So, overall I'm very happy with the bench. I've used it a fair bit since getting it and I like the size.  Much smaller and it would be a challenge to have equipment out and have a decent sized work surface.  (There is a smaller sized version that's 81cm x 41cm and from searching eBay there are also versions without the back and top shelf.

Finally, here's a video of the bench so you can see what it's really like.

Onward and upwards with the making. 

Tuesday, August 21, 2018

Shakey Shakey - a game using title switches

For the most recent Egham Raspberry Jam @EghamJam we did two workshops.
One was NoPi Blinky, making LEDs blink without any programming. More to come on this as during the workshop we found a few typos.

The other was Shakey Shakey.

For the workshops my goal is to do something slightly different that not only teaches the attendees something new from either a programming or electronics standpoint but also shows them creative options.

Shakey Shakey was based around really simple tilt switches.  They're basically a small tube with a contact inside that moves as you tilt the tube.  Really simple and really cheap. On eBay UK they're about £1.50 for 20. So, ideal when you need a bunch for the Jam
Tilt Switch

The only other things needed then were some female-female jumper wires and some 2 core wire.
I cut the female-female wires in 2 giving me a pair of wires that had the female connectors on one end and bare wire the other.  Cut the 2 core wire into about 150cm lengths and used them to connect the switch to the other wires giving a nice long wire for the kids to shake without (hopefully) unplugging the wires or pulling on the Raspberry Pi.

With the hardware sorted I them did the worksheet which is available to download from GitHub along with other Jam worksheets.

Shakey Shakey worksheet
The worksheet goes through:

  • Connecting a tilt switch
  • Python code to read the switch and display how many times it connects
  • Adding a pause to deal with debouncing
  • Adding a second tilt switch
  • Updating the code so the switches have to be activated alternatively
  • Final update of the code to add a timeline making it into a game

We had a full workshop and the kids who took parts seemed to really enjoy the coding and then playing the new game they created.

At the end I challenged the participants to come back to the next Egham Raspberry Jam (21st October 2018) with their own program that uses the same tilt switch controllers.  The worksheet at the end gives some suggestions.  Here's looking forward to the 21st of October to see what fantastic creative ideas the kids come up with.

Tuesday, June 19, 2018

Cat or Dino- Scratch 2.0 game

I saw a tweet from the @Raspberry_Pi Foundation about a game called Knifey Spoony by @Jonic one of their senior web developers did using pico-8.

The idea of the game is to select if the image is a spoon or a knife as quickly as you can with a timer running getting faster and faster the higher your score, so the pressure is on.

I thought this could be done with Scratch, so I fired up Scratch 2.0 and had a go.

Here is the result.  It uses only built in graphics making it easy for anyone to replicate and extend.
It is done with Scratch 2.0 but there is nothing special so it should work with Scratch 1.4 on the Raspberry Pi as well.

Wednesday, February 21, 2018

PiGPIOPin - when you want to use pin numbers and not BCM on the Raspberry Pi in Python

A while back I was doing some bare Arduino compatible boards using the ATMega328 chip. From this I saw that Arduino did not map the pins on the IC to the same numbers on the Arduino.  They used a simple order on the Arduino board and the Arduino ID so it was easy to find the right pin for wiring and also for your code.

Only problem is when you use the chip with the bootloader the mappings are different to the pin number so you need a lookup tool to know when you want to use Arduino Pin 13 that it's ATMega Pin 19.
After a while this became a bit annoying so I put together an .h file with a bunch of constants that got around this.

On the Raspberry Pi there is a similar situation.  The default numbering mechanism used is the BCM numbering which is great if you're operating at chip level, but at a board level it means things like:

BCM GPIO 5 is board pin 29

I still have to count pins to get to board pin 29, so having to also know it's then GPIO 5 in my code can sometimes be a bit annoying.

The original RPi.GPIO library allows you to choose BCM or Board numbers

 import RPi.GPIO as GPIO  


Giving the user the choice.

With the fantastic GPIOZero BCM numbering is enforced and there is no option to use board numbering.
GPIOZero is a great library and makes controlling motors, working with MCP3008 (analog input) and distance sensors a lot easier.

For those who want to use board pin numbers and want to take advantage of GPIOZero the use of the BCM numbering can be annoying.

To make it easier I decided to do a similar lookup table like I did for the Arduino.
Mapping Pin number variables to BCM numbers.
The code and an example is on GitHub.

It's straight forward to use.

Have in the same folder as your code or in the python path.

Put the following line at the top

from PiGPIOPin import *

Then instead of using something like

red = LED(17) # 17 is the BCM number that is at board pin 11


red = LED(PIN11) 

Each BCM number is mapped a PIN* variable.

The rest of the code then works as normal.

Using this gives the option back to use board pin numbers and not BCM numbers.

Thursday, February 8, 2018

More cheap stuff from eBay - Gaming Player Handheld Video Tetris Game Console Kids Children Boy Portable Toy

I'm drawn to the underside of eBay. The placed where strange bits of electronics are sold.  This interest comes from making things and needs odd bits of electronics to realise my (awful) creations.

On one of my regular trawls of ebay I found this.

Gaming Player Handheld Video Tetris Game Console Kids Children Boy Portable Toy

Looked interesting.  OK the display is obviously mono-colour LED and not back lit but for £1.39 I thought it was worth a punt.

From the Listing the dimension are: Product size: 14*8*2cm
Bigger than the Sony PSP Go 12.8*6.9*1.64cm
If Sony can squeeze a 4.3" widescreen display in the PSP Go then this could be a very useful case to work from. A nice sized case with 10 buttons.

For reference a Raspberry Pi Zero is 6.5cm x 3 cm.  An easy fit and with dimensions greater than the PSP Go one of the many 3.2" LCD displays I see running from a Pi should fit nicely.

£1.39 for a case with 10 buttons that should easily take a Raspberry Pi Zero and 3.2 " screen with space for other bits is a bargain.

I see a plan coming together so I ordered one two weeks ago and it arrived today.

The packaging is the same as the listing which is always a good start.

Opened the box and inside was the actual console. OK a bit rough and the sticker isn't straight.  Not a problem as I plan to remove all that anyway.

But there was something else not right.  I checked the listing again and confirmed the dimension Product size: 14*8*2cm

The dimensions on the actual one I received seem a bit off.  Annoyingly I don't have a ruler with me at the moment so I'm using AAA (not AA) as the standard measure.

An AAA battery according to Wikipedia is 4.45cm long.
From the picture below it looks like this may not be 8cm wide or 14 cm in length.

It is more like 9cm in length so a Raspberry Pi Zero may still fit inside and 5cm in width.
There goes the plans for a 3.2" LCD display. Maybe one of the  0.96" OLED displays might fit.

I almost forgot.  What about the 999 games.
It does have Tetris, a variety of Breakout games, a Tank combat game and a Driving game.

The driving game is especially bad as there are only 2 lanes and you just move from left to right as the cars come down the screen.

In summary how does it compare to the listing title.

Gaming Player Handheld Video Tetris Game Console Kids Children Boy Portable Toy
It is a game playing handheld video Tetris Game Console.
No kids, children or boys included, but it definitely is portable and a toy.

As an added bonus you also get the amazing driving game, breakout and tank combat games, so in a way it over delivers on the gaming promise.  I didn't count whether there are 9999 but I suspect we all know the answer to that.

But, if your reason for getting it is to have a 14cm x 8cm x 2cm case with an opening to put a 3.2" display and a Raspberry Pi Zero you will be very disappointed as it's most definitely a lot smaller than the listing.

It is held together with screws so maybe a teardown is needed to see what's inside and if there is anything I can salvage from it.

I think I may have found an actual correct listing for the one I purchased
Listing states the dimensions are: 10 x 4.5 x 2.4cm

Then there's also this listing for £1.79
With the dimension listed as: 15.5*6.5*2.5cm

If the larger one really is those dimensions then a project may be on to use it as a shell for something more fun.