Saturday 10 November 2018

Metro 2033 inspired "Trench" lighter pt 2

In my last post I got the design and cap sorted for the trench lighter.

Sneak preview of the finished lighter

A post shared by Anthony (@darkmidnight_diy) on

Wick & Fuelling

Most refillable lighters such as the Zippo refill from the bottom, but I didn't want to make unnecessary modifications to the case itself, so I decided to create a removable wick mechanism that would allow the neck to also be used for fuelling.

To do this I needed to create a screw thread in the neck.

I started with this, and using a grinder rounded off the outside diameter until it sit snug in the neck. Finally added some solder to secure it in place.

Then I took this F-F coaxial (satellite cable) adapter, and drilled out the plastic middle, leaving a hollow tube with threads on the outside that fit the lighter.
Some wool strands twisted together to create a wick and pulled through this creates the removable wick.

Also at this point I filled the lighter with some wool padding to for the lighter fuel to soak into.

This just leaves the ignition source.


I still have the inner components of the lighter that I used for the screwdriver bit holder. The flint is long gone, but the wheel could still be useful, so I pulled it apart and took that. There was also a spring that is used to press the flint to the wheel, so I scavenged that too.

The assembly was constructed from a piece of a picture hook, which was widened to accept the width of the flint wheel.

A small hole was drilled and a hollow copper tube attached to the bottom, where the flint and spring was placed, and held in place with a small screw. (see below GIF for clearer explanation)

This assembly was fixed in place using another plumbing olive around the neck of the cartridge and secured again with epoxy.

The lighter in action

Monday 5 November 2018

Metro 2033 inspired "Trench" lighter

In Metro 2033 the main character, Artyom, carries a lighter fashioned from a bullet that can be used to light the way in dark areas and burn away obstacles such as cobwebs:

At a local country show I found an army surplus stand selling brass cartridge cases and saw an opportunity to make Artyoms lighter for real.

There is some real world history to this style of lighter. Known as a Trench lighter, items like this were quite common amongst troops in the trenches of the first World War, and relates to a wider concept of "Trench Art".

The case, I'm not sure what it's from.
It's approx .50" diameter at the neck,
but has stamp "SB 13"
 It seems too short to be a
standard .50 calibre round.

So with the case sorted, the next things to consider are:

  • Cap/means of extinguishing the flame
  • Wick
  • Fuelling & refuelling.
  • Ignition

I wanted to keep the lid of the lighter as a bullet style like in the game, but firearms law and lead content make the idea of using a real one infeasible and undesirable.

Instead I opted to grind the end of a copper bar down to a bullet shape, and hollow the inside slightly to make a cap.
The rounded copper bar.

Creating a hinge for the cap
The next stage is to create a hinge. A copper pipe clip was wrapped around the base of the cap, and secured with Araldite.

A second pipe clip was bent into a 'P' Shape and a bolt used to create the hinge (see gif below)

To attach this to the case, a brass olive from a pipe compression fitting (see pic.) was placed around the neck of the case, and the bottom half of the hinge was squeezed between it can the case to provide a frictional fit for now - it would later be further secured with epoxy.

Part two continues here

Thursday 11 October 2018

Leatherworking Punch Press

Following on from the stitching pony I built a while back, this is another leather-working tool build.

A post shared by Anthony (@darkmidnight_diy) on

Living in a flat I am a bit limited on what I can do DIY-wise due to noise, particularly in the evening. Even simply using a mallet with stitching chisels to punch holes in the leather can be a bit too much.

The aim of this project is to create a press-like tool that is sturdy enough for me to just push the chisels through the material, allowing me to work more quietly.

I opted for some hardwoods for this project as although the original plan for a very utilitarian tool, testing found a lot of flex and give in the cheaper pallet wood I'd originally planned to use.

The base and back are iroko, with oak providing the corner piece and the uprights that connect the lever, which is maple.

All the pieces are simply screwed together, with a bolt passing through the oak and maple to create the pivot.

The levers handle was rounded with a notch cut into it's underside to support the chisels, and a cheap cutting board was used to create a working surface.

Finally, a small scrap of leather was attached to the back with upholstery nails, which creates 4 loops, to store the chisels.

In time I intend to give the handle a leather wrap, but that can wait until I've got a suitably sized scrap to spare.

It works great, not only in reducing the noise, but is actually a lot faster to use than the mallet, so I'm a lot more productive as well.

Wednesday 12 September 2018

3 Panel Oak Picture/Poster Frame

A few years ago I bought a set of three Hotline Miami posters from the Eurogamer Expo. As much as I liked them I never round to hanging them - I kept telling myself I'd get a good frame, but never did.

This frame was made from a single piece of oak, and consists of dovetail-like joints in for the middle of the structure with half-lap miters for the corners.

The glass was upcycled from 3 individual picture frames from the local scrapyard - The existing frames were completely mismatched and in a bad state, but they all happened to have the same size glass, which cleaned up easily for this new frame.

Pic of the finished frame below, with sketch/build video below.
A post shared by Anthony (@darkmidnight_diy) on

Saturday 25 August 2018

Standing Desk

I was asked by a family member if I could build them a standing desk.

The problem was, being family I couldn't really say no, but they included these specifications:
  • "Nothing too fancy"
  • "Just cheap timber will do, nothing too expensive"
  • "...but 'good' wood - not old pallets or anything like that"
They thought they were being helpful by making an easier job of it, but truth be told, they were making it boring. Might as well nail a bit of plywood to some 2x2 legs and call it a day.

So to make it more interesting, I set myself a challenge - to build it with no screws/nails/fasteners, and no glues. All pure wood joinery.

The desk is for a laptop user, they also use external multimedia speakers and have a large, old-fashioned laser printer.

The Video
While doing the write up of this project, it was getting difficult to coherently describe how it was all put together without writing a huge wall of text.

I do a lot of sketching of designs before I build them, and it occurred to me that I could make this more of a feature, so I put them all together here:

I quite like the general style of the videos and will probably start documenting future projects this way as well - although I'm sure over time the process and output will improve.

Wednesday 8 August 2018

Drinko Plinko

This is far from an original project - Turns out "Plinko" was popularised by The Price is Right, but I only ever knew it from the drinking related version...

The finished project
A post shared by Anthony (@darkmidnight_diy) on

The premise is simple. There's a bottle opener at the top, a field of pins in the middle, and a number of boxes at the bottom. Bottle gets opened, bottle top falls into the field, bounces around the pins, and goes into one of the boxes at the bottom - these usually come with forfeits/suggestions like "Down it", "Take a shot" etc.

The build

The grid was based off a template from a half inch isometric dots.

Use a bottle cap to measure which points should be used and mark them.
Spray glue the template(s) down to the backing board - don't forget to allow space at the top for the bottle opener itself.

Simply place a nail at each point marked on the template, paying attention to keep the nail heights constant.

Once that's done, peel away the template and remove the nails.
Position the backing image as desired, and then replace the nails - you should be able to do this by feeling for the holes under the background image.

The edges are simply mitred and attached to the backing board with glue and brad nails. They had a rebate cut into them to hold the plastic/glass front.

The wood I used was chipboard from some old drawers, so the rebate was already there. I intended to sand down the wood, but in combination with the grey/blue paint I used, it gave a neat faux-concrete look which fit well with the Fallout/post-apocalyptic theme, so I decided to leave it.

The five 'buckets' at the bottom were just small scraps, painted and also attached to the backing with glues and brad nails.
The front is a bit of clear plastic I salvaged from a broken poster frame and cut to size.

Screw the bottle opener into place and all that's left is to decorate.

For the forfeit stickers I found some character images of Fallout characters online, and used the Monofonto font, which is similar to the font used in Fallout, and created the forfeits.
  • Brotherhood of Steel - Cheers! - no forfeit
  • Super Mutant - Take a drink
  • "Glowing One" Ghoul - Take a drink
  • Mirelurk - Down it
  • Deathclaw - Take a shot
These were printed onto clear adhesive vinyl, cut out and stuck to the backing board. In hindsight they could've done with a lighter background to help them stand out (when working with transparencies, it's easy to forget that the white background won't necessarily be there in the end), but live and learn.

Sunday 22 July 2018

Lighter screwdriver bit holder

A sign of a brilliant project is one that is "obvious with hindsight" - when you see it, it suddenly seems so simple that you end up annoyed at yourself for not having thought of it yourself.

For me, Laura Kampf's Zippo Lighter driver bit case was one of those projects.

I've had a similar lighter kicking about in the junk drawer for years, always holding onto it because I liked the aesthetic of it and wanted to use it in a project, but never knowing what that project was.

So I'll admit, this was a shameless copy of Laura's project, but as I don't have access to a milling machine, I had to take a different approach. The insert that I have created is 3D printed, and relies on a friction fit to hold the parts rather than magnets.

Rather than use the free plan, I decided to create my own, adding an additional hollow in the middle of the insert. The idea was that this less-accessible compartment could contain less frequently used driver bits, but still keep them together with the others.

In reality, the fit of the insert is a bit too tight to allow the compartment to be easily accessed, but it does still serve a purpose in reducing the amount of filament required to print the model (compared to leaving that part solid).

I also found that my lighter has a small metal tab in the lid that got in the way once the driver bits were in place, but this was easily removed with pliers. (I'm not sure is this is a typical thing of these lighters, or just because the one I'm using is an off-brand knockoff.)

A post shared by Anthony (@darkmidnight_diy) on

I have to concede that the insert would've looked better in metal, but from a functionality perspective it works just as well, and sometimes you just have to work with what you've got.

The STLs for the model can be found on Thingiverse, and the OpenSCAD code is on GitHub.

Thursday 12 July 2018

Ring Box part 2

In my last post, I showed the process of building a small wooden engagement/wedding ring box. Obviously it needs some lining to be fit for use.

The original sketch had a note next to it about an LED in the lid which I definitely wanted to do, but there's some space constraints to consider, namely where to fit batteries in the box while still keeping the traditional ring box appearance.

To create the padded sections, I used some leather offcuts, rolled up with the suede side exposed. The front "pad" is literally just that.

The rear pad has rolled from a 'L'-shape piece of leather, like in the illustration. When rolled, this creates a small hollow in the tube, where the batteries will reside.

The circuit is very simple. A white LED in the lid of the box will be powered by two G3A batteries (v. small cell batteries), and triggered by a normally closed reed switch. (i.e. putting the switch near a magnet breaks the connection).

The reed switch is carefully placed in the hinge near a small magnet (hidden under the leather), so that when the lid is closed, the magnet holds the reed switch open.

G3A is not a common type of battery, I just happened to have a lot that I recovered from some recycled electronics. As a result I couldn't find a battery holder for them, so I adapted this CR2032 design from Thingiverse.

The battery holder. View on Thingiverse.

The LED itself is just mounted with hot glue, angled down toward where the ring will be situated. The wires run down the inside of the lid to the hinge, where the reed switch is positioned.

On the base side of the hinge, is the small magnet which triggers the reed switch.

All of this is covered by another strip of leather, which is glued - suede side up, to the inside of the lid, and runs down to the hinge, overhanging it into the base (see photo). This overhang is tucked behind the leather roll containing the batteries, hiding all the wiring, but meaning it is still accessible should the need arise (to change the batteries, for example).

A post shared by Anthony (@darkmidnight_diy) on

The finished box

A post shared by Anthony (@darkmidnight_diy) on

A moving shot to try and illustrate the sparkling of the ring under the LED light.

Monday 25 June 2018

Ring Box part 1

Between the sign and the cake stand, and now this, my projects seem to be very wedding-focused of late.

Originally this ring box was going to be a project for the same wedding as the other two, but unfortunately due to various circumstances, it didn't materialise in time for the big day.

So when my brother got engaged recently, I gave him the designs I'd already sketched up and he picked this one for me to build for him.

A post shared by Anthony (@darkmidnight_diy) on

The woodworking component of this is pretty straightforward.

The wood I used is oak for the main body, and a darker hardwood (of the well-known species 'offcuttus miscellanei') for the sides, to provide a nice aesthetic contrast.

I was referencing an existing ring box for scale,
and purely by coincidence, the wood sections
I was using were a spot-on size.

Because of the small scale of the box, it's difficult to do any advanced joinery, so the pieces are simply glued, but the wood is light enough and small enough that the joints are still sufficiently strong.

Once all the glue-up is complete, it's off for some sanding to ensure everything's cleaned and squared up, leaving us with a sealed hollow cube.

With that done, the cube needs to be cut. Typically, it seems, most ring boxes are about 50-50 (half the height in the lid, half in the base). However, I've opted for a 25-75 split, leaving a larger base, as the plan is to include a small LED light, and I'll need space for batteries and wiring.

I took the hinge from the existing ring box I was using for reference. To fit it, I drilled out a small cavity in the back of the box for it. As the wood is only about a quarter inch thick, this was the most nerve-wracking part of the whole project.
Once I got it fitted, I sanded off the top of the base-back and the lid, so that their edges didn't collide when opening.

When satisfied with the opening mechanism, I epoxied the hinge in place.

Then the rest of the exterior is just a case of shaping with the sander and a coat of danish oil to finish.

Then onto the interior...

Tuesday 5 June 2018

Stitching Pony for Leatherwork

One of the great parts of being a multi-disciplinary maker is the ability to use skills from one discipline, e.g. woodworking, to help out with a project that uses another (e.g. leatherwork).

A "Stitching Pony" is a leatherworking tool used to hold leather securely, freeing up both hands for doing the actual stitching. In woodworking parlance, it's comparable to a vise or a clamp.

The construction is a flat base, with one fixed jaw extending vertically, and the second jaw being connected to the base with a hinge, so that it may open and close.

To control the movement of the jaw, a bolt extends through both jaws, and is controlled by a wing-nut, and a spring situated between the two jaws serves to maintain a bit of tension and avoid the movable jaw becoming floppy or loose.

To protect the leather being clamped from indentations, the jaws themselves are covered with some leather offcuts, which were simply attached with contact cement. Brass tacks were used to hold the leather in place while the glue dried (and help to add to the aesthetic of the piece).

The jaws of the clamp.
The bookend woodgrain was a fortunate coincidence

A post shared by Anthony (@darkmidnight_diy) on

Saturday 19 May 2018

Wooden Pallet Mallet

I typically don't do much woodwork over the winter as the weather has a tendency to suck the enjoyment out of things.

When I set-up to start again in the spring, I usually find that I need a simple project to warm up and refresh my techniques before I get involved with something more complex.

Normally it's a bit of a throwaway project that I wouldn't put online, but this one was very simple to create and has been very useful, so I thought that it might be of use to others.

This year I made a wooden mallet as I needed one for leatherwork.

The handle was two strips of pallet wood glued up and shaped around a hammer handle.

The head of the mallet is one of the end blocks, also from a pallet.

The finished mallet. Simple, but effective

The technique is simple - drill through the centre of the block to create an opening that the top of the handle can fit through, but is narrow enough to make a tight fit.

Then drill through the part of the handle that protrudes from the top of the block and wedge a dowel in place to prevent the block from slipping. (The block is actually a tight enough fit that this is a little bit unnecessary, but it adds an extra layer of safety, and a bit more of an aesthetic quality to things).

Everything after that is just a matter of sanding and shaping.

Tuesday 8 May 2018

Woodturned Pen

This isn't a project as such but last weekend I attended Makers Central in Birmingham.

It was a brilliant event, and great to be amongst so many creative people and share the wealth of knowledge and experience.

This pen is the result of my first attempt at wood turning courtesy of the Record Power stand.

It's certainly not perfect, but as a first attempt I'm pretty pleased with it, and a lathe is certainly on the workshop wishlist.

A post shared by Anthony (@darkmidnight_diy) on

Sunday 15 April 2018

Wedding Cake Stand

Off the back of the "Dutch Courage" sign that I made for the wedding, I was asked if I could also help with a custom cake stand for their wedding cake.

They're not having a traditional wedding cake, instead they've opted for brownies, in 7 different flavours, so the cake stand needs to accommodate them all and at the same time be able to differentiate between them.

In addition, there's a multi-colour theme to the wedding, so that needs to be included with the design.

The obvious thing to do was use different colours to separate the flavours, and my initial ideas centred around something like a painter's palette.

I was looking at a segmented circular design, but it was looking a bit strange with an odd number of segments, so I opted for six segments with a smaller platform in the middle to provide for the 7th segment.

A post shared by Anthony (@darkmidnight_diy) on

To calculate the size I was told that there will be one tray of brownies per flavour, and that would be about equivalent in size to about a Roses tin, which is roughly 9 inches diameter by 4 inches tall.
Using that as I guide, I based the design on a circle of 18 inches diameter divided into 6 sectors (so 6 triangles with two 9" sides and a 6-and-a-bit" rounded side).
This equates to approximately equivalent size.


The back segment (red in the original diagram).
This one also has a small solid tip added
as it will overlap the central segment
  • The base was cut from some chipboard up-cycled from some flat pack furniture.
  • Each segment was cut from 3/8" marine plywood.
  • Six 9x4" rectangles were cut to create the face panels, and attached to the sides of the raised segments (2 for the rear segment, 1 each for the other raised segments.)
  • Supporting posts for each of the raised segments 
  • The central "tip" of each segment was trimmed to allow room for the wooden pole that will support the centre segment.
These were secured to the base of the stand, but could be easily disassembled.

Rounded supports were attached to the underside of the curved edge of the segments. These were made from scrap, and supported a thin hardboard which was curved around to provide a solid outside to the segments. This was attached with staples, as the hardboard was too soft and nails passed straight through.

Each segment was wrapped with coloured fabric, fastened in place with staples and spray adhesive.

The centre segment was a smaller disc with a segment removed to allow the red segment to overlap. The supporting pole was approx 1.5" diameter and attached to the centre segment with a combination of glue and nails.
This assembly was wrapped in white fabric and attached to the base with a couple of screws (so to avoid rotation).

A post shared by Anthony (@darkmidnight_diy) on

I'm really pleased with how this project turned out. With a lot of projects, the actual building usually highlights issues not thought of during the design, and so adaptations have to be made, but in this case, the end result came out pretty much exactly as the initial design.

Working on this project also helped develop a new workflow - due to geographical and timing constraints, most of the design discussion was co-ordinated via WhatsApp. It was a case of being sent links and screenshots of ideas, sketching up a plan, photographing it and returning it etc. It was a surprisingly good system and something I'd definitely use again.

Sunday 1 April 2018


If you arrived here after a Google search for the title, you may be disappointed... maybe.

Recently I had a health checkup. Usual stuff - eat better, exercise more, yada, yada, yada.

One suggestion that came out of it would be... well... it's probably just easier to show you.. Ladies & Gentlemen, I present you... my nutsack!

A post shared by Anthony (@darkmidnight_diy) on

See what I did there? Took some sensible healthy eating advice and turned it into a really immature innuendo. You're welcome, world.

The sack is constructed from a 'lemon' shape of approximately 7 inches by 6 inches. The measurements were not that precise as I judged it based on simply wrapping the leather around the plastic tub it was replacing to get a roughly equal volume.

The holes for the drawstring are spaced evenly around the edge (20 in total, 10 each side).The measurements can be quite forgiving - it's more important to keep the holes the same distance from the edge, than it is to keep them equidistant from each other.

The drawstring its some leather lace I had left over from the leather notebook project I did a while back. Other guides I've seen suggest using two drawstrings originating from alternate sides of the 'lemon', but given the thickness of the lace I was using compared to the overall size of the bag, to do so in my case seemed a bit over the top.

Simply thread the lace from one end, through each hole, until it arrives back at the start, then pull the lace together to draw the bag closed.

The lettering on the outside was hand embossed, using a pyrography tool (which is essentially a lower temperature soldering iron). Be warned that leather is rather temperature sensitive, there's a thin line between embossing and burning.
That's why on the finished bag one of the lemon 'tab' bits is missing - I speak from experience.

Anyway, there you have it. A quick, simple project that can go from initial idea to complete in only a couple of hours while sat in front of the TV, yet provides endless opportunity for puerile comments.
Happy April Fools day!

Monday 12 March 2018

Wedding Sign

I was asked to create a sign for a wedding. They're planning on having Karaoke and wanted a sign pointing to the bar for "Dutch courage".


After exchanging a few ideas and a couple of preliminary sketches, we arrived at this design. Most of the graphics came from clipart, and the typeface is "URW Chancery L" in 132pt.

The overall size is  approximately a the size of an A3 piece of paper. As I don't have an A3 printer, I split the design across a few A4 sheets for printing.

Then came several hours of carving out the letters and patterns with a scalpel to create the stencil for later spray painting.

Building the sign
The sign is created from joining 3 lengths of up-cycled pallet wood. As with the Treasure Chest, the jointing was done manually with a combination of hand planing and simply finding lengths of wood that lined up well together.

The supports at the back of the sign for the stand
The wood is glued together, and also there are cross beams on the back - one at the top and one at the bottom.

These also form the mount for the stand.

The wood for the stand same from an old garden parasol that I upcycled. As it's previous life was as an object that hinged at various points and was designed to be folded, it was ideally sized - all I needed was to cut down the lengths. The pivot is nothing fancy, just a single screw.

The entire sign was sanded, and stained with a teak wood stain. An early attempt at stencilling the sign didn't go well, so the front ended up being sanded and stained a second time.
This turned out to be a blessing in disguise as after the second coat the woodgrain was much more pronounced and looked much better for it.

The arrow
Maybe I'm just a cynic, but it crossed my mind that although the venue and location has already been set for the wedding, Murphy's Law suggests that when the wedding rolls round, things will have changed and the arrow will end up pointing the wrong way, so I came up with the idea of making it a magnetic stick-on arrow so it could be swapped around.

The rear of the arrow with metal strip
Magnets embedded into the surface of the sign for mounting the arrow

I cut the arrow on the bandsaw, and painted it white, then a cut a section of flat steel and epoxyed it to the back of the arrow.
Then in the place on the sign where the arrow was to be mounted, I used a forstner drill to drill 3 inlays. In each of these holes I epoxyed a circular magnet so that it sat flush with the face of the sign.

I taped the stencil to the face of the sign, and applied two coats of enamel white spray paint. Unfortunately the delicate patterns on the edge of the stencil didn't work too well with the spray, so once a couple of sprays were down to mark out the position of the design, I removed the stencil and started painting by hand. To do this I sprayed some of the paint into the cap, and used a thin brush.

The end result

A post shared by Anthony (@darkmidnight_diy) on

Sunday 25 February 2018

PC case notification screen, part 3 - software & installation

In the first two parts of this project, I setup a Raspberry Pi to display notifications from my desktop PCs to a small LCD which I then 3D printed mounts for to install it into the PC itself.

I originally hoped to use existing software, such as Grafana and Graphite, but although they do run on the Raspberry Pi, it was difficult to get them to behave reliably, so I ended up going for a homebrew solution.

As I alluded to in an earlier post, the data comes out of the desktop by piping output from the linux command sensors via the a USB serial port like so:

sensors > /dev/ttyUSB0 2>/dev/null

The application running on the Pi reads data from the serial port, and using a simple parser, extracts the system temperature.

This is then passed to a sketch, which draws an (admittedly rather basic) gauge, displaying the temperature.

The code is available on Github. It also contains an interface class and an example implementation of that class, this is a wrapper I made around the library to make it easier to compartmentalise the processing functionality into separate classes, with the intent of making it easier to create a modular display (so further notification modules could be added in future - system speed, email/social media notifications etc).


The two mounts are either side of the metal front panel of the case, back-to-back.
The Pi sits on the inside, and the display sits on the outside (of the metal chassis - it is covered by the actual front panel of the case).
This allows the outside of the case to remain unchanged, but the display of the LCD is bright enough to shine through the translucent panel.

When the PC is powered down, the USB port still provides power, so the Pi stays on, but the power to the display is cut. This avoids having to go through the Pi boot sequence each time, but allows the display to be shut off.

A post shared by Anthony (@darkmidnight_diy) on

Thursday 22 February 2018

PC-case notification screen: Part 2, mounts and wiring

In the last post, I configured a Raspberry Pi to receive stats from my desktop PC and display them on a small LCD from a car reversing camera kit.

The next stage is to turn this into a much neater setup to integrate it into my desktop PCs case.

The Raspberry Pi quite a popular format, so there's plenty of cases on Thingiverse to choose from - no need to reinvent the wheel. I went with this tray design, as it was the easiest to adapt.

The front of my PC case has several mounting points for an array of fans, so all that was necessary was to create a way of joining the Pi Tray to them.
A simple 'X' shaped bracket in OpenSCAD is all that was needed. It would be easy enough to join this to the model for the Pi Tray, but I ended up printing them separately and gluing them together.

I used the same design as the basis of the mount for the display.
Out of the box it has it's own small stand to attach to a dashboard, with a screw pivot for tilting the display. My idea was to simply remove the stand part and use the same mounting point.

The Pi attached to it's completed mount

The mount for the screen. As you can see, it makes use of the existing stand mounts


Note: The 12V line is typically the yellow line,
it just so happens on the connector I found was non-standard.

The LCD runs of 12 volts. This is nice and easy to deal with - Molex connector straight to the power supply. This was just a case of joining the connector for the display to the Molex.

The Pi requires 5 volts, and there's 2 options on how to provide this - Also on the Molex, or via USB. There's pros and cons to both methods.
  • Going the Molex route is more straightforward - it can use the same connector as the LCD, so wiring will be neater, but on the downside, when the desktop is powered off, the power to the Pi will be cut. This runs the risk of corruption of the SD card.
  • Going the USB route means more wiring and a separate power lead, but has the advantage that my desktops motherboard still powers USB devices when powered down, therefore the Pi can remain on.
I opted to go for the USB option. There's spare USB headers on the motherboard, so I needed to make an adapter to use those.

Starting with a short USB extension cable, I removed the socket and split out the wires.

Then using a header lead pulled from an old PCs front panel, remove the header connector. Then it's just a case of matching up the pins and joining them together.

The adapter without the 3D printed cover (top),
and the finished adapter (bottom).
Each motherboard adapter can support 2 ports, so I left the remaining wires outside (just heat-shrinked for safety), so they're available if I decide to add another internal port later.

The Pi is connected to this using a console cable. This is a USB cable with 4 output pins - 5V, ground, TX and RX, and connects directly to the GPIO of the Pi.

It's not recommended to use the 5V GPIO pin for power as it lacks some of the control circuitry that the usual power socket has, but has the power is coming from a regulated USB socket, it should be fine in this case.

The console cable also takes care of the level conversion of the 5v levels to Pi-safe 3.3v, and appears to the PC as a USB-serial adapter.

Finally, all that's left is to connect the display to the Raspberry Pi. Both the display and the Pi have Composite sockets, so I removed the socket from the display and replaced it with a plug.

SCAD code for the mount
As this is really quite a niche thing I'm not going to put the files on Thingiverse, but here's the OpenSCAD code in case it's useful to anyone.

// Just comment out the one you don't want

// Couldn't be bothered to do the conversion...
function inches(x=1) = x*25.4;

module piMount() {
  difference() {
    cube([inches(4.5),inches(2.75),inches(0.125)], center=true);
    translate([inches(-2.0625),inches(-1.125),0]) { screwholes();}    
    translate([55,0,0]) {cylinder(inches(0.75),inches(0.8),inches(0.8), center=true);}    
    translate([-55,0,0]) {cylinder(inches(0.75),inches(0.8),inches(0.8), center=true);}
    translate([0,40,0]) {cylinder(inches(0.75),inches(1),inches(1), center=true);}
    translate([0,-40,0]) {cylinder(inches(0.75),inches(1),inches(1), center=true);}

module screenMount() {
  difference() {
    cube([inches(4.5),inches(2.75),inches(0.5)], center=true);
    translate([inches(-2.0625),inches(-1.125),0]) { screwholes();}    
    cube([1.125*25.4,12.7,50], center=true);
    rotate([0,90,0]) {cylinder(5*25.4,0.125*25.4,0.125*25.4,true);}

    translate([55,0,0]) {cylinder(inches(0.75),inches(0.8),inches(0.8), center=true);}    
    translate([-55,0,0]) {cylinder(inches(0.75),inches(0.8),inches(0.8), center=true);}
    translate([0,40,0]) {cylinder(inches(0.75),inches(1),inches(1), center=true);}
    translate([0,-40,0]) {cylinder(inches(0.75),inches(1),inches(1), center=true);}

module screwholes() {
  translate([inches(4.125),0,0]) {cylinder(inches(5),inches(0.125),inches(0.125),true);}
  translate([0,inches(2.25),0]) {cylinder(inches(5),inches(0.125),inches(0.125),true);}
  translate([inches(4.125),inches(2.25),0]) {cylinder(inches(5),inches(0.125),inches(0.125),true);}

The basic wrapper around the USB connector
difference() {
    cube([15,40,9], true);
    translate([0,7,0]) {cube([13,27,7], true);}
    cube([9,45,7], true);
    translate([0,0,5]) {cube([20,50,10], true);}

Wednesday 7 February 2018

PC case notification screen

I've mentioned before how my interest in electronics spawned from PC modding.

Now that I've built a new desktop for the first time in a while, I've been keen to return to PC modding and come up with some projects for my new machine.

Thing is, these days PCs are designed much more aesthetically than the old beige boxes, and so there's a lot less that needs doing - the case I have has a large glass window, the motherboard already has some RGB LEDs built in - the graphics card even has some too.

I wanted to add some case lights - thought that might be a nice throwback project, but I noticed the motherboard already has pin headers for a 5050 LED strip. Don't get me wrong, I think it's a good thing that manufacturers are taking the initiative, but all it involved was little more than soldering some wires to a length of LED strip and plugging it in - hardly a project worth writing about.

So I thought about doing a new take on the case-front notification screen. In the past this would be a basic HD44780-type LCD that could display basic text - currently playing track, system temperature etc.
My plan is to use a small, full colour screen to fit with the more colourful style of the new desktop.

Other requirements are that as I dual boot Windows and Linux, it needs to work in both environments, so I'm aiming for minimal overhead on the computer itself.

Setting up the Raspberry Pi

In order to meet that goal, I plan for it to be a completely separate device that the PC can just pipe data to, and the device itself handle the processing and display. I started with a Raspberry Pi A and a clean install of Raspbian ("Stretch Lite"), and booted to the terminal using the serial console GPIO pins.

Getting connected & installing Java
I'll need to get the Pi connected to the internet temporarily to get everything setup and installed. I used a USB wifi adapter then edited

with the following, replacing the ssid and password as necessary.

auto lo iface lo inet loopback iface eth0 inet dhcp allow-hotplug wlan0 auto wlan0 iface wlan0 inet dhcp wpa-ssid "ssid" wpa-psk "password"

then of course started with the usual update/upgrade

sudo apt-get update sudo apt-get upgrade sudo apt-get install openjdk-8-jdk
and reboot if necessary.

The display
As the display is to be mounted in a desktop computer case, there are some rather specific requirements.
  • Size - it needs to be small enough to fit in the case
  • Power - it can't use too much, and needs to be able to be powered from the computers PSU
  • Connectivity - HDMI would probably be overkill, after all, it's for system stats and notifications, not a extra monitor, and it needs to connect to the Pi, so Composite video seems appropriate.

The display and its connections
After examining and ruling out various options - netbook screen, digital photo frame, etc. I came across some reversing camera kits on eBay. For a fairly reasonable price, these kits contain a small camera for the rear of the car, and a small display to view the video on.

It fits the bill nicely - small, composite video connection, and runs of 12v, which can be provided by the PSU. Perfect. The camera the kit includes is unnecessary for this project, but I'm sure I'll find a use for it someday.

Adding a GUI
The Raspbian 'Lite' distribution doesn't come with a GUI, so I needed to install one - I went with RPD.
This is installed with

apt-get install xserver-xorg xinit raspberrypi-ui-mods lxterminal gvfs
As the pi will be running without user interaction, it needs to be configured to automatically login to the desktop. This can be done with:

We also need it to stop going to screensaver. The easiest way to do this is to just uninstall the screensaver with apt-get remove xscreensaver.
We also need to stop the screen blanking, this can be done by adding the following lines to /home/pi/.config/lxsession/LXDE-pi/autostart
@xset s noblank 
@xset s off 
@xset -dpms
And finally we need to hide the mouse cursor:

apt-get install unclutter
Once installed, we need to add the line unclutter -idle 0 & to /etc/profile.
Setting up serial communication
The Pi will be without internet connection, so to get data from the PC to it, we'll be sending it over the GPIO pins.

Firstly, use raspi-config again to disable the serial port console, as this can interfere with the data transfer.

Then run
sudo stty -F /dev/ttyAMA0 speed 115200 cs8 -cstopb -parenb to setup the serial port.

Run the same command on the desktop - just change the /dev/ttyAMA0 part to whatever the serial port on the machine is - most likely /dev/ttyUSB0 if you're using a USB to serial adapter or Arduino. (Currently I'm using an Arduino with a 5v to 3.3v level converter, though will come up with a more permanent solution when installing the screen in the case).

Installing the software
Take the compiled jar and move it over to the Pi - I put it in /home/pi.
Create a file in /home/pi/ containing this command

cat /dev/ttyAMA0 | java -jar /home/pi/PiScreen.jar

Edit the /etc/profile and add this command to the bottom

sh /home/pi/ &
This will cause the software to run on boot, and pipe input to the serial port to the application. That's it for the Pi setup.

Setting up the desktop
The software is designed to take its input from the 'sensors' command which is part of the lx_sensors package, so install this if it's not already installed on your system.

To test the display, with it booted and running, on the desktop send the comman

  sensors > /dev/ttyUSB0

you should see the dial on the display change to show the system temperature.
Send it a couple of times with the system under different loads to see the number change.

To automate this, simply add it to cron to run at set intervals, of if you want it run more frequently, add the below to ~/.bashrc (the 5 indicates 5 second intervals, adjust as necessary)

startSensors() { while true ; do sensors > /dev/ttyUSB0 2>/dev/null & sleep 5; done } 

This will allow the sensors to be started by using the command "startSensors &" in a terminal.

The next steps will be tidying up the wiring, and mounting it in the case itself.

The UI is quite basic at the moment, but I intend to expand on it to include other stats and publish the source so that others can add their own widgets to the display.