Tuesday, 31 March 2020

Simple USB KVM adapter

With the shadow of Covid-19 hanging over our heads, I, like many others, am now working from home.

Having my home PC set up right next to my work set up has been a bit of a pain - two keyboards and two mice competing for desk space. Plus the work keyboard and mouse was a spare wireless set I had kicking about - not really comfortable enough for long-term use.

The monitor I attached to my work laptop was the second monitor I use for my home set-up - thankfully it has two inputs, so that's an easy one-button switch.

I wanted to use my main keyboard and mouse with my work set-up as well as home, but didn't want to unplug/replug each time.

I also wasn't too keen or just ordering a USB KVM adapter (a device which lets multiple computers share keyboard, mouse and monitor), as recently some of our local postal and delivery works have fallen ill, and so I'm avoiding any non-essential deliveries - I don't like the idea of putting others at risk for stuff that's a 'nice-to-have'.

So I figured I'd look through the electronics pile and see what I could piece together.

I did have a PS/2 KVM that I was hoping to adapt, but having read the datasheet for the bus IC that underpins it, it had a low maximum current rating - it might have been fine for just a keyboard or a mouse, but the keyboard I want to use has a backlight, audio controller and USB hub built in, and a brief look with

lsusb -v

showed that they would easily surpass that maximum rating.

Software options are also a no go - whilst they'd been fine when working locally, they won't work with my work's VPN, the the IT guys have enough on their plate without me adding to it.

So, I ended up going for the simplest of options. I had some relays - they were obviously meant for higher power application than this, but found that wired up in parallel, 5V was enough to trigger them. I was planning on powering it from a USB port, so 5V was the target.

A rough schematic of the switch

Unfortunately they had a weird footprint that put one of the pins in between rows on standard perfboard, so I ended up dead-bug soldering them.
A diode across each of them to prevent voltage spikes from the coils, some USB extension leads and a switch later, and I had a 4 channel switch.

I was a bit concerned at the lack of a protective load on this circuit, but adding any additional resistance from the power to the relays would prevent them from switching - as they're really designed for higher power applications, I reason that the coils have enough power requirement to prevent a short.

I have ran it for a few days under close observation and seen no temperature / magic smoke issues, and it's only ever powered when I'm sat right in front of it, so it should be fine. Obviously if this wasn't a "whatever's at hand" project, there'd be much more elegant ways of doing this (bus IC, 4 pole switch, more appropriate relays, etc), but here we are.

A gratuitous amount of cable ties, double sided tape and an old business card box provides structure and an enclosure. I'll probably tidy it up a bit more later as time allows, but for now it's enough that it works.

Thursday, 16 January 2020

Beko WDR7543121W Washer/Dryer Repair

Over the Christmas holidays our Beko Washer Dryer stopped working. It was fine for one cycle, and a couple of days later when we went to do another cycle, it just wouldn’t power on.

After checking the obvious things – fuses, sockets etc, I noticed that when first powered (at the wall), there’d be a faint beep – like the key-press beep, but much quieter.

The machine was pretty new, so the first port of call was see if it would be covered under warranty. It’s about 18 months old, so of course just out of warranty. I tried contacting the retailer anyway to see if there was any room for good will support. Of course there wasn’t – planned obsolescence is their business model, after all.

Some online research seemed to point to the mainboard being dead.
Hoping to get things resolved quickly, I found a replacement board and ordered it.

When it arrived the next day, it seemed slightly different to the original – the part number showed “G09” rather than the “G08” that was already installed. I also noticed that although the board layout was the same, some components were either added or removed.
The original board
Reasoning it to be a more up to date and optimised version of the same board, I swapped them out.
Booting it up, it seemed positive to begin with – it beeped, the display lit up, and all seemed well.
Everything seemed to work just fine… until I hit start, and nothing happened.

A local repairman who I spoke to advised me that sometimes these boards require ‘programming’ to work with a machine – which is something even he couldn’t help with, as only the manufacturers’ own contractors are able to do that. Basically, it’s like DRM (digital rights management) for washing machines.
Curiosity got the better of me, so I popped the PCB out of it’s enclosure to take a closer look.

On the other side, there was an Atmel ATMEGA – a family of microcontrollers that I’m quite familiar with. It got me wondering if I could dump the firmware from the old board, find what exactly is needed to get the new one working – my guess would be a serial number or other identifier baked in there that I might be able to transfer across to the new board.

However, when I was researching this board, I found another web page hidden away at WasherHelp. It's for a different model number, but I figured worth a shot.
There was references to a diode on the board that failed – The one labelled D7 on the PCB. I checked on my board, and found that the same diode is dead on my board.

I de-soldered the diode from my board, an SR110 schottky diode, and started looking up alternatives. I found that the 1N4002 diode is similar specification, but is a regular diode, not schottky. This was bumping up on the limits of my electronics knowledge, so I asked a friend who has more professional electronics experience, and he told me it would probably be OK, but would likely run warmer and be less efficient.

I also had an 1N4002 on an old PCB in my junk bin. I swapped it in, gave it a test run, and it worked.

I’m happy that I got this sorted, and hopefully will help others extend the life of their appliances. I’m a little disappointed though that I didn’t get a chance to mess with the microcontroller/firmware stuff though. Perhaps another appliance will give me a chance to explore another time.

Disclaimer: This is just what worked for me, and is in no way professional repair advice or instruction. If you decide to do something similar, remember that you, and you alone, are ultimately responsible for the outcome.

Thursday, 19 December 2019

Repair Cafe Update - November & December

A couple of months have passed quickly by and the November and December repair cafes have been and gone.


To start with there was a jammed paper shredder. Having taken it apart we found that the jam had caused the motor to flatten the teeth of one of the gears. Given the lack of available replacement parts, it seems like it's not going to be repairable.

The next item was an oscillating sander that wouldn't turn on. An initial suspicion of the motor brushes being worn was scuppered when the screw terminal on the PCB that connected the main cable, fell away during disassembly. It looked like the pins had just corroded through. There was enough left of the pins that it was possible to scrape the corrosion away and re-solder the connector.

Third up was a lamp. The issue became obvious when unpacking it, as one of the pins fell of the mains plug. The power adapter was disassembled, but turned out not to be salvageable. However a replacement shouldn't be too hard to find.

Finally a Technics Hi-Fi received was brought in with reports of the radio not working, and volume dropping intermittently. There was no obvious way to replicate the problem, but it did seem that the radio might have been badly tuned, and some cycling of the volume control seemed to sort the volume issues. Given that nothing was particularly done, yet the problem seemed to go away, it's hard to class it as a win or a loss.


This monthTotal
(Workarounds and partial fixes)
Needs parts13


I managed to find a replacement power adapter for the lamp that was brought in last month, so was able to turn that into a quick win.

Second up was a dumpster-dived angle grinder that was just not powering on.
After checking the usual electrical culprits it was a case of the plastic switch being decoupled from the actual electrical switch - all it required required being clipped back into place. Unfortunately the nut that holds the disc in place was gone, but I'm sure a spare can be found in time for next time.

Unsurprisingly, there was a set of Christmas lights. Unfortunately not salvageable as it looked like there'd been an attempt to glue the bulbs in place.

Finally, a family brought in three lamps - I took two of them, one of the volunteers took the other. The first of mine was just a fuse replacement - easy win.
The second was also a fuse replacement, but it wasn't the plug fuse, it was a smaller device fuse on the circuit board of the lamp. With no replacement available, all we could do was advise them of the fuse that was needed and I showed them how to replace it.


This monthTotal
(Workarounds and partial fixes)
Needs parts23

That was the end of the repair cafe for the year, and although I've only been part of the repair cafe for the past three months, I was pleased to hear that a total of 650 kilograms of electronics was repaired in 2019, and I'm looking forward to trying to beat that record next year.

Wednesday, 27 November 2019

Glass display tray

Last Christmas I was given a nice set of drinks glasses.
In order to keep them safe, I keep them in their original cardboard box, which keeps them safe, but isn’t aesthetically great and keeps them hidden, so this was a quick project to create storage for them that is better looking and more permanent, and would fit in with the display stand I created earlier.

The box itself is made from iroko scrap. The outer walls are simple butt joints, and the dividers interlock each other as shown in the animation below.
For a finish, the wood was treated with danish oil.

Obligatory TL;DR finished project pic:

read on for a description of the build (and me practising my 3D skills in Blender!)

Thin foam was cut to squares as a base in each of the six segments.

Thin strips of foam were then wrapped around the glasses and they were placed into the box, where the edges of the box act to hold the circle of foam in place, and finally small triangular segments were cut and placed around the circle to pad the corners. This creates a suitable fit, and the foam has an almost velcro-like quality that holds all the bits together without needing adhesive.

Thursday, 31 October 2019

Drinks display stand

This is another small part of a larger modular project.

The aim is to create a display for drinks bottles and miniatures, which will present them nicely, while at the same time securing them to protect against small amounts of movement. i.e. I'm not expecting them to be secured if the whole stand is tipped over, but they must be able to tolerate the stand being wobbled side-to-side without the bottles clinking or falling over.

There is also the need to balance the trade-off between the display aspect of the unit, and the amount of storage it provides.

After iterating over a number of designs I settled on the idea of having a central area which would display a number of larger bottles, with a frame/shelf element around the back and side edges to hold miniatures (the front would need to be left open to allow access to the bottles).

The base

The base is simple plywood, with foam to support the larger bottles. The foam is spray-glued to the plywood, with cut-outs to place the bottles, and is wrapped in fabric - also spray-glued and stapled.

The frame

The frame is oak, attached through the bottom of the plywood, and supported by the miniatures shelves and the top frame, which is mitred, and screwed to the uprights with dowels to cover the screw holes. The sides are left open, but the back is enclosed with iroko (there is a logic to this that will become apparent later). The mixture of woods creates a nice colour contrast and adds additional support. 

The miniatures shelves

The basic idea behind the miniature shelf is to use a forstner bit to cut out grooves for the bottles to stand in. But this alone raises a couple of problems
  • If they're just sat in holes, it won't be possible to see the labels and know easily what they are.
  • There's no definitive standard size/shape of the bottles.
The latter question has an easy answer, just pick the smallest forstner bit that covers the most bottles that I have to hand - this turned out to be 41mm.

The solution to the first point is to cut the groove off centre, so that it has an open front, allowing the label to be seen, but again, this raises the next question - if the groove is open-fronted, then what's to stop the bottle just falling out?

I'd already planned to line the bottle slots with leather to prevent rattling. By over-sizing the corners of the leather (see below illustration), the leather also acts like a clip to hold the bottles in place, with a sturdy leather disc glued in the bottom to provide extra support.

The finished display

Wednesday, 9 October 2019

Repair Cafe

I recently started volunteering at a local 'repair cafe'. It’s a community environmental initiative where people in the local community can bring in small broken consumer electronics, and the volunteers will see if it can be repaired, at no charge, in order to keep items out of the waste stream.

If items can’t be fixed on site, advice is given whether it’s worth repairing, and if so what parts, etc. might be required. If they can be fixed, they’re tested to ensure they’re safe, and weighed so that the organisation can monitor the amount of material kept from landfill.

The other volunteers have a wealth of experience in a number of technical and scientific fields, so I also see it as an opportunity to learn and improve my skill set.

I’m also going to keep a record of the repairs I do, and document them here in the hope that it provides a DIY reference for others who may need similar fixes but aren’t able to access a repair cafe in their area.

So, these are the repairs I was faced with on my first day:
  • An automatic cat feeder – a simple mechanical clock device turning cogs which in turn allowed a lid on a good tray to open after the set time. The mechanism was reported as being slow. Observation of the device over a couple of minutes didn’t really show any sign of being off, and a test over half hour showed some drift – about an extra minute. The device was far from being a precision instrument though, so suggested that they observe the amount of drift over the time period they’re after and adjust the time they set accordingly.
  • An electrical beard trimmer. The mains wire was disconnected. Soldered in place and fixed.
  • A DAB digital radio, on which the LCD display wasn’t functioning. Managed to disassemble and retrieve the faulty part, so that a replacement could be found.
  • A toaster. The lever to push the toast down was stiff. This seemed to be a design flaw in the toaster, where the lever being pushed down would effectively pivot on the rail where it’s mounted, causing it to bind.

    There wasn’t much that could be done to repair it, but was able to advise the user how to workaround it by keeping the lever flat whilst it was being pushed.

  • A halogen cooking lamp thing. The timer and the fan would run, but the halogen lamp wouldn’t turn on. Testing showed no power to the halogen connector.
    Tracing the problem back showed that a potentiometer device (pictured) which set the halogens temperature had broken part.

    Advised the user of the broken part so they can try and get a spare from the manufacturer to attempt a repair next time.

    (Workarounds and partial fixes)
    Needs parts2

Sunday, 1 September 2019

Empty roll warning buzzer

This was a commissioned project that went nowhere, but could easily be re-purposed for many different use cases, so I thought I'd share it.

The aim is to create a range finder device that can be mounted and aimed at a roll of material on an assembly line, so that the range finder can be used to determine the amount of material left on the roll, and sound a buzzer when the supply falls below a set amount, informing the machines operator so that they can replace the roll and minimize downtime.

The sensor is a Sharp GP2Y0A21YK0F. The datasheet shows that the voltage drops as the distance increases. In our particular use case, this means that as the material runs out, the voltage will drop, so we want to flag a warning below a set voltage.

Initially I thought about using a low battery circuit similar to the one I modified to use in the Keyboard Pedal project. However, I later realised that would be over-complicating it, and that the same result can be achieved using a simple comparator circuit.

The chip used is the LM358 op-amp, and the circuit is similar to the one found on page 6 of this PDF.

The key differences being:
  • The voltage provided by the resistor and zener diode in their diagram is replaced by a potentiometer in mine, so that the 'trigger' value can be adjusted.
  • The potentiometer in their diagram is replaced by the IR sensor in mine.
  • The resistor and LED output in theirs, replaced by a buzzer.
  • The voltage of my circuit is 5V so it can run off a USB charger.
With all those changes taken into account, the resulting circuit looks like this.

Note that RV2 is the IR distance sensor - I didn't have the symbol for it in KiCad so used a potentiometer symbol as that's essentially the behaviour it exhibits.

The finished circuit, fit neatly into it's enclosure.

The case

The circuit needed to be neatly enclosed for it's purpose. Often for electronics projects I'll end up re-purposing existing containers and boxes as enclosures, but as it was a commissioned project something more professional was in order.
The whole enclosure is 3D printed, based off a simple lidded box design with cut outs for controls and the IR sensor itself.

I also took the opportunity to turn the box into a simple parametric template so I can recycle it for other projects. the SCAD source code can be found on GitHub.

All that's needed is to supply the internal dimensions that are required and it'll create a thin-walled box meeting those criteria, using only stock OpenSCAD commands - no other modules required.

The lid fits snug - on my (admittedly by this point quite old) 3D printer, a nice unintended side effect of the rough resolution is that the ridges create a nice friction fit, allowing the box to be closed tight, but also popped back open with relative ease should maintenance be required.

The controls and buzzer

The sensor - the glue-filled part was to allow flexibility in angling the sensor, but was later found to be not required

The test

As I didn't have access to the factory where this was intended to be used, I whipped up a quick test rig using kitchen roll as the stunt double for the actual material.

The short buzzing before the alarm fully triggers is driven by the 'wobble' of the roll on the holder. In production use the material rolls are much more securely held, and so this effect would be minimised.