Translate

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 https://github.com/andydoswell/Timer
I've also included the library for driving the TM1637 display, which is by Bram Harmsen
and can also be downloaded from  https://github.com/bremme/arduino-tm1637

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...




Gotcha....


















... 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 :)