martinjonestechnologyhttps://martin-jones.com
What's going on in the workshop?
Mon, 19 Nov 2018 12:46:07 +0000 en
hourly
1 http://wordpress.com/https://secure.gravatar.com/blavatar/078d5f3f78ea86aeb2395800707afb16?s=96&d=https%3A%2F%2Fs0.wp.com%2Fi%2Fbuttonw-com.pngmartinjonestechnologyhttps://martin-jones.com
Fixing printing from Quicken 2002 under Windows 10https://martin-jones.com/2018/11/19/fixing-printing-from-quicken-2002-under-windows-10/
https://martin-jones.com/2018/11/19/fixing-printing-from-quicken-2002-under-windows-10/#respondMon, 19 Nov 2018 12:36:18 +0000http://martin-jones.com/?p=2343It’s admission time. I still run the financial side of my business on Quicken 2002 and yes, it really is 16 years old. It does what I need and is reliable. Over the years I’ve developed various handy Python scripts for manipulating its QIF file format (more about those another time) so I’m quite invested in it. Quicken apparently stopped support in the UK in 2005 but I didn’t notice. Unfortunately this means that upgrading to a newer version is next to impossible, so this one just soldiers on. One day I’m sure I’ll be forced to get hip with the kids and let my accounts float off in to the cloud, but I’m not looking forward to it.

At the end of last week, Quicken 2002 blotted its copy book by refusing to print invoices any more. This would have a detrimental effect on my business’s turnover, so it needed fixing. It wouldn’t even show the setup dialog any more. It was tricky to sort out, so I’m noting it here in case anyone else has this problem.

I was all ready to blame the problem on last week’s Windows 10 update, but a bit of digging on the web revealed that such problems can be caused by the WPR.INI file. This link: https://www.quicken.com/support/printer-setup-window-wont-open indicates that it should live in C:\ProgramData\Intuit\Quicken\Config, but my system doesn’t have that folder. There were WPR.DAT and WPR.INI files in C:\Program Files (x86)\QUICKENW but moving, renaming or deleting them had precisely no effect at all.

To find the instances of the file that Quicken was actually using, I brought the very handy Process Monitor in to action. This tool lets you see all the file and registry accesses being performed by a process. Setting a filter for the process named “QW.EXE” and then watching the log while I opened the print setup dialog box caught it red-handed.

The file was actually in C:\Users\cmj\AppData\Local\VirtualStore\Program Files (x86)\QUICKENW\WPR.DAT. Why didn’t I guess?

The file was nearly quarter of a megabyte in size, which seems awfully large for some printer settings. After taking a backup copy, I deleted it and re-ran Quicken. Joy! The printer setup dialog box opened again and I was able to select a printer and thence print invoices. The creaky old application lives to account for another day.

]]>https://martin-jones.com/2018/11/19/fixing-printing-from-quicken-2002-under-windows-10/feed/0martinjonestechnologyq201819111q201819112q201819113Quick-and-dirty partition resize with Acronis True Imagehttps://martin-jones.com/2018/06/19/quick-and-dirty-partition-resize-with-acronis-true-image/
https://martin-jones.com/2018/06/19/quick-and-dirty-partition-resize-with-acronis-true-image/#respondTue, 19 Jun 2018 09:49:48 +0000http://martin-jones.com/?p=2336A little embedded Linux magic comes in unexpectedly handy. Years ago, I started using Acronis True Image to back up my office PC. Other backup packages are available, as they say, but it’s worked well enough for me. This week I had reason to use it in earnest.

The PC is set up with two main partitions on the disk. There’s one for the operating system (Windows 10) and applications, and another with data on it, analogous to the /home partition on a Linux system. Inevitably, it turned out that the boundary between these partitions was in the wrong place. The operating system partition was full, and things were starting to fail. Time to make sure the backup is up-to-date and then to restore to differently-sized partitions.

The operation fell at the first hurdle. Acronis True Image will create a ‘recovery’ USB stick from which the PC boots. This contains a small Linux distribution (Acronis Linux) and a GUI for managing the recovery operation. My backups are on a network drive, which happens to be an Apple Time Capsule. Would the Acronis recovery system connect to the Time Capsule? Would it ever. I couldn’t even persuade it to ask for the username and password, though it could see the Time Capsule on the network.

In Acronis Linux, pressing ctrl-alt-F2 in time-honoured fashion brings up a command line. Yay! Power! A bit of digging reveals a command called asamba which can connect to SMB shares. Using that, I could connect to the Time Capsule absolutely fine and mount it to the local filesystem. So why couldn’t the GUI do it? Annoying.

My next trick was to copy the backup from the Time Capsule to a USB hard drive using another Linux PC. It took a while for the several hundred gigabytes, but it got there. Acronis recovery will read USB drives, so the next step should be easy, right? No. My USB drive happened to be formatted ext4. Though Acronis Linux is perfectly capable of mounting ext4 filesystems, the recovery GUI only acknowledges the presence of FAT and NTFS discs. Aargh!

The solution was to mount the USB drive on my Linux PC, then share it using Samba. Acronis recovery found and let me log on to the Samba share, and could thus see the drive and backups.

Changing the partition sizes was the next problem. The GUI only allows you to shrink partitions or to grow them in to free space. My disk didn’t have any free space. It was all partitioned and in use. I thought that shrinking the data partition would create free space that the operating system partition could grow in to, but I was caught out by the presence of a 500MB ‘recovery’ partition which Windows had sneaked in between the two. I don’t know what it’s for but I didn’t feel like taking the risk of destroying it. There are no tools in the Acronis GUI for deleting partitions and starting again, so I was stuck.

Command line to the rescue! Ctrl-alt-F2 again, and there’s a perfectly good copy of fdisk available. It was a moment’s work to delete the existing recovery and data partitions, then ctrl-alt-F1 to the GUI. Restart the restore process and there’s free space available for the operating system partition to grow in to, and plenty of room to create new recovery and data partitions.

The restore took a few hours, as expected, but was successful. The only wrinkle was that Acronis recovery had marked the recovery partition as active rather than the boot partition, so the PC complained that there was no operating system. Another trip in to fdisk to mark the boot partition active sorted that out, and now I’m typing this very text on the PC restored to working order.

Footnote: there is another Acronis restore tool intended for restoring backups to dissimilar hardware. This may have handled the partition resizing more elegantly, but I didn’t try it.

]]>https://martin-jones.com/2018/06/19/quick-and-dirty-partition-resize-with-acronis-true-image/feed/0martinjonestechnologyimg_20180619_112420img_20180619_113338img_20180619_112939Good accuracy from a low cost Real Time Clockhttps://martin-jones.com/2018/05/30/good-accuracy-from-a-low-cost-real-time-clock/
https://martin-jones.com/2018/05/30/good-accuracy-from-a-low-cost-real-time-clock/#commentsWed, 30 May 2018 08:36:31 +0000http://martin-jones.com/?p=2329One product I work on has a built-in data logger. This helps us a lot if a problem occurs: we can see the history of any faults. Every log entry is time stamped, which is important. We need to know when it’s been used and how often. However, good timekeeping is a challenge. The product has no Internet connection, it gets stored and moved around a lot, and it’s nobody’s job to check or adjust its clock, so there’s a real problem with clock accuracy.

The real time clock is based on the Microchip MCP7940N chip. The chip uses a standard 32.768kHz crystal for its timekeeping. These crystals are fickle beasts, partly because of the very low-power oscillator in the chip. The oscillator frequency, which is critical for accurate timekeeping, is very dependent on the load capacitance, which itself can vary with different builds of the PCB. The heat of soldering during manufacture also affects the crystal. I’ve seen plenty which have failed altogether, and others whose frequency has shifted significantly. Note the soldering on the crystal’s load capacitors C9 and C10 in the photo below, part of an attempt to find the optimum load capacitance on a prototype board.

All of these issues mean that just assembling the PCB and hoping for the best doesn’t work well. The frequency of an apparently working crystal can be anything up to 100ppm (parts per million) wrong. That doesn’t sound like much, but it works out to nearly an hour’s error per year, which is pretty bad.

Fortunately the MCP7940N has a neat feature which helps a lot. One of its registers, called CAL, holds a value which speeds up or slows down the clock by a small amount, like the regulator on a mechanical clock. But how do we know what the error is, and whether it’s been successfully corrected?

The MCP7940N also has a pin which can output a 1Hz square wave derived from the oscillator. With a sufficiently accurate timer, it’s possible to measure the error in the crystal’s frequency this way.

Checking the correction is more difficult. Because the chip only works on whole oscillator clock cycles, it does the adjustment to the clock’s speed by adding or removing a few clock cycles each minute. It’s therefore necessary to measure the period of exactly 60 of the chip’s seconds to find out how long its minute is, and therefore how accurate the whole clock is.

Getting a sufficiently accurate timer is the first problem. My aim was to get the MCP7940N to be accurate to within 1ppm, or about 30 seconds per year. A useful rule of thumb in metrology is that the measuring instrument needs to be ten times more precise that the quantity being measured, so we need a timer accurate to 0.1ppm, or one part in ten million. To the rescue comes my trusty Hewlett Packard 5335A universal counter. It’s an oldie but a goodie. Mine is fitted with the optional oven-controlled crystal oscillator, an HP 10544A. I checked it and set it up against a Rubidium frequency standard about 8 years ago and it hasn’t been touched since. I checked it this month against the same frequency standard, and it still agrees to within 0.1ppm. Not bad, and certainly good enough for this job.

Measuring the initial clock error is easy enough: connect the counter to the MCP7940N’s 1Hz output and look at the error. The 5335A counter has handy built-in maths functions to make this easier, so it will directly display the difference between its idea of a second and the chip’s attempt.

To measure the corrected clock output over a minute needs a bit more trickery. The 5335A counter has an external ‘arm’ input, and can average a period reading over the length of the ‘arm’ signal. All that’s needed is to arm the counter for 60 seconds and the counter will do the rest. I couldn’t find a way to make the counter do this for itself, so I cheated and used a spare Arduino mini that happened to be lying around. All it had to do was wait for a clock pulse on a GPIO pin, take another GPIO pin high to arm the counter, count 60 clock pulses, then take the arm signal low. Simple.

The test setup looked like this. The scope is there for ease of probing (note the cable from its ‘sig out’ connector to the counter) and it also includes a Tektronix 7D15 timer/counter module connected to the chip’s output. The 7D15 is a lot less accurate (about 1ppm) than the 5335A but it’s good enough to give an idea of what correction is required. The Arduino mini is just about visible at the bottom of the photo.

Here’s a closeup of the scope screen, showing the measured period of the clock’s 1Hz output, 999.9818ms. That’s just over 18ppm too fast.

This the setup screen of the product, showing the 18ppm correction applied to the MCP7940N’s CAL register.

Finally the error in the measured minute, calculated by the 5335A counter gated by the Arduino.

It’s showing that the corrected minute is 301.3 parts per billion, so 0.3ppm, too fast. That’s as good as it’s going to get – about 10 seconds per year. With the clock set up using this process, it has a fighting chance of staying accurate in the real world.

Our house is full of traps for the inquisitive toddler. There’s cat food and litter, an office full of sharp tools, a fireplace, and most tricky of all, a staircase descending from the corner of the living room guarded only by a coffee-table-height shelf.

Fortunately, there is a handy range of wooden barriers available from various sellers on allegro.pl (search for ‘bramka’ or ‘barierka’ to get started). It’s a sort of modular barrier system, with a basic unit 91cm wide, though other widths are available. The sections screw together with plastic couplings that allow them to hinge. Wall mounting brackets and feet are available, as are sections with a child-proof gate built in. They’re cheap and simple enough that hacking them for specific jobs is easy and worthwhile.

Here’s a set across the end of the living room, protecting the fireplace and cat flap to the garden. These are almost freestanding, but tied to the bannisters at one end with string and blu-tacked to the floor by the window.

The steps up to the office are guarded by these two sections. I added the cat flap in one of them so that the cats can get to their food and litter tray.

The stairs down from the living room are guarded by another hacked set of barriers, cut to length and with an aperture provided for our eldest son’s favourite bookshelves.

I used the leftover upper and lower rails from the segment I’d cut down in length to make a rail to hold the ends of the uprights above the bookshelves. There’s a join in the middle done with one of the plastic hinge pieces and a not inconsiderable amount of wood glue.

The barrier is held up using zip ties through plastic corner blocks screwed to the underside of the wooden shelf top, so the screw holes won’t show when we eventually remove it. Felt pads on its feet stop it scratching the wooden floor.

]]>https://martin-jones.com/2018/03/18/hacking-child-barriers/feed/1martinjonestechnologyIMG_20180311_144905.jpgIMG_20180318_152052.jpgIMG_20180311_144822.jpgRIAA phono preamp for Tascam M-1B Line Mixerhttps://martin-jones.com/2018/02/27/riaa-phono-preamp-for-tascam-m-1b-line-mixer/
https://martin-jones.com/2018/02/27/riaa-phono-preamp-for-tascam-m-1b-line-mixer/#respondTue, 27 Feb 2018 21:33:04 +0000http://martin-jones.com/?p=1108In the workshop I have a couple of these Tascam M-1B line mixers. They’re a very useful box: they have eight inputs, each with a level control and pan pot, which are mixed together and fed into a master volume control. There’s also a pair of headphone outputs with their own volume control driven by a headphone amplifier with enough voltage swing to drive 600 ohm headphones properly. Into the mixer I typically feed the sound output of my PC, other audio sources such as a cassette player (yes!), and a spare cable lying around on the workbench ready to connect to whatever I’m working on, or my phone. The output is connected to the workshop speakers. With this setup I can hear all the sources at once without fiddling around, switching anything or unplugging anything.

Tascam M-1B Line Mixer

The workshop I set up a couple of years ago turned out to have space for a new audio source: a turntable. Great! I can listen to vinyl (not ‘vinyls’, please). I had a spare turntable on the shelf, so I put it in place. The trouble is, the turntable has a magnetic cartridge which can’t be connected straight to the line inputs on my trusty mixer. It needed amplification and RIAA equalisation. I could have just gone and bought an off-the-shelf preamplifier, but where’s the fun in that? Looking at the back of the Tascam mixer, there’s a blanking plate which looks perfect for adding a preamplifier, neatly built in. No worries about trailing cables or yet another power supply to plug in. Now to find a suitable circuit.

I didn’t have any LM833 op-amps in the spares box, but did have some NE5532s, which are not only an excellent audio op-amp but live two to a package. Finding the passive components in the spares box also proved to be a challenge. Getting the right component values is one thing, but finding two identical ones of each proved to be impossible. However, all was not lost, so I thought. The RIAA equalisation curve needs three time constants, of 75µs, 318µs and 3180µs. I found pairs of resistors and capacitors that gave the same time constants as R1C1 and R2C2 even if their values weren’t what the original design specified. Here’s a circuit diagram with my substitutions marked in red.

I built up a small piece of matrix board and tried it out. It worked, but didn’t sound quite right: there was a noticeable lack of bass. I decided to check the frequency response. The application note shows a useful table of the RIAA response at various spot frequencies, so I had something to compare my results with. I used the ARTA STEPS program with a PC sound card to measure the frequency response of my circuit. It took a bit of fiddling with the levels to get good results, since the phono preamplifier has a lot of gain, but the result looked like this.

The curve looks convincingly like the RIAA curve, but it should be +17dB at 50Hz (relative to 1kHz). In fact it’s more like +13dB in my version, so I’ve lost 4dB of bass. At the other end of the spectrum it’s more accurate: at 20kHz it’s at almost exactly -20dB as it should be. (Note, when taking readings from the plot, that the level at 1kHz is about -3dB. It’s the relative levels that are important).

What I’d neglected in my component value calculations was that the relative values of the two RC networks are also important. The National Semiconductor application note actually goes on to explain more about this, but I hadn’t read any further than the circuit diagram. Rather than delving in to the maths and risking discovering that I needed more components I didn’t have, I started playing with the values I actually did have. Here’s a plot of the before-and-after empirical results.

The green curve is the modified version. The level at 50Hz is now +17dB relative to the level at 1kHz, as it should be. Below 50Hz there’s a bit of a rolloff, but that’s not something I’m worried about – my speakers don’t go down that low and it makes for a useful rumble filter. The modified circuit is shown here.

I had to change both RC networks to get a good result. The time constant of one of them (11k/6n8) is still 75µs, but the other (180k/22n) is more like 4000µs than 3180µs. I suspect it’s interacting with the time constant of R0C0 to give roughly the right result.

It fits neatly in to the slot in the back panel of the mixer. The toggle switch connects the output of the preamplifier to inputs 1 and 2. Switching it off leaves those inputs available for normal line-level use if desired. There’s also an earth terminal.

Time for some testing. What were the skies like when you were young?

]]>https://martin-jones.com/2018/02/27/riaa-phono-preamp-for-tascam-m-1b-line-mixer/feed/0martinjonestechnologyIMG_0608.jpgIMG_0609.jpgriaa-schematic-moddedresponse-first-attemptresponse-first-and-second-attemptriaa-schematic-modded-v2IMG_0616.jpgIMG_0617.jpgIMG_0621.jpgThe Euroquadruped, or the solution to wall wart Tetrishttps://martin-jones.com/2018/02/11/the-euroquadruped-or-the-solution-to-wall-wart-tetris/
https://martin-jones.com/2018/02/11/the-euroquadruped-or-the-solution-to-wall-wart-tetris/#respondSun, 11 Feb 2018 21:44:05 +0000http://martin-jones.com/?p=2307Having relocated from the UK to Poland, the change in mains plugs has never quite been resolved. All the equipment that came from the UK has 13A plugs on it, and all the local sockets are the CEE 7/5 type. Then there are locally-acquired bits and pieces which generally have two-pin Europlugs. No matter how many adapter cables and extension leads I make, or change the plug or socket on, there’s always something that doesn’t fit, or won’t reach the nearest compatible socket.

Of particular annoyance are various chargers and wall warts. They’re all bigger than a standard Europlug, and there’s no standard for which way the ‘lump’ of the charger will be attached, so connecting several of them in to a multi-socket extension lead doesn’t work well. Often one charger will obscure one or more sockets in such a way that all the things you need just won’t fit, or the whole assembly becomes so big and unwieldy that things start falling out under their own weight.

It is therefore with some relief that I announce the debut of the Euroquadraped: one 13A plug with short cables to four Europlug sockets. It reminded me of an octopus but only has four ‘legs’, hence the name.

Getting all four cables in to the 13A plug was a bit fiddly, but choosing a roomy plug helped. The little Europlug sockets are neat. I’ve only seen them here in Poland. The finger ring to discourage pulling on the cable is a nice touch, and doubles as a cord grip internally. They even (finally) have safety shutters on the socket holes, roughly 60 years after shutters became standard on the British 13A socket…

The great advantage of this thing is that each socket is independent of the others and can find its own equilibrium with whatever electrical carbuncle is plugged in to it.

It’s trivially simple, but it’s going to save a lot of frustration in the workshop.

]]>https://martin-jones.com/2018/02/11/the-euroquadruped-or-the-solution-to-wall-wart-tetris/feed/0martinjonestechnologyIMG_20180211_221335.jpgIMG_20180211_221527.jpgCanon S100 Shutter Button Fixhttps://martin-jones.com/2018/02/04/canon-s100-shutter-button-fix/
https://martin-jones.com/2018/02/04/canon-s100-shutter-button-fix/#commentsSun, 04 Feb 2018 17:29:13 +0000http://martin-jones.com/?p=2299This is my Canon S100 digital camera. After long, somewhat arduous service, the shutter button started playing up: it would focus but not take the photo. Eventually I got a mobile phone with a better camera and quietly forgot about the Canon. The S100 has been extensively frozen, boiled, soaked, rattled and trodden on, so I figured that the shutter button problem was just due to the abuse. It doesn’t owe me anything. However, it’s still useful for some things the phone camera won’t do: it fits a tripod, and has good long exposure and manual control facilities including a handy neutral density filter.

Trying to use it to take some tricky oscilloscope photos the other day, the shutter button got really annoying. I searched on line for the problem and discovered that it’s quite common. That sounded like an interesting problem to me. Here’s my attempt at fixing it.

Before we start, don’t try this unless you’re used to dealing with annoyingly tiny things and have the tools to match: jeweller’s screwdrivers, tweezers, a very fine soldering iron and either amazing close-up vision or a good magnifier.

The camera comes apart surprisingly easily. There are six little black screws on the outside: two on each end and two on the bottom, close to the tripod mount. Take those screws out. The back comes off very easily – take care not to lose any of the buttons though.

The front also comes off easily, though there’s a little FFC connector to the setting ring round the lens. Unplug it carefully. It doesn’t have a locking bar so the flex PCB just pushes in and out. There’s also a foam gasket round the lens and the plastic cover for the HDMI and USB sockets. They’ll fall on the floor.

The shutter button and other controls are underneath the top cover. There are two more screws to remove: one on the front near the lens and one on one end. They’re different lengths so take note of where each came from. Before removing the top, there’s one more FFC to unplug. This one connects to the microphones. Again it has no locking bar so just pull gently. It’s the middle of the three FFCs in this photo.

With the top cover off, the controls themselves are revealed. On the left here, the function selector rotary switch, then the shutter button and zoom switch, then the power button, and on the right the big square thing is the GPS antenna.

If you put the battery back in, the camera actually works fine in this dismantled state, so it’s easy to try experiments. I prodded and poked the shutter button. Sometimes it worked, sometimes it didn’t. I doused the button with my favourite contact cleaner (DeoxIT D5) to no avail. I looked on the web for replacement buttons: “double action tactile switch” seemed to be the best thing to search for. There are lots out there which might fit, but they’d take a while to get hold of and would be really fiddly to solder, especially with the zoom switch so close by.

I wondered about a mechanical solution, extending the plastic rod from the outside shutter button that presses the switch to give it more poke, but sometimes the switch just refused to work no matter how hard I prodded it with a screwdriver, so that probably wasn’t worthwhile.

Given that it wasn’t worth spending a lot of time on what’s effectively a life-expired camera, an alternative engineering solution was called for. The first stage of the shutter button, the half-press to lock the focus and exposure, still works reliably. What if I just wired it in parallel with the shutter release contact? Then there would be no way to lock the exposure and focus, but at least the camera would take photos.

Some fiddly soldering with a fine iron bit and some polyurethane-insulated mod wire later, the two opposite corner contacts on the button are connected…

…and the S100 lives again. It’s not a full fix, call it a workaround, hack or bodge, but it’s good enough for me to take pictures. Oh yes, and assembly, as somebody once said, is the reverse of disassembly.

]]>https://martin-jones.com/2018/02/04/canon-s100-shutter-button-fix/feed/7martinjonestechnologyIMG_20180204_165606.jpgIMG_20180204_165751.jpgIMG_20180204_165854.jpgIMG_20180204_170148.jpgIMG_20180204_170233.jpgIMG_20180204_172823.jpgGarage door opener life extensionhttps://martin-jones.com/2017/12/16/garage-door-opener-life-extension/
https://martin-jones.com/2017/12/16/garage-door-opener-life-extension/#respondSat, 16 Dec 2017 07:57:05 +0000http://martin-jones.com/?p=2291This little thing is really annoying. It’s the remote control for our electric garage door, and I use it several times a day to get my bike in and out. Luxury, pure luxury. Or it would be, if it worked properly. The trouble is that about half the time after pressing the button, it locks up, stuck either on, with its little red LED lit, or off, so it won’t open or close the door, and drains the battery. The only way to fix it is to pull it apart, take out the battery, and put it back in without losing any of the bits of plastic. You can imagine how much fun that is with gloves on, in the rain, when you’re in a hurry. Yeah, yeah, first world problems, I know. But there doesn’t seem to be any way of opening our garage door manually, which is a nuisance.

Inside is a little PCB containing a PIC12F635 microcontroller and a simple 433MHz transmitter circuit using a couple of transistors and a resonator. I did all the obvious things: replace the battery, clean the board with solvent, all of that. Nothing helped. It seems there’s a bug in the PIC’s software which makes it prone to locking up. The switch under the button is rather worn and thus suffers from contact bounce, and I think that’s what’s upsetting it.

I tried filtering the signal from the button to the PIC with an RC network. That didn’t help: the PIC didn’t even respond to the button any more. Presumably it needs a fairly quick risetime to trigger an interrupt, or something similar.

There is a second button which is less worn. It transmits a different code which doesn’t seem to do anything on our garage door, but it never crashes the PIC. I considered swapping the switches over, but they’re surface-mount and glued down, and the chances of removing both of them and successfully soldering them down again undamaged were slim.

I wondered about rewiring the PCB so that the input to the PIC is always active, and the button just switches the power to the PIC. A quick test by adding a blob of solder and removing and reconnecting the battery showed that wasn’t going to work: the PIC just didn’t transmit. It needed to have the power applied and then have the button activated.

There was another issue to address. The button, when it worked, was prone to getting pressed by accident as the bunch of keys rattled around in my pocket. That led to the garage door opening itself at odd times, which wasn’t great for the security of our bikes. Somehow modifying it to be less prone to accidental operation would be nice.

Design changes were called for. Since the second button is redundant, I decided to convert it in to a power switch, so it has to be held down while the real button is pressed, and releasing it will guarantee that the power is cut from the PIC so it can’t remain locked up. I cut the power track to the PIC and took advantage of the PCB layout to add a P-channel MOSFET in series with it, then cut the track from the second button to the PIC’s input and wired it to the MOSFET’s gate. The buttons both have one terminal to battery negative. A pullup resistor between gate and source completes the circuit.

Here’s the modified board. You can see the remnants of some of my previous repair attempts, and the extra MOSFET and pullup resistor at top right. Now, to open or shut the door, I have to hold down the button on the right and press the left button, rather like using a shift key on a keyboard.

It seems to work reliably now, so leaving the house and returning are considerably quicker and less stressful.

Incidentally, I did the repairs and modifications in the office, which is several miles away from the offending garage door. To check that the remote was actually transmitting properly, I used my Tektronix 7912AD programmable digitizer with 7A29 vertical plugin. Originally intended for high-speed laser and nuclear physics research, it’s kind of overkill for testing a garage door opener, but its 700MHz bandwidth is plenty fast enough to get a clear picture of the transmission using just a loop of wire connected to the input. Analogue technology at its very finest. Here’s its TV output connected to a little LCD monitor showing the 433MHz signal from the remote.

]]>https://martin-jones.com/2017/12/16/garage-door-opener-life-extension/feed/0IMG_20171215_155448.jpgmartinjonestechnologyIMG_20171215_155448.jpgIMG_20171215_155001.jpgIMG_20170814_130325.jpgReplacing the screen of a Wileyfox Swift phonehttps://martin-jones.com/2017/10/08/replacing-the-screen-of-a-wileyfox-swift-phone/
https://martin-jones.com/2017/10/08/replacing-the-screen-of-a-wileyfox-swift-phone/#commentsSun, 08 Oct 2017 20:29:05 +0000http://martin-jones.com/?p=2188For the last couple of years, my wife has been using a Wileyfox Swift phone. For a budget smartphone, it’s had a few niggles but has generally been very good. A few weeks ago we and the phone got caught in an almighty rainstorm and the phone got wet. Leaving it to dry overnight didn’t help: it just made a funny fizzing noise when we put the battery back in.

I took it apart and discovered that water had got trapped in various places, not least the internal connectors to the display, cameras and so on. Some tracks on the display ribbon had completely corroded away overnight! Lesson one: if a phone gets wet, take it apart to dry it out properly. Don’t wait and see what happens.

I dried out everything else with warm air and tried the phone again. It seemed to work, giving a little vibrate when I switched it on and showing the charging LED correctly. But there was nothing on the screen. Since the damage to the display connector was plain to see and nothing else seemed to be wrong, I thought I’d try changing the screen.

A replacement screen was only £25 from a Chinese supplier on eBay. It arrived quickly, very well packed with a dinky little bag of tools too, but absolutely no instructions. I couldn’t find any on the web, either. Lots of stories about Wileyfox’s screen replacement policy, but no description from anyone who’d actually done it. Well, here’s how I did it. Or, more precisely, how I’d do it again next time – I did the dismantling in the wrong order which made it unnecessarily difficult. Many of these photos were actually taken while I was reassembling the phone.

First, unclip the back of the phone in the usual way as if to change the battery or SIM card.

Take out the battery and undo all the little screws which hold the inner case on. I think there are nine of them and one of them is behind a sealing sticker. Use a spudger or fingernail to gently unclip the inner case from the phone’s frame, and the insides will be revealed. Notice here the red spotty sticker – a tell-tale that the phone has been wet.

This much dismantling is enough to see whether the phone will work with the new screen. The screen connector is at the top left, labelled ‘BY’ in the photo. Flip up the brown tab with a fingernail and the flexible PCB will come out. It’s easy enough, though a bit fiddly, to plug in the replacement screen, wedge the battery in place and switch on.

Joy! It works. The repair is worth continuing with. Now, remove the battery and gently unclip the black plastic assembly at the bottom right.

The whole phone is a miracle of industrial design and packaging, but the way the display is fitted is kind of awkward. It has a flex PCB which goes all the way from the bottom of the display up the inside of the phone to the motherboard connector, and runs behind the big identification sticker. Even more odd is the arrangement in the bottom left hand corner: a chip which I believe is the touchscreen controller sticks up on a bit of flex PCB through a hole in the phone’s frame, folds back on itself and has another connector which connects it to another part of the display flex PCB, so the whole thing forms a kind of knot around the frame.

To remove the screen successfully, it’s easiest to remove the motherboard first. There are various connectors to remove:

display connector at top left, if you haven’t already done it

selfie camera connector also at top left (flip up the black tab)

another connector with a white flip-up tab by the SIM sockets

Remove the two screws holding the PCB and gently unclip it – it has clips on the left and right edges. Now there are two connectors to remove from the underside of the board:

tiny ribbon plug which goes to the USB socket. This will probably just drop off itself, but it’s really fiddly to put back.

U.FL-type antenna connector on the right hand size. Carefully prise it off with fingernails or tweezers.

The vibrator motor is attached by soldered connections on another flex PCB. I left it attached, but it might be possible to unclip it from the frame or desolder the connections. Be careful, it’s fragile.

Note how the screen flex PCB goes underneath the sticker. It turns out that it also runs underneath the USB flex PCB. Peel off the sticker (a bit of gentle heat helps to soften the glue) and peel back the USB flex PCB. I had to score the screening tape between the two flexes.

Now the screen flex PCB is free all the way to its hole through the frame near the bottom of the sticker.

Now to untangle the fiddly bit at the bottom left. First, unplug the little connector by easing up the black tab. Mine also had a bit of yellow Kapton tape holding it down. Withdraw the flex PCB from the connector and straighten out the folded flex PCB with the chip and connector on it – it’s held in place by sitting on a little peg on the frame.

Now the screen is fully disconnected. Time to remove it from the front of the phone.

The screen is bonded to the Gorilla Glass sheet which forms the front face and touchscreen. This in turn is just stuck to the phone’s frame with double-sided tape. I used a heat gun to warm the glass and soften the adhesive, and a combination of a Stanley knife and spudger to ease it away from the frame. The glass is surprisingly strong and flexible: I managed not to break it.

Once the tape has all softened and come off, the screen’s flex PCBs should come free with a bit of wriggling. Now clean off the self-adhesive goo. I used a spudger and car brake cleaner for this. The surfaces of the frame should be clean and smooth ready to accept the new screen.

The new screen needs a bit of preparation before fitting. The little connector for the touchscreen has to be disconnected:

and it needs some self-adhesive tape applying, because it doesn’t appear to come supplied with any. I used little bits of carpet tape (!), shown in the photo below still with its yellow backing paper on.

Now thread the screen’s flex PCBs through the holes in the frame where they should fit, being particularly careful with the folding chip thingy, and the touchscreen ribbon which is easy to get trapped and forget about. Once you’re happy that the flex PCBs are sitting in the right places, peel off the backing from your double-sided tape with a scalpel or tweezers and stick the screen in place.

Assembly is the reverse of disassembly, to coin a phrase.

Dress the flex PCBs into their final positions. Fold up the touchscreen chip and connector and pop it on to its little peg, then plug in its ribbon and lock the connector. Then lay the flex PCB to the motherboard in place, lay the USB flex PCB on top of it and re-stick the Wileyfox sticker. Don’t get cat hair on the back of the sticker because it won’t stick properly.

Put the motherboard back in, taking care to reconnect all the cables including the really fiddly one to the USB flex PCB. I found I had to manipulate it with the blade of a knife underneath the motherboard. Once the screen is reconnected, it’s time to switch on for a test.

Success! Now just to put the screws back in and celebrate. The phone works again, though the rear-facing camera appears to have died. I don’t know if that’s because of the water or because I dislodged its connector and didn’t notice. One day I’ll have another look at it. Until then, this phone is now only a spare, so nobody’s too bothered about not being able to take photos with it.

]]>https://martin-jones.com/2017/10/08/replacing-the-screen-of-a-wileyfox-swift-phone/feed/7martinjonestechnologyIMG_20171007_213923.jpgIMG_20171008_193146.jpgIMG_20171008_192819.jpgIMG_20171007_214101.jpgIMG_20171008_192756.jpgIMG_20171008_192208.jpgIMG_20171007_223816.jpgIMG_20171007_224111.jpgIMG_20171007_221326.jpgIMG_20171007_222156.jpgIMG_20171008_112802.jpgIMG_20171008_113242.jpgIMG_20171008_191605.jpgIMG_20171008_192925.jpgIMG_20171008_193036.jpgRepairing the display of a CAP readerhttps://martin-jones.com/2017/09/27/repairing-the-display-of-a-cap-reader/
https://martin-jones.com/2017/09/27/repairing-the-display-of-a-cap-reader/#respondWed, 27 Sep 2017 13:01:16 +0000http://martin-jones.com/?p=2154My bank in the UK requires me to use a CAP reader for some online transactions, its security compromises notwithstanding. It’s quite simple to use: I slide the bank’s card in to the slot and follow the instructions on the display and on the bank’s web site. At the end of the process it displays a number which I have to type in to the web site in order to authenticate the transaction.

The problem is, over the last few years, the displays have been gradually failing and losing rows and columns of pixels. It reached the point this morning where I couldn’t read the numbers on either of the CAP readers I’ve got, and so I couldn’t make a payment to a supplier. Getting hold of a replacement reader would take a while – I’m outside the UK at the moment – so it was time to see if they were repairable.

Some of the fixing screws are hidden. There’s one underneath the label in the centre (which displays ‘void’ when it’s peeled off – never mind), two under the feet, and four inside the battery compartment, which itself is closed with one little screw.

The case unclips, and then there are two black plastic pieces which form the card slot. They’re held by another six screws. That removed, we can see the PCB and display. The display is connected by a ribbon which is bonded to the PCB using a special conductive adhesive. The adhesive appears to gradually come unstuck, so the display stops working. Squeezing it with a fingernail restores some missing parts of the display temporarily.

There are lots of guides on the web about repairing these things and I’d had a few unsuccessful attempts previously on other gadgets. This time I was successful, and the method I used was simple. Lay a piece of paper over the area where the ribbon is stuck to the PCB, and then apply gentle pressure with a hot soldering iron to melt the adhesive. I worked my way along in a series of squeezy dabs. The paper chars a bit, but that’s just an indication that it’s working.

Having done the whole ribbon, carefully peel off the paper. It tends to stick to the ribbon so pull it off gently so as not to pull the ribbon off the PCB.

Success! The display is working again, tested using a bench power supply clipped on to the battery contacts. I tickled the leaf switch which indicates that a card is in the slot. Of course the card is not responding – it’s not there.

I did both the readers I’ve got, and they both worked. I then tried an actual banking transaction which also worked, so there’s no funny security boobytrapping going on. That’s good for me, because I can repair my CAP readers, but less good for anyone who doesn’t know where their CAP reader has been.