Friday, 15 December 2017

Simple, low power Arduino countdown timer.

I have a requirement for a simple, battery operated countdown timer.

It could have a variety of uses, in this use, it just needs to count down from a preset number of minutes to zero, and sound a bleeper.

I could go out and buy something for little money, but where's the fun in that?

I'm also interested in Arduino sleep modes, so it'll be interesting to play about with that too, to increase battery life.

The sketch can be found at
I've also included the library for driving the TM1637 display, which is by Bram Harmsen
and can also be downloaded from

Let's have a quick look at the hardware...

A momentary push button is connected to D2. A BC337 (or almost any general purpose NPN transistor)  is connected to A3, which is used to switch power on by grounding the GND pin of the TM1637 "light tube" 7-segment LED display. DIO and CLK of the TM1637 are connected to pins 10 and 11. The output of the pot is connected to A0, and the "hot" end connected to D13. Power by way of 3 AA cells, is supplied to the VCC pin of a pro-mini. A piezo beeper is connected to D3.

How the sketch works...

In normal use, the microcontroller is asleep. It's woken up from it's slumber by an interrupt going low on D2. Power is then switched on to the display, by taking A3 high, which switches on T1, and connects the display GND pin. D13 is then taken high, which switches on power to the pot. The pot position is sampled by A0, and used to define the number of minutes the timer is  required to run. After a few seconds, D13 goes low, saving us a few precious uA! The timer begins to count down, displaying the value in remaining minutes and seconds on the display. Once the timer gets to zero seconds remaining, the display flashes and the beeper sounds to alert the user the time has expired. Once this is complete, A3 goes low, disconnecting the display, and the micro goes back to sleep.

Power consumption is about 45mA when it's running... and a super-low 200uA when asleep. The batteries should have a good life.

I did remove the voltage regulator on the pro-mini, as initially I was going to use a 3.3V unit, and the regulator burns a few mAs even when the micro is asleep, but it's unnecessary. There's no difference in the microcontroller, so why bother? Just feed our 4.5V into VCC... Despite the light-tube stating it needs 5v, it seems happy right down to 3.3.

At the moment this project meets my requirements for use. I'm going to build a new ultra-violet light exposure box shortly, and I'll modify this to drive a relay to automatically control exposure time.

Thursday, 14 December 2017

The re-occuring Copland CSA515 fault.

Not the greatest of success stories, this one...

Many moons ago Gerald rang (his name's not really Gerald, but the names have been changed to protect the innocent)

"I've got this Copland Hybrid amp, it sounds thin and distorted on one channel, mainly in the mid-range, can you take a look?"

Yeah, why not? (in hindsight, there are now a good dozen reasons I can think of why not...)

It's superbly made in Denmark, and weighs a lot!

... the weight mainly due to the huge toroidial transformer, and gargantuan heatsinks!

Look at all that smoothing.

The problem quickly showed itself.... something in the back of my mind said "this sounds valvey to me" .... but swapping the two 12AU7's (that's ECC82 to you and me) made no difference. I eventually traced it down to a thermally poor bias transistor on the right channel... or so I thought.

The amplifier behaved faultlessly on test with my Rotel pre-amp driving it, so I sent it back....

About a week later the phone rang again ... it's Gerald

"It's doing it again" ...

Send it back....

It arrived. I put it on the bench, and listened to it all night, as I was working on other things... It performed faultlessly.

I removed my power amp from my hifi to give it a damn good test .... months it sat there, performing beautifully.

.... then ... it did it...

"I've got you now!" ....

Put it back on the bench, and it was fine! No amount of tapping or banging would get it to fault....

I removed the PCB (not an easy task in itself) and checked every soldered joint. Not one was poor.

I was about to reassemble it, and thought I'd just check the bias again... and sure enough the right channel had drifted a bit. I adjusted it, and put it back on test.... then about 10 mins later, it faulted again!!! I changed every cap in the right hand bias circuit.

Working again...

After a week of perfect operation, it was returned to Gerald...

... where it ran for a couple of days ... and came bouncing back once more....

On the bench, and the fault was immediately obvious. Bias on the right hand channel was miles out.

As I probed my way through the circuit, the fault was progressively putting itself right.... the DC bias to the bases of the output pairs was decreasing. I traced it all the way back to the drivers, when the fault just wasn't there anymore.... I switched the amp off and went for a nice cup of tea....

I came back, and switched the amp on. Excellent fault present for a few minutes, then the bias was decreasing to a sensible level once again. Out with some "freezer spray on the cheap". Output was connected to a dummy load, and monitored on the scope. Finally some progress. Freezing and cooling a transistor in the voltage amp would cause the fault to come and go...


... I hope

               ... and so does Gerald...

Sharp Optonica SM-5100 integrated amplifier repair.

Colin wondered in ....

"Got this old Sharp amp, smoked last time it was switched on. Can you take a look?"

Yeah, why not....

It's from the unfairly overlooked range of Sharp Optonica hifi, an SM-5100. Optonica was a sub-division of Sharp, primarily to complete with other manufacturers high-end brands such as Panasonic's Technics.

Nice slender looking thing.... dating from the early 80's.

Removal of the top panel (not as easy as you'd think, it's a very tight fit!) reveals the culprit, the dreaded Rifa X class filter capacitor... in this case it's 0.0047uF 275VAC and X2 rated....

... which is soon evicted and replaced with a nice Vishay one.. again X2 rated. The X2 rating is crucial in this application.

Powering up and there's no smoke. There's also no output from the left hand channel. Pots and switches are all cleaned up to no avail...

After a little bit of head-scratching, and in fear of one of the STK-0050II output modules having failed (replacements are still available, but many are turning out to be faked, and either don't work or fail rapidly) RLY501, the speaker protection relay is found to have failed. A suitable replacement is sourced and fitted.

There's a good range of input and output sockets, two tape loops and a pre-amp to power amp bridge.

Two sets of speakers are catered for.

Look at that nicely shielded toroidial transformer.

The mains lead is replaced, at someone had cut it short at some stage, and fitted one of those daft "Masterplug" things with the tiny round pins.

It performs very well. Outputting a very reasonable 35W in 8 ohms. The phono stage is very quiet.

The amp is soak tested with "Upstairs at Eric's" by Yazoo, an album I never get tired of :)

Wednesday, 15 November 2017

Tannoy SFX5.1 Powered subwoofer repair.

Paul popped by.

"I've got this Tannoy subwoofer, it crackles and pops. Can you take a look?"

Yeah - why not......

It's a smallish cube, mounted on little cones, with a downward facing speaker...

I powered it up, and all was quiet. 

Just as I was about to connect the signal generator, I heard thunder in the distance .... and it got louder and louder! The speaker was popping and crackling alright. I quickly powered down.

I removed the screws around the outside of the rear panel, to reveal the speaker. The electronics and amplifier are mounted on the rear panel itself....

The main amplifier, a TDA7293 is heatsinked to the rear panel.

Removal of the board showed signs of distress....

Q151 and Q152 and there associated components had been running rather warm! The colour of the cases of the transistor should be black, you can see in the photo that they've changed to a sort of powdery brown.

Q151 is a 2S1815, NPN, and Q152 is it's complementary PNP, a 2SA1015.

Static testing on the transistor tester showed both to be fine. But the fault seemed to exist only when the thing was drawing current, so I threw caution to the wind and replaced both transistors. The two diodes, the two resistors and the caps all tested within tolerance.

Switch on again, and it's cured!

In the above picture, you can see two wire links across F152 and F153, where there was place for a couple of fuses. The wire links are original, so the fuses were obviously deemed unnecessary, relying on the non-replaceable thermal fuse in the transformer...

Not sure I like that idea much....

*** STOP PRESS *** 12th May 2020.

Many, many people visit this site to look at this page, and, sadly can't find the correct transistors. 

The SCA1015 is obsolete, a KSA1015YTA is still available.. You can try a BC556, but you need to fit it backwards, and reverse pins 1 & 2 (Check the datasheets)
The 2SC1815 is still available from mouser, or you can fit a BC546, again reversing the leads. (Check the datasheets).

These transistors are pushed hard in this application. When (if) I ever see another one, I'll look for a better solution. 

*** STOP PRESS *** 13th January 2021.

PeterCB has been working on his subwoofer, and replaced the 2SA1015 with a TIP32, and the 2SC2818 with a TIP31.

"So I went ahead and replaced the transistors with TIP31C/32C in a TO220 package. Been soak testing for about six hours now, they don't even get warm. The new transistors fit perfectly in place of the originals, just facing the opposite way, see picture"

This has got to be the best solution. An easily available transistor, that's not being pushed beyond it's limits. 

Thanks PeterCB! 

*** STOP PRESS 15th March 2021 ***

Avid reader Springknees has kindly created a schematic of the offending power supply section. 

It can be found at and is reproduced here with permission. 

Sunday, 5 November 2017

Classic Mini 1275GT Electronic GPS Speedometer and multifunction display revisited.

A few months ago (was it really that long?) I created an electronic solution to the classic Mini speedo (here)

When I posted the article up on a couple of sites, there were a few comments from people that they didn't like the movement of the speedo needle. I can see why, as it only moves in discreet "clicks" every 1 mph. They would like it smoother.

"Easy" I thought.... oh how wrong I was!

I initially started by changing the speed value from an integer to a float, and dumping the map function. It was an improvement, but had a tendency to jitter about. Nope. Not good enough.

Back to integer speed, and an attempt to control the update rate by creating an array and loading the array with the car's speed every time it updated (every 250mS). I then got the microcontroller to detect the slope of the changes in speed and move the needle quicker when the car was accelerating (or decelerating) hard, and slowly when the acceleration wasn't so hard.

Well, it didn't work very well. I could see the sketch was working, but the amount of data needed to sample, and the time it took to calculate the amount of delay to add to the pointer caused the update rate to slow to an unacceptable amount, and the speedo to appear "laggy". I attempted to improve the speed of the sketch, and revised the code a number of times, and even forced the compiler to optimise for speed over code size, all to little avail. The idea of delaying the speed of the pointer seemed sound though.

I drank some tea .....

A few weeks passed, and I had another idea. Don't attempt to measure the acceleration of the car. Control the acceleration of the needle with regards to it's position. The sketch now sampled the speed, and set the needle motor target position to that value. Now change the motor position, one step at a time, towards the target position. As the pointer approaches the target, increase the delay between each step. A few tweaks to the amount of delay applied, and it works! In effect I've created a PID controller for  the pointer position (actually, there's no D).

I've also changed the code to the multifunction display, which now displays a warning for ice, no GPS, and no charge (ICE, GPS or CHG are displayed)

The revised code (including the required libraries) can be found here :

Just click on "Clone or download" and download the zip. Unzip into your Arduino directory. Place the libraries in the library directory.

Wednesday, 18 October 2017

Metcal MX-PS5000 repair.

Been very busy, in a commercial sense, building some transmitting equipment ...

... and just as I'm about to solder the last two wires on the front panel of said equipment, the iron goes cold ...

The soldering iron in question is the very, very wonderful Metcal MX-PS5000 system. I used to think Weller made the rolls-royce of soldering irons, but these things are just in a different league!

They heat the element by RF induction heating. 13.560 MHz to be precise. It's got all manner of error detecting, it'll put itself to sleep when not in use, and also has outputs for two irons. It's also expensive.

So I think, it's probably gone to sleep ... nope.
Perhaps the tip has failed? No... (takes two seconds to change too!!)

Damn ... the emergency iron is flagged into service, and the job finished...

A new MX-PS5200 is ordered (at about £500!.. ouch). We simply can't be without it.

But let's see if we can't do anything about the old one...

Firstly, remove the retaining nuts from each of the F-connectors.

Flip the unit over, and remove the 4 security torx screws, one in each corner.

Right, that's got it out. To remove the board there are several small screws to undo, and remove the screws from the heat sinked (heat sunk?) devices, noting which are insulated from the heatsink, and which are not. The wires connecting the power supply in the back and the main board are quite short.

First thing was to check the presence of the +48V  and  +24V supplies from the switched mode mounted in the rear third of the enclosure.. all present and correct... damn.. out goes any ideas of a blown fuse and a quick-fix! There's no hope of getting a schematic, so it's down to the poke-and-hope method of fault-finding....

Checking a few parts, shows the main output FET to be dead short ... It is (or rather was) an IXFH12N50P, which is no longer available. An IXFH16N50P looks like a good candidate, and is pressed into service.... still not warming the iron... damn. It's gate is driven by a drive amplifier, which is in turn driven by an oscillator formed by a crystal, and a 74HC04 hex inverter... the hex inverter is duff, and is replaced, and so is the supply to the drive amplifier...

It's an LM2576-ADJ (not that you'd know from the photo) .... and replacing that restores the supply to the second stage of the drive amp, but not all of it .... damn.

The final piece of the jigsaw is D12 in the small switched mode buck converter .... it too was dead short ... lord knows what the original is, there's no circuit anywhere on the web, so I selected a 1N5819HW for the job, based on the datasheet for U3. It's physically smaller than the diode it replaced, but it seems to work! I've got a hot iron!

Excellent ! We now have a spare in the workshop.

Not sure I like Metcal's new logo much ...

Saturday, 30 September 2017

BSR UA14 Monarch Plinth.

Remember my BSR UA14 record player from a while back? (No? Click here!)

Well, it deserved more than an Asda cardboard box to sit in. 

My friend Julian supplied a bit of plywood to make a suitable top from, and another friend, Barry, cut the required shape out (copied from another record player fitted with the same deck, and soon to be featured on these very pages). Barry also made some MDF sides for it.

Now, I could paint it ... but I've got another couple of turntable plinths made by Carl Ellis I'd like to veneer, so this would make the ideal test piece.

Some mahogany veneer was procured from the very wonderful people at who were most helpful and rookie tolerant (even sent me some free samples)

I tried some different samples out on a small wooden box, and after some initial success, got on with the job in hand...


Trimming of the edges terrified me. What if it split? I'd have to remove it and start again! I'd read on the internet that a veneer saw was the way to go, and it needed to be razor sharp. I didn't want to go to the expense. I initially just cut the veneer to the rough size before gluing with a pair of sharp kitchen scissors! I trimmed the first part with a sharp scalpel. It went well enough ... get to within a couple of mm of the edge and sand it back with some 120 sandpaper to the  edge. Don't rush any of the process. The scalpel cuts with the grain with ease. Cutting across the grain isn't so easy, and requires multiple gentle strokes. 

With a couple of off-cuts, I experimented with finishes...

Whilst varnish looks good on the photo, The oil has a better sheen to it after a couple of coats. I used Liberon Finishing oil. It seems well thought of

So, now for the big piece that will cover the top.... this was difficult to get to lie flat, and, in hindsight I wish I'd done it first. Clamping it down proved problematic!! That's two dirty great power supplies, and a wooden box full of sealed-lead acid batteries holding it down whilst the glue sets!

After everything is trimmed up, and given a brief run down with some fine sandpaper, the first coat of finishing oil is applied, and left for 24 hours...

It's then given another rub down with fine wire wool, and another coat added....

This is repeated until I've built up 5 coats of finishing oil. It's important to follow the instructions on the bottle to the letter.

Once this is finished, the wood is lightly polished up with a fluffy cloth... and I must say I'm chuffed with the results!

Monday, 28 August 2017

Sinclair Stereo Sixty Amplifier.

Colin popped by, with an unusual amplifier under his arm.

Chap's bought this off me, can you take a look?

Yeah, why not...

It's a Sinclair (Sir Clive... think of the ZX 80, 81 and Spectrum computers, and the C5 electric tricycle, yeah, that bloke) "Stereo Sixty" Amplifier.

Now back in the 60's and 70's, before Sir Clive hit the big time with home computers, Sinclair sold electronic kits, and the Stereo Sixty was the preamplifier part of "Project Sixty", which consisted of a Stereo Sixty Power pre-amp, a Z8 power supply and a Z30 or Z50 Stereo amplifier module.

There was also a "Filter module"... and a quick web search show's it looks nothing like the module fitted to this module, but does show a similar one in "Project 80", although not available as a separate unit....

Lid off, and it's definitely home-built.... Coax used to get the audio from the din plugs, what looks like coax screening stripped off and used to screen the mains cable to and from the switch (?!) ...

and some rather too short wiring between some badly fitting phono sockets, to an attenuator hovering above the board ....

Gently powering the thing up produces some audio, and quite a bit of hum ...

That big red capacitor is open circuit...

Note the "Nomark" pass transistor, and the bridge rectifier shaped like a nut!

Dated Nov '71 ... it's almost as old as me, no wonder it's knackered....

There's a few other caps that are a touch low... these are replaced.

There are two output capacitors, each 1000uF, 63v, which read perfectly.... Sadly they can't be trusted. If they fail short, it's good-bye output stage, so they're replaced...

The dodgy mains-switch wiring is replaced... Someone was obviously paranoid about hum pick up... screened indeed!

The pre-amp is removed, and checked through.

The pots are horribly noisy, but clean up well. The co-ax is removed, along with the wiring that's too short ....

... and that floating attenuator replaced with something much nicer...

and lashed up for testing ....

All cleaned up and back together. I quite like it's blue and grey case ....

So... how's it sound?

I expected to be typing "of it's time" , but I think it deserves better than that , I was pleasantly surprised  ... It's quiet, and I enjoyed a couple of Matt Berry albums in the workshop whilst it was soak testing.

Of course, being a home built kit, this would vary dramatically on how it was put together in the first place. Whoever built this example was obviously paranoid about hum pickup. It's got a reasonable star-earthed design.

The bass control's centre frequency is far too high for my liking, and the PU input (for turntable pick up) seems very "flat", I suspect it was designed for a ceramic cartridge. Other than that, a talking point for Sinclair collectors everywhere, and very usable.