Archive | Techniques RSS feed for this section

Avoiding electrocution while testing 240v circuits

3 Jan


I needed to measure the output voltages on a bunch of unmarked transformers I’d accumulated. (No, I’m not a hoarder. I can stop any time I want to. Perhaps.)

I’ve done this before, with just a bunch of alligator clips, a mains cord, and a multi-meter. It’s very simple, but it’s *dangerous*. Reaching over live 240v wires to take measurements isn’t a good idea. Worse is that a bunch of wires in mid-air have a tendency to move around, generally shorting something wires together.


I recently made up a number of little test boards to hold test circuits in place without having to worry about wires getting loose. Here, for example, is a test with an arduino (on a solderless breadboard), an L298 motor driver, and a worm geared motor. The boards are 85mm long, with two rows of M4 holes 10mm apart. The rows are 75mm apart. They’re mounted to a laser cut piece of 6mm mdf, with two long rows of M4 tapped holes. (MDF taps quite well with a tap in a cordless drill).

I really don’t know, yet, whether these ‘boards mounted on boards’ are a good idea or not. However, they’re cheap and worth trying. In particular, they hold wires securely for testing which was exactly what I wanted for testing my transformers.


Here’s a test victim hooked up to a test setup. I grabbed a spare chunk of 12mm MDF (I didn’t even bother cutting it square). I marked a grid of cross marks at 10mm x 25mm spacing using the laser cutter, then drilled and tapped just the few holes I wanted to hold things down. Chocolate blocks, hot melt glued down, gave me a secure but adjustable fixing for wires.

Note that I used a female EAN mains plug rather than a standard power cord to supply power. I physically unplugged it every time I changed the circuit, which I probably wouldn’t have done if it was a plug into a wall socket.

This particular transformer made me glad I’d gone to the trouble, as it was very easy to power it off when I plugged it in and it started to hiss and smoke. Looks like I picked up a 110V primary transformer somewhere along the line and it *really* didn’t like running on 240V.


Even when I ended up using crocodile clips, they were much more secure when clipped into the immobile terminal blocks.

A quick test of a crude opto-coupled triac circuit felt a lot safer when wired up like this as well. I wouldn’t trust a solderless breadboard at 240V.


Compact ATX power supply to lab supply conversion

7 Oct


I wanted a simple 12V + 5V supply of power available on my (already very crowded) desk. There were already two other supplies in the room (one of them a fancy fully ajustable lab supply), but they were … metres away. I wanted something right beside the keyboard for powering Arduino experiments, etc.

I took a standard PC power supply, cut off the plugs that go to the motherboard, and wired a small (100mm x 75mm x 30mm) box onto the end. The actual supply is tucked a few feet away.

This is my original 12V/5V conversion. It’s ugly but it’s been in use for nearly 20 years. At the time I didn’t know what types of (cheap) connector would be most useful. I fitted a push to open, release to clamp fitting off a stereo, a ‘chocolate block’ screw terminal block, some RCA phono connectors, and a solder tab that alligator clips attach to easily. In actual fact, I’ve found the RCA connectors the most useful. They’re quick, easily salvaged from old electronics, and I haven’t melted any yet, even running 5+ amps through them for hot wire cutters.

Here’s another compact conversion – just a simple terminal block with GND, +3.3V, +5V, +12V, and GND again.


And another one where I unsoldered everything except three of the 12V lines and three of the ground lines, plaited for convenience.


Here’s the victim – a bog standard supply. I’ve cut off the mother board plugs and removed the zip ties. Note the messy tangle of wires.


I used the laser cutter to make up a couple of “cable combs” to tidy up the tangle of wires. I split the wires into two sets, as they were different lengths.


Here you can see a comb in use, taking a tangle of 12 wires and keeping them nicely parallel as I zip tied them. A side effect was that the resulting cable was much straighter, without the curves that were in the original wires.


This is the unit that will sit on my desk. A simple laser cut tabbed box (yay for Inkscape and the Tabbed Box Extension). There’s a chunk of angle iron (20x20x3) glued in for weight, and beefy resistor to put a load on the 5V rail. (I believe most modern supplies no longer require this). Two rows of RCA connectors – 3.3V, 5V, 12V. Since I long ago standardised on red for 5V and yellow for 12V (same as the power supply wires), I don’t need to label them. There’s a socket (black) for the 5V standby which stays on when the supply is turned off, a switch which turns on the supply, a power led, and another press connector stolen from a stereo. (They come red and black, I painted one tab yellow).


As I mentioned, some of the wires were shorter, so I decided to add in another box with just 5V and 12V and some salvaged connectors. This box was made with thicker 6mm mdf to give it some weight. The black objects were 3d printed covers to disguise the salvaged state of the connectors.


The printed covers did make things look tidier. However, they were a BAD IDEA. It took way more effort than they were worth, and the one fault I found when I tested the system was in one of those covered connectors – now potted with hot glue and no longer accessible.


I rebuilt the “secondary” box with a new design. I made another 100x75x30 tabbed box in 6mm mdf, but this time with a cutout area and four 3mm holes. I tapped the holes, M4, with a tap in a cordless drill. A 3mm mounting plate goes over the top, this time with proper panel connectors, and screws down. This was much better than the first attempt, and I’ll use the technique again.


Here’s the result. It all took more time than I’d expected, particularly the actual soldering of the wires. With so many wires fitting in a small space, I had to do some messy joins. Lots of incentive for me to get on top of laser cut/etched printed circuit boards.

However, I’ve got a useful tool that may get me doing more Arduino/robotics projects. I also learned a lot about using Inkscape, and found some techniques for making enclosures that I will definitely use again.

Cardboard Sword Coffin

22 May

00 sword coffin

My daughter asked me to pack some of her belongings, including some swords. Before I packed the fancy Japanese ones, I thought I would practice by making a protective box for a (cheap) wooden one.

01 sword

The sword – a bit over a metre (40″) long , 250mm (10″) wide.

02 base outline

I drew lines onto a cardboard box, forming a six sided shape. Out from the ‘coffin’ shaped hexagon, I drew parallel lines 50mm, then 10mm (for a fold), and another 50mm.

03 base cut out

Cutting around the outside makes the shape more obvious.

04 base cut and bent

Then scoring all the fold lines and cutting out tabs.

06 pizza wheel

This is my favourite tool for putting folds into corrugated cardboard. It’s a pizza wheel from a $2 shop, but I ran the edge against a grinder for a moment to take the cutting edge off it. Pressing down on that 1mm edge will crush most cardboard quite easily – even the triple thickness stuff. I found it tends to run off the line rather easily unless I prescore the line with a knife.

05 side glued and clamped

Here I’ve folded over a side, glued it (cheap white PVA glue) and clamped it to a piece of wood to keep it straight. Keeping it vertical (i.e. perpendicular to the base) was a problem. I used a bungee cord to put tension on it but I should really have grabbed a right angle brace of some kind.

07 clamping other side

And then gluing and clamping the other sides. You can see the first long side glued up here, looking quite solid.

08 base folded and glued

Gluing sides with PVA glue is a slow process, with time to watch about 1/2 an episode of NCIS before the glue has set enough to remove the clamps.

09 test of sword in base

A quick test to make sure the sword actually fits inside. Did I mention that this was the second box I made?

10 marking lid shape

I found another chunk of cardboard box and drew around the coffin to mark out a lid.

11 pattern of lid

The pattern of the lid is much simpler, as the sides are only one thickness of cardboard, not two folded over. Equally, it’s nowhere near as strong.

12 lid cut and bent

The lid cut out and folded. Unfortunately, since I used a chunk of cardboard from a shipping carton, there was a large slot going most of the way through it. Hence the offcut waiting to be glued in to strengthen it.

13 gluing support for lid

Gluing the support piece onto the lid. I was working in the living room so some flour and a bag of potatoes got drafted as gluing weights. They worked well.

14 lid partially glued

Again, working around the sides to glue the lid. As with the base, I was able to leave sizable tabs to glue to, for four of the joints. However the joints in the sides are at a very shallow angle which means the tabs left over are quite small. I had to add small strips of cardboard to make the joints solid enough.

15c sword with supports

I folded and glued a couple of support brackets out of cardboard, cutting notches to hold the handle and blade. The handle notch had to be cut reasonably accurately. The one for the blade was easier. I just cut it oversize then slid it up the (tapered) blade until it fit nicely, then glued it in place.

15b support bracket closeup

A closeup of one of the support brackets.

16 closed coffin

Result, one closed coffin which should protect the sword quite nicely. Rather a lot of work when I could have just wrapped it in bubble wrap, but a good chance to try out some different techniques.

Secure Destruction

29 Mar

I was tidying up and found some old tape backups from years ago:

Secure 1

I couldn’t just throw them out as they might have had clients’ data on them (unlikely but quite possible). Hence the blurring of the photo for security reasons – nothing to do with bad photography!

Remove two screws and you have a small set of parts:

Secure 2

Now unwind the tape off the spools and collect it into a “scrunch”.

Secure 3 - scrunch

Chop through the scrunch with a pair of scissors – four or five cuts turns it into about 100 short lengths of tape.

Secure 4 - chopped

To show how small some of the pieces end up, here’s a closeup.

Secure 5 - small pieces

And as a side benefit, the little tape reels just cry out “use me in a Science Fiction themed prop”. They are about 20mm across.

Secure 6 - reels

Of course, there were a bunch of CDs as well. They met an 8mm drill bit in the drill press.

Secure 7 - cds

A technique which actually works quite well with the larger Zip (100MB) and Jaz (1GB) disks.

Secure 8 - jaz & zip

None of this would stop the CIA from recovering (most of) the information, but your average “go through your rubbish and see what I can find” chappie would have a lot more trouble.

Braided wires from a power supply

16 Dec
  • A bunch of braided wires, ready for use:

Power Supply to Braided Wires 16122012 014 (braids) S

Bored on a hot Sunday afternoon, I decided to knock up some 4-wire cables to run to bipolar stepper motors. It didn’t take long and I was pleased with the results. Nothing clever but it turned a junk item into something useful.

  • (1) The victim, an old pc power supply. From the connections, this one must be at least 10 years old. I keep a bunch of them around for raw materials.

Power Supply to Braided Wires 16122012 002 (power supply) S

  • (2) A few minutes with a screwdriver and the guts are spread across the table.

Power Supply to Braided Wires 16122012 005 (opened up) S

  • (3) Time for the wire cutters. I could have heated up the solder with a hot air gun and desoldered the wires – that would have a given me a few extra mm of wire and a pre-stripped and tinned end ready for use. However it was 30°C  in the living room, and hot air wasn’t what I wanted.

Power Supply to Braided Wires 16122012 008 (bundle) S

  • (4) When I sorted out the wires I had one each of  grey, white, green, blue, and purple, plus 3 orange, 3 yellow, 5 red, and 11 black (all 18 guage), plus another 5 thinner wires.

Power Supply to Braided Wires 16122012 011 (grouped) S

  • (5) I grouped them together in sets of four, then did a flat-4 braid of each set. Excellent instructions on this very simple braid here, courtesy of T J Potter, “Sling Maker”.

Power Supply to Braided Wires 16122012 014 (braids) S  Power Supply to Braided Wires 16122012 014 (closeup) S

So, out of my dead power supply, I ended up with 5 handy high-power 4-wire cables, albeit rather short. I  swiped a spare yellow wire from my workbench to complete a sixth cable, and also braided a set of the thinner wires.

Making wooden gears

29 Nov

I wanted some small wooden gears to decorate a steampunk costume. Nothing fancy, they don’t have to do anything.

Four different programs are needed to turn my idea into a chunk of machined wood:

The starting point is the very useful (and cheap) Gear Template Generator from, which lets you choose all sorts of parameters for your gear. If you just want to print it out on paper, then the web-based program is free, but I bought the program ($26) a couple of years ago and that lets me export out a .dxf file which my cad software can eat.

The .dxf files (one per gear size) get imported into the CAD (computer aided design) software. I use CAD X11, which is somewhat funky but does the job and is fairly cheap.

After that there’s yet another program, this time it’s a CAM (computer aided manufacturing) program, where I map the lines on the diagram into movements of the cutter. I use CAMBAM which does the job nicely.  I tell it “I want to cut around the inside of this triangle, with a cutter of X diameter, cutting at speed Y, in passes Z millimetres deep” and it turns it into the truly strange NC (numerical control) data format that many computer controlled machines use.

One last program, Mach 3, reads the NC file and wiggles the motors on the computer controlled cutter to make it follow the pattern I want.

  • Here’s the computer controlled cutter, with a piece of 3mm MDF (fake wood) clamped in place to cut some mounting holes.

  • Measuring the how high off the surface the cutter is, using a pack of cards and a vernier caliper. The wood is bolted down, now.

  • Many layers of sound-proofing are needed when the little trim-router gets going.

  • The Mach3 software steps through the hundreds of lines of  “go to …”, then “follow curve …”, “lift up by …” etc. You can see the pattern it has to cut at top right.

  • And after an hour (it’s a very slow machine), it’s cut out some gears and a generated a lot of sawdust. Time for the vacuum cleaner.

  • Fresh off the cutter the gears are pretty rough – with fuzzy edges and bits to remove.

  • A quick zap with the belt sander cleans them up nicely.

Questions about characters (writing fiction)

27 Nov

Some simple programming to help a neophyte writer

A quick search of the net found many lists of questions to ask about the characters in one’s story (for instance 100 Character Development Questions for Writers). A few minutes work netted me a bunch of questions like this:

  1. Who is an actor you can’t stand?
  2. What is your worst childhood memory?
  3. Where do you live now?
  4. What is this character’s greatest fear?
  5. Have you visited any interesting places for work?
  6. What is more important – sex or intimacy? Why?
  7. What makes your character laugh out loud?
  8. What are your grandparents’ names?
  9. What is the first historical event you remember? (The Great Depression, Kennedy’s assassination, the moon landing, September 11th)?
  10. When will you be able to retire?

I ran some tidy-up code over the list and ended up with 290 questions about characters. (At some stage I’ll add questions about places, events, and objects as well).

With my questions in hand, I whipped up a (very crude) storage format for the characters in my story. In this case it looked a bit like this:

Person:  Sarah, descr=Sister

Place: Sarah_Flat

Person: Mark

My next step was some code to read in the list of people, read in the list of questions, then randomly ask question A about character B (recording the answers for later review) and looping around asking more questions until I got tired of it.

  • Asking a question

This is all very simple stuff, but I was suprised by some of the answers that popped into my head as my computer interrogated me. At the end of a very short time (in between fixing dumb bugs in the program – as is often the case in the simplest of programs) I found I had some useful background developing around my characters. Well worth the time spent writing it, and it should be a good way to fill in the odd five or ten minutes of spare time.