What’s This Blog About?

What’s This Blog About?

This blog will document a variety of interesting investigations and repairs of items of electronic.

“my favorite programming language is solder”
Steve Ciarcia, Byte Magazine

I have been involved in the design and repair of electronics, both at a professional and a hobbyist level, since the demise of the valve era. I am now retired but still find working with electronics interesting.

Improving a Water Cooler


In my work area I have a benchtop water cooler. Sometimes while working you need a quick break and a long cool drink of water.

Last summer, which was particularly hot, I notice that when the ambient temperature was high the water dispensed was not very cool. Also, a significant amount of water (3 x 300mL glasses) had to be dispensed from the unit before cooling would recommence.

Now that I was practising social isolation due to the coronavirus I had time to look at less important items that could need repair.

The Cooler

Obviously from the small size of the unit, the cooling element had to be a Peltier module and I assumed that the thermostat would be electronic. The unit has 2 status LEDs, one to indicate power and one to indicate cooling is occurring. According to the unit’s specification, the water reservoir held 5 litres but the chilled reservoir was only 600 mL in volume.

On opening the unit I found its general arrangement is as shown below –

Watercooler General Arrangement

The electronics in the unit consisted of an AC-DC converter PCB, a thermistor embedded in the lower section of the cooling reservoir and a Peltier device with heatsink and fan attached to the upper section of the reservoir. There was just one IC on the PCB, a TL494 switching regulator controller. There was also a larger than usual number of discrete components around this IC but no adjustment pot for temperature.

Now being able to check the internals in operation I was surprised to see that the fan was running even when the COOL LED was not on. The fan was running at low speed so was not noticeable when the unit was operating assembled.

When the COOL LED was off and sufficient water was dispensed the unit it started to cool again When the unit was cooling the fan ran at a much higher speed until the COOL LED turned off and then the fan would slow down again.

So how could I adjust the temperature if there was no temperature adjustment pot on the PCB? I needed to trace the circuit so I could locate and adjust the appropriate component(s). Also before and after I made an adjustment I would need to monitor the operation of the cooler.

Control systems are usually tested by applying step disturbances and observing the behaviour of the system’s output. Dispensing a large glass of water was the natural disturbance to apply. Actually dispensing 300mL of water is quite a large test step (50% of the reservoir capacity) but is appropriate in this application.

Tests were conducted in the following manner –

  1. The cooler was started with the reservoir at ambient temperature. The time needed to cool the water to a steady-state temperature and the actual steady-state temperature could therefore obtained.
  2. 300mL of water were dispensed and the rise in reservoir temperature and its recovery back to steady state monitored. When the system went to high cooling mode and when it returned to low cooling mode would indicate the system’s cooling mode change thresholds.
  3. Once steady state was again reached another 300mL was dispensed. Then after an hour another, and after a further 30 minutes another. This would show how quickly the system responded in heavy use. Water temperature would rise quickly so this would show any time delays in response.

Rather than sit around for hours observing a water cooler I decided to set up a simple data logger to capture data from the unit. I just needed to dispense water when appropriate then would analyse the data gathered at my convenience. A trend display also would be useful.

4 parameters would be logged –

  1. Cooled water temperature
  2. Ambient temperature
  3. Voltage on the Peltier element
  4. Peltier element current

The Peltier element and fan are in parallel so I did not need to monitor the fan. Later I found that the Peltier current was not that useful so this parameter was removed.

I had an Arduino Nano on hand so that was what I used. A bespoke data logger was assembled on a prototyping board using the Arduino Nano, a resistor divider for voltage measurement, and 2 x DS18B20 one-wire temperature sensors. The software was set up to take readings approximately every 60 seconds and output them in CSV format via the Arduino’s USB serial port. This serial data was received by a laptop and written into a Microsoft Excel spreadsheet using the Parallax PLX-DAC macro. As the data string arrived it was time-stamped by the macro then entered into the spreadsheet. The data was also graphed when received so creating an almost real-time trend display. After a test sequence was completed the data in the spreadsheet could be saved for analysis.

Data logger design, construction, programming, 1-wire setup, and calibration of the analogue input attenuator only took a short time and the logger was ready. The Arduino program was written in such a way that if more, or less, voltage or temperature channels were needed the program could be easily modified. This is a very convenient way to create a custom data logger. The software is shown below.

Arduino Code –

// cooler_logger_parallax.ino
// ---------------------------------------------------------------------------
// This code reads analog inputs and sensors on the Arduino
// and sends the readings to PLC-DAQ in Excel
// V1.0 30/3/2020
// V1.1 4/4/2020 Removed Peltier current channel

// I/O
int vSensorPin = A0;
int dsPin = 2; // One-wire on pin (4.7K pullup is necessary)

// Program variables
int voltageVal = 0;
float peltierVoltage = 0;

float ambientTemperature = 0;
float waterTemperature = 0;

int logPeriod = 60; // Seconds between readings

// Analog configuration
float vRef = 1.1;
float vScale = 1000.0 / (15300.0 + 1000.0); // Nominal 15K and 1K0 voltage divider. 15K value scaled to calibrate

//DS18B20 IDs
byte dsID1[] = {0x28, 0xFF, 0x6B, 0x5A, 0x63, 0x14, 0x02, 0xC0}; // Ambient
byte dsID2[] = {0x28, 0xFF, 0xDF, 0x15, 0x44, 0x04, 0x00, 0x54}; // Water

// Function protypes
float ds_read(int arr[]);
void processSensors();

void setup()
  analogReference(INTERNAL); // Use 1nternal 1.1V reference
void loop()


  // Send data to Excel

  // Delay between readings
  for (int i = 0; i < logPeriod; i++)

void processSensors()

  // Read voltage
  voltageVal = analogRead(vSensorPin);
  peltierVoltage = (float)voltageVal / 1023.0 * vRef / vScale;

  // Read ambient temperature
  ambientTemperature = temp_read(dsID1);

  // Read water temperature
  waterTemperature = temp_read(dsID2);
// ds_read.ino
// ---------------------------------------------------------------------------
// DS18B20 temperature read
// The DallasTemperature library does all the work for you
// http://milesburton.com/Dallas_Temperature_Control_Library

OneWire ds(dsPin);

// Read temperature from addressed device
float temp_read(byte arr[])
  int i;
  bool found;
  byte data[12];
  byte addr[8];
  float celsius;

  // Scan for required device
  found = false;
  while (ds.search(addr))
    //    Serial.print("Device req =  ");
    //    for ( i = 0; i &lt; 8; i++) {
    //      Serial.print(arr[i], HEX);
    //      Serial.print(" ");
    //    }
    //    Serial.println();
    //    Serial.print("Device found =  ");
    //    for ( i = 0; i &lt; 8; i++) {
    //      Serial.print(addr[i], HEX);
    //      Serial.print(" ");
    //    }
    //    Serial.println();

    // Check if addr and arr equal
    if (equality(addr, arr))
      found = true;

  // Return an error temperature if devices not found
  if (!found)
    // Serial.println("Not found");
    return -1.0;
    // Serial.println("Found");

    // Read temperature from device
    ds.write(0x44); // Start conversion
    ds.write(0xBE); // Read scratchpad

    for (i = 0; i &lt; 9; i++)
    { // Get 9 bytes
      data[i] = ds.read();
    // Convert the data to actual temperature
    int16_t raw = (data[1] &lt;&lt; 8) | data[0];
    celsius = (float)raw / 16.0;
    return celsius;
// Check for equality
bool equality(byte a[], byte b[])
  int i;
  for (int i = 0; i &lt; 8; i++)
    if (a[i] != b[i])
      return false;
  return true;

The Excel sheet with PLX-DAQ macro –

One-wire Setup

As the DS18B20s were connected on a single one-wire bus, first an Arduino program found in the one-wire library sample directory was used to scan the bus and identify the address of each of the devices present. Each one-wire device is encoded with a unique address in manufacture. I entered the identified addresses into my program so that specific sensors could be addressed and read.

Logger Results

The resulting data and trends gave much insight into the operation of the cooler.

Firstly, the fan/Peltier assembly was powered all the time.

When cooling was required the PSU output was around 12V. When not cooling the output was around 5V. The voltage did not gradually change between 12V and 5V as the cooling requirement reduced. It quite quickly switched between the 2 levels.

Initially I monitored the cooled water temperate at the discharge port. When a draft of water was discharged the temperature at the outlet was seen to spike low then rise.

Monitoring at output port

As water is dispensed it is replaced in the cooling reservoir by ambient water from the main reservoir. So the temperature in the cooling reservoir must rise but even though the temperature of the output port appeared to have risen by 20°C the controller did not start cooling again until a long time later. Cooling then ran for a time until some internal threshold was reached and it switched operation back to the low voltage mode. Because the Peltier element was still powered it slowly cooled the water but water temperature never reached a steady state and appeared to track changes in the ambient temperature.

Note, as the test ran for for over 12 hours ambient temperature changed during the day and into the night.

The initial dip in outlet temperature and the fact that the water discharged was not at the temperate of the water entering the reservoir indicated that there must be some internal baffling in the cooling reservoir. When water is discharging and new water entered the reservoir the cooler water at the bottom was pushed up to the discharge port. This behaviour also showed that the water temperature I was monitoring at the outlet was not indicative of the temperature that the Peltier module was cooling to. I should monitor the temperature toward the bottom of the reservoir where the thermistor was located. I lowered the thermistor into the cooling reservoir and a temperature difference of more than 3°C was seen between the water at the top and bottom. It was further noted that it took a significant time for the ambient temperature water that had been added to mix with cooled water and peak the temperature seen by the thermistor. Temperature stratification was occurring as the water in the cooling reservoir it is not being actively mixed while cooling.

Performing further water discharge tests the characteristic of the water at the bottom of the reservoir was obtained. At this location the water temperature rose as multiple drafts of water were discharged. Cooling though did not cut in till the water was more than 12°C above the initial steady-state temperature.

In reservoir response of Watercooler

Independently I measured the actual temperature of the water that had been dispensed. As expected it was always higher than the temperature measured by the sensor in the reservoir.

I consider that if the dispensed water was 10°C or less it would be acceptable for use.

For a temperature control system the logged data indicated performance was poor. It set down too early before the set-point was reached so took a long time to reach the set-point. Also it had a narrow but delayed deadband in reacting when cooling should stop/start. These poor control characteristics would be the cause of a number of the problems originally noted in the unit’s operation.

I therefore decided to attempt to improve these characteristics. For this I needed to reverse engineer the control circuit to find its arrangement so that I could undertake tuning.

Watercooler Schematic (traced)


The circuit appeared to be a standard TL494 pulse width modulated converter but the circuitry around the error amplifiers was much more complex than usual. To aid understanding I drew the circuit so that the control section of the TL494 could be looked at independent of the power section. This helped make the schematic clearer. A custom 2-part library for a TL494 was created for this purpose.

The TL494 has 2 internal error amps whose outputs are ORed together to provide the feedback to the power stage. This ORing of the error amp outputs resulting in the amplifier that is demanding the minimum pulse width out dominating.

Initial it looked like Error Amp 1 would control the regulation of output voltage while Error Amp 2 controlled the temperature. Unfortunately, it was not so clear cut and the circuit’s operation was far more convoluted than I imagined. The key source of problems was that the design needed to maintain a minimum output voltage from the inverter of 5V so it could power itself. Also apparently the designer had decided to use just the one IC to implement the whole control.

The TL494 is a very common pulse width modulating regulator controller. Almost every PC power supply from the original PC through to the latest high power gaming rig uses this IC in their power supply. In a PC supply, there is a standby 5V output that is used to power any circuitry that always needs power. The water cooler only has one power supply output and this needed to be 5 V or greater to allow powering of its control IC. Faced with this the designer decided to have the PSU output 5 volts to the Peltier module even when it was not needing to cool. In operation the cooling reservoir has losses to ambient hence it will need some make up cooling energy to maintain steady-state water temperature, so this is an acceptable decision.

As an aside commercial Peltier modules degrade over the long term when operated with on-off power cycling because it results in sharp temperature fluctuations across the thermocouple elements. Therefore, it is potentially beneficial to module life to always keep the module under some power. When it is turned off convection from the cooling reservoir cools the module so results in thermal shocks when powered up again.

So how does the circuit work? Initially disregard Error Amp 2. Error Amp 1 in conjunction with the voltage divider R27, R7 and R8 is a standard voltage regulator arrangement and would set the PSU voltage to someway between 5V and 12V.

Now consider the effect of Error Amp 2. Its input combines the water temperature, the PSU output voltage, and the control pulse width. When its output exceeds that of Error Amp 1 it takes control of the operation of the TL494 power section. The output voltage of the PSU will then be driven to either 5V or 12V. R5 gives some positive feedback to Error Amp2 to provide hysteresis so that its output will go fully high or low.

When the PSU output is 12V it remains at this level until the summed effects of output voltage, thermistor resistance, and output pulse width (circuit involving Z1 and D20) changes sufficiently. This then reduces the pulse width to a minimum which causes the PSU output voltage to fall.

When the PSU output drops to around 5V the voltage clamping action of resistive divider R24 and R25 in conjunction with D27 cuts in and reduces the voltage out of the resistive divider of R17 and R27 and the thermistor, so the PSU output settles to around 5V irrespective of the low temperature reached.

Unfortunately, disabling temperature control and going to voltage control once a low cooling temperature is reached had a major downside. When the ambient temperature changes the water temperature will be affected because being powered by a fixed low voltage the Peltier element can only remove a limited amount of heat energy. Hence on hot days, the cooled water’s steady-state temperature will be higher than on normal days.

After trying to understand this operation it left an impression of a circuit that had grown by trial and error rather than having been designed. It was both ingenious and clumsy at the same time. My understanding of the circuit’s operation may be somewhat in error but the circuit is still a kludge.


Overall the circuit’s cooling temperature control and response to temperature disturbance are barely adequate for the task. Just adding a cheap op-amp (e.g. LM358) to the circuit would have allowed temperature and PSU voltage control to be segregated so both could be better.

So now knowing that the control circuit was inadequate you may think I envisaged modifying the circuit with some additional op-amps or even, as is often proposed by others when faced with a flawed design, to replacing the whole control circuit with a microcontroller!

No I did not. After all it is just a cheap water cooler and the main problem was that the water was not cool enough for my liking. Also from the data gathered several major issues with the mechanical arrangement of cooling, temperature measurement, and discharge port location were apparent.

To allow the system to get to temperature faster and recover quickly after a disturbance a better control system for cooling types of application would be of the PID variety. But PID control may not be capable of dealing with the large transport delays that are present between the cooling element, the temperature sensing device, and the discharge port. Perhaps feed-forward control would be needed. These control loop(s) would then need to be tuned, making a replacement control system far more work than it would initially appear.

Being pragmatic I decided to just lower the operating steady-state water temperature with the hope that the unit would then be acceptable to my needs.

Looking at the schematic, now with a reasonable understanding of its operation, it appeared that changing R27 would accomplish that. I therefore replaced this 27k resistor with the next highest preferred value, 30k, and ran the tests again.

Improved response of Watercooler

The effect of this simple change were significant. The steady-state water temperature dropped a little below 5°C but was reached far more quickly. The temperature of the dispensed water stayed below 10°C for multiple drafts. High cooling was cutting in faster after water was dispensed and also recovery cooling ran for longer before setting down. Also now because the water temperature was able to change the Peltier voltage more readily, higher ambient temperatures should have a lesser effect.

Increasing R27 yet further to 33k did not improve operation. It actually prevented operation ever coming out of high cooling mode so the unit kept running trying to cool the water temperature down. It managed to reach below 3°C.

I therefore returned R27 to 30k. The performance was now adequate for my purpose so I re-assembled the unit and put it back into service.


What was gleaned from this exercise?

  1. That thermodynamic performance of a system is a combination of its physical and electrical characteristics. Control systems can only partially compensate for limitations of the physical system and often control system tuning is more art than science.
  2. That an highly minimised circuit may not work as well as its designer planned. A straight forward circuit can be better than a highly optimised one.
  3. That analogue circuitry has great sensitivity to component values. Hence a small variation in a key component value, can have a major effect on the operation.
  4. Any design can be somewhat improved once you understand what it is trying to do and how it is currently working.

A number of these points though must be qualified by the realities of designing for mass production of low cost items. The circuit only has to work. A higher performance design may not be warranted. If thousands of units are to be produced, then a small reductions made in the design’s BOM will add up to major savings to the manufacturer.

Looking on Chinese Wholesaler web sites I found similar water coolers to the one I have are currently being sold in lots of 100 for under $20 a piece. I remember buying my unit retail a few years ago for over $80. If extra circuitry added a few $ to the price I would still buy the unit, but increasing of the cost to the manufacturer by just a $ could significantly diminish their sales and profitability.

Repairing a Digital Clock – or how to erase EPROMs

On my workshop wall I have a digital clock. Now digital clocks are not normally something of any interest but my clock had 2 ½ inch (6.5cm) high red LED characters which meant that it could be read from any location in the shop and it has been running 24 hours a day for almost 20 years.

Recently it stopped – no display, dead. Looks like I needed to see if I could restore it to life.

On removing the PCB assembly from the case I found that it comprised 2 stacked PCBs – a control board and a display board. The control board had an 8052 family microcontroller and a DP8572 RTC chip. The display board had 2 x MM5450 LED driver chips to light the series LED strings that made up each of the 7 segments of the 4 digits of the display.

The 2 PCBs

The 8052 was an extremely popular microcontroller from the 80s. It was first developed by Intel and second sourced by a myriad of other semiconductor manufacturers. Even today its instruction set is the basis of many devices but of course with much faster clock rates and additional peripheral functions.

The actual chip used by the clock was an 8032 which is the ROM less version of the 8052. An external ROM is needed to provide its program memory.

Control PCB in detail

ROM less 8052s were often used in products as the 8052 only had an inbuilt program memory of 8K and this was masked ROM which meant that the code had to be programed in by the semiconductor manufacturer and they would have a minimum purchase quantity requirement. If program changeability was required then a new micro chip had to be manufactured to replace the old chip on the PCB or the much more expensive UV erasable 8752 used. Using external EPROMs gave both flexibility and cost benefits.

With the introduction of Flash memory UV erasable memory has been consigned to the history books but what I had was a faulty clock with a micro that used an EPROM for program memory.

Fault Finding

First I checking the power supply. It was a basic transformer and rectifier which delivered 8-9VDC un-regulated for the displays and fed a 3 terminal linear regulator to provide 5V to the micro and its companion circuitry. After checks, everything there looked OK.

The microcontroller circuitry was looked at next. All chips except for the EPROM and RTC were soldered to the PCB so powered fault-finding would have to be used rather than chip substitution.

Powering the control PCB and probing around the various signals with a logic probe the micro appeared to be totally inactive. Using an oscilloscope there appeared some activity on the XTAL1 and XTAL2 pins but that was it.

Of specific concern was that there appeared no ALE (Address Latch Enable) activity. To allow the 8052 family micros to address external program memory they multiplex their memory data and address lines. A latch de-multiplexes the 8 LSB address lines from the 8 data lines using the micro’s ALE signal to enable the latch.

A mimimal 8052 schematic

Without ALE activity the micro would not fetch program instructions to execute. Was there something wrong with the EPROM, the latch, or the micro? As the EPROM was socketed it could be checked first. It was time to dig out my micro development tools from the good bad old days.

Back when I used to work with 8052s one trick for checking out a system I was bringing up was to create test ROMs. These allowed memory to be stepped through regularly so that that address or data signals could be synced to and displayed on an oscilloscope. Logic analysers were expensive devices so a normal oscilloscope could be pressed into service this way.

I would need a PROM programmer plus an EPROM eraser and some spare EPROMs to create a test ROM. A trip to the storage shelves in the garage found the programmer and some pulled PROMs but where was the eraser? An eraser is a unit containing a UV lamp, a timer, and a drawer into which you place the EPROMs to be erased. When the drawer is closed the UV lamp starts and given sufficient exposure time erases the EPROMs, generally around 30-40 minutes as I remember. The timer also prevents over exposure which may degrade the EPROM internally. After further fruitless hunting for the eraser, I gave up.

At least I had the programmer so I inserting the EPROM from the clock into the programmer and attempted to read it. Various hex characters with the odd readable ASCII string were displayed on the companion PC application, so it looked like the EPROM was readable.

A ROM filled with NOPs (No Operations) is the most basic test code for any micro. The NOP instruction for the 8052 is 0x00 so I need to write an EPROM containing all zeros. An EPROM needs to be erased before it can be re-programmed. Erased EPROMs reads as all 0xFF. How could I erase one of my spare EPROMs so it could be re-programmed? Supposedly an EPROM with its window exposed will be erased by strong sunlight in a few weeks but I was not planning on waiting weeks.

A Substitute EPROM Eraser

That weekend I made a trip to the local charity store. You never know what you may find there, and this time I spied a used UV nail lamp for $5. After a bit of banter from the ladies in the shop about why I would need a nail gel drying lamp, I took my lamp home (who says only middle-aged men are sexist).

I popped some EPROMs into its hand aperture, turned on the unit and 3 of the 4 lamps lit. I then waited for 40 minutes. I removed the EPROMs and checking them in the programmer but none were erased. I tried a second time and still they did not erase. A bit of online research refreshed my memory on the type of UV lamp that is needed to erase EPROMs. The light wavelength must be around 253 nm and nail gel drying lamps have a UV wavelength in the range of 340-380nm. So these could never work as an eraser.

With nothing to lose, I decided to open up the nail lamp and see whether I could fit different lamps. The enclosure was usable and the unit had an electronic timer which perhaps I could modify to suit EPROM erasure times.

The nail lamp’s internals

Looking at the lamp in the unit they reminded me of the germicidal lamps used in aquarium water sterilizes. A bit more internet research indicated that both gel drying and sterilizing lamps are available with a G23 base, have power ratings of 9-11 watts, and potentially used similar ballasts to operate them at 110-220VAC. Therefore I visited my local pet store and purchased 2 sterilizing lamps and being the weekend I began some experiments.

UV lamps. Germicidal on right

Internally the nail lamps circuit appeared to simply rectify the mains then drive a self-oscillating high-frequency converter. All the lamps were driven by the output from this converter through individual ballast inductor. The timer function was NE555 based. In timer mode, it turned on a power MOSFET to enable the converter for 2 minutes. The converter output was measured and found to be around150VAC at a frequency of 20KHz. Output at the lamp fell to 50VAC once the lamp struck.

As lighting would not be needed from the sides for EPROM erasing I only planned to install the germicidal UV lamps at the topmost 2 positions in the hand chamber. After a few checks of whether they would fit, I installing the germicidal lamps and turned on the unit. For tests while the case was open I left the lamps covered with their boxes because their light is dangerous and could cause skin or eye damage.

Unfortunately at power on I noted that the heater elements of the lamps only glowed very dully and then when the starter in the lamp’s base operated the lamp did not strike until at least 30 seconds of failed attempts to light. Obviously, I needed to run the heaters at higher temperatures to increase ionization so that the lamp would strike more quickly. With the lamps lit the voltage across them measured 40VAC and the frequency of the converter had risen to around 24KHz. I concluded that the germicidal lamps were drawing somewhat different power to the original gel drying lamps although all were nominally rated at 9W. As a gas discharge lamp’s voltage drop when in glow discharge depends on its internal gas composition and remains relatively constant with varying lamp current, power cannot be inferred from a voltage measurement. As I was only going to use 2 lamps, not 4 I felt that the converter would not be overloaded even if the new lamps were drawing more power.

As I often do when fault finding items without circuit information I decided to trace out the circuitry around the areas of interest. As the circuit was relatively simple I ended up tracing the complete schematic.

Lamp schematic (as traced)

After reviewing the converter arrangement there appeared no way to increase the heater current except by reducing the ballast impedance. The only practical way of doing this using the existing components was to parallel 2 ballast inductors to one lamp. This I did and the lamps were found to strike within 1-2 seconds of power-on. I now had the lamps lighting but what was the lamp power? With the reduced ballast impedance was I overloading the lamps hence shortening their life?

Modified wiring for germicidal lamps

Gas discharge lamps have negative resistance characteristics while the converter’s self-oscillating frequency is dependent on its load. This would be quite a complex interaction and too much analysis to do in PSPICE for a Saturday afternoon. In the end, I decided to be pragmatic. My lamps were of an unknown brand but according to online data published by Osram germicidal lamps of their manufacture have an operating life of 8000 hours. As I only wanted to run my lamps a few times for less than 1 hour at a time to erase EPROMs the lamp life was not an issue of concern.

The nail lamp has a timer that gives an operating time cycle of 2 minutes. I wanted to erase my EPROMs for 30-40 minutes. Although a NE555 is capable of providing time delays of hours it not normally used for such long periods due to practical considerations of the timing components. The circuit had a timing resistance of 1M ohm and a timing capacitance of 100uF which gave an operating time of 2 minutes. I needed to increase this time 15-20 times. Practically the resistance should be kept under 2M ohms due to trigger pin current requirements so I decided to leave the timing resistance as it was and increase the capacitance. For capacitances of 10-15 times 100uF only electrolytic capacitors are available. Electrolytic capacitors have large capacitance tolerances and leakage current which are temperature dependant so are not ideal for precision timing but again being pragmatic I just need a rough time delay to shut the UV lamps off after a suitable erasure time had elapsed.

Following through the NE555 circuit arrangement I found that it was being operated at a Zener regulated 10VDC supply. As the timer’s internal trigger voltage is 2/3 of supply voltage the capacitor would need a working voltage of at least 6.7V. This meant that the common 6.3V working voltage of many high value electrolytes would not be suitable. In my parts drawer I did have some 1000-2200uF 10V working capacitors so I selected the capacitor from those. What I wanted was a capacitator with low leakage current so as to not drastically affect timing. I found that various brand capacitors, especially if low EST types, had appreciable and different leakage current (uA). In the end I settled on a Teapo 1500uF 10VW part.

Testing this capacitor in the circuit over a couple of trial runs the operation time was found to be 40 minutes maximum, which was in the range I required so I installed that capacitor permanently.

On reassembling the modified nail lamp and after conducting a few more operational tests I placed all my pulled EPROMs onto a piece of antistatic foam and inserted them into the hand opening of the lamp. I faced this opening to the wall so no one could accidentally look directly at the lamps, then ran an erasure cycle. There was enough glow through the plastic of the case to see that the lamps were on. After the cycle completed I checked each EPROM with the programmer and found all were blank. Next, I wrote one EPROM to all 0x00 to use as the test ROM I required.

Modified lamp in operation

Clock Repair

I installed the newly created test ROM into the control PCB’s memory socket, powered up, then monitored the ALE signal.

Unfortunately still no activity!

Re-grouping my thought I consider what I had discovered so far and realized that I had never actually seen clock activity with the logic probe, only some signal with the scope. The clock oscillator should have had a recognizable clock waveform at its XTAL2 pin – the output of the oscillator, but the probe did not detect any logical level activity. Was the crystal the problem? Digging through some junk circuit boards I eventually came across an 11.05MHz crystal, the frequency of the crystal on the PCB. I installed this crystal and tested the PCB again. Regular activity was observed at the ALE pin. So the crystal was a problem.

Next, I-installed the original EPROM into the clock board and re-attached the display board. On power-up I was greeted with a functional clock. again.

Clock working again
Note: graduated display brightness is due to camera being close to display
Also the contrast is much higher when the display is behind the case’s red filter

Before putting everything back in the case I checked out the display in detail. I noted that an LED on one of the display segments was less bright than the rest. As all the LEDS had probably be brightness matched I removed a status LED from an unused function – date mode, and swapped it with the dull LED. The time display now looks 100%.

Although I had spent a day faultfinding a basic digital clock most of that time was trying to obtain the appropriate tool set. Also I had revisited memory lane.

Finally, during my internet browsing I had read that EPROMs have a theoretical data retention life of 25 years so I cloned the original clock EPROM to have a spare if it ever failed. Let’s hope I can find it in another 20 years’ time and perhaps I will also find my original EPROM eraser then.

Big Mouth Billy Bass

Big Mouth Billy Bass

While visiting the local op-shop (charity store) just before Christmas I came across an original Big Mouth Billy Bass. For $2 you cannot go wrong so I gave it a new home.

Checking the battery compartment there was no sign of corrosion from leaking batteries so I put in some batteries and turned it on. On pressing the red button on the name plate the fish wiggled and the repertoire of 2 songs played alternatively each press. It appeared to be working.

The sensor in the name plate also triggered a song when a shadow passed across it.

After half an hour the annoyance caused by the 2 song repertoire playing over and over again emerged, so I had to turn it off. Not knowing anyone I disliked enough to give this annoying device to as a gift I decided I would pull it apart to see what was inside.

Big Moth Billy Bass Dissembled

Opening up the base I found a through hole component PCB and a tangle of wires . The PCB had a number of engineering changed – components not installed and the spare solder pads used to add jumpers or additional components. Looking at the poor soldered connections on the wires from the PCB to the peripheral components it was obvious that the device must have been assembled in Asia. A label on the back confirmed “Made in China”. This emphasised to me that Chinese assembly has come a long way since 1999, the copyright date on the unit. These days even the cheap items from Ebay or Banggood have a reasonable quality of construction.

Six wires from the PCB went into the fish. Two of the wires could be seen to go to a small motor and I assumed that the remainder went to other motors in the mechanism. PCB markings confirmed that there were 3 motors.

On triggering the fish the tail and the mouth moved but the head did not. I checked with a meter and it appeared each of the 3 motors were energising during a song cycle but only 2 planes of movement were occurring. By removing a number of screws and disconnecting the fish’s cloth skirt from the baseplate the fish itself could be removed. After a bit of inspection and judicious keyhole disassembly I discovered that the motor that made the head move did not have a drive pinion on its shaft so could not provide motion even though the motor ran. Eventually the broken pinion was shaken out of its gearbox. After going through some other junked toys I found a suitable replacement pinion and the motion was restored.

Motions are created by the motors driving the head, tail, or mouth mechanisms until mechanical stops are encountered. A motor may continue to be run for a short time stalled. When a motor is de-energised a return spring restores the fish’s position to its starting location. Motors are energised and de-energised at appropriate points in the song so that the motions appear to match the song.

Stalling the motor may be the reason why drive pinions fail. Broken drive pinions have been reported by others on the internet.

Turning to the PCB, what it contained intrigued me. Although the COB assemble at the right end of the board was obviously the sound generator it had 10 PCB connections so must be doing something more complex than just generating the music. In all probability it was a microcontroller so would also control the motions etc. But then why did the PCB need 10 additional transistors? What were they doing? I would need to trace the circuit to find out.

Big Mouth Billy Bass PCB

With the circuit traced I found that 3 transistors created a simple 3.5V linear regulator, 3 transistors were used for the light triggered circuit, 3 transistors were divers for the motors, and the final transistor drove the speaker. I also found the ON-OFF switch on the back of the unit was not to switch the battery power to the unit, rather it turned the light triggered function ON-OFF.

Except for the voltage regulator the circuit topology was relative uncomplicated. The regulator arrangement provided a reasonable regulation although it used no reference. The whole circuit drew a quiescent current of around 10uA hence there was no need for a power switch.

Big Mouth Billy Bass Schematic

Now that I had identified the internal circuity was there anything that this circuitry could be used for to make the fish’s antics more interesting?

Over 10 years ago there were numbers of article on the internet on modifying these units to allow them to play additional tunes. In later years people replaced all the original electronics with Arduinos so as to play alternate sounds and to add additional functionality. In 2017 modifications using Arduinos and integrated with the Amazon Echo were describe by various people, while in late 2018 a Big Mouth Billy Bass with Amazon Alexa functionality built in became commercially available in the USA.

It would appear that newer versions are somewhat different externally to the original that I have. Also the internal mechanical mechanism has been significantly redesigned and the new PCB circuitry is much more integrated and smaller.

So what to do with my original?

My plan is to just remove the COB assembly and reuse the motor drivers and the light detector on the existing PCB. A micro with Ethernet connectivity to obtain NTP time would then be added. Sounds can be created by using a sound module playing files from a SD card. The sound module would directly drive the speaker. Perhaps the 3.5V regulator should be used to power the sound module as a micro module’s regulator generally has limited current capacity.

To dispense with the problem of tunes or witty saying quickly getting boring I propose to change the functionality to that of a talking clock. This would give the current time whenever the button is pressed or when someone moved past the fish. In this way utterances will be both useful and a little different each time.

If I want to take modifications even further then integration with Google Assistant, which I have had some experience with, would be undertaken but then the project would mainly involve that other programming language – software, which is not in the scope of this blog.

Sunkko Spot Welder Repairs

Sunkko Spot Welder Repairs

The Sunkko range of spot welders are low cost, hence popular, spot welders for constructing rechargeable battery packs. They are manufactured by Meilidee Electronics Co. Ltd. an unknown Chinese company.

Many users have reported problems of reliability. The internet has multiple forums asking about how various models can be repaired but the only practical repair articles found involve replacing blown triacs then making simple circuit additions – heatsinks, current limiters, etc.

Because of their low cost, and despite reported failures and lack of repair information available, the Sunkko units are very popular with hobbyists who make battery packs for RC models, e-bikes, home built power walls, etc.

Background to Repair

I occasionally volunteer at a local recycling group that disassembles e-waste into their component materials – metal, plastic, circuit boards which are then on sold to material recyclers. The group also undertake low volume manufacture of custom electronic designs that can utilize some special components derived from the disassembled electronic equipment. The most common reused component are 18650 Li-Ion batteries from faulty laptop battery packs.

Battery packs are disassembled and the failed cells identified. The remaining potentially reusable cells are tested and graded. The higher grade cells are then rebuilt into battery packs which are used in a number of the designs.

The group therefore has a number of battery spot welders, all from Sunkko, in regular use. In service these units generally only last a year or two before they fail. Faulty units are replaced as repair attempts had been invariably unsuccessful.

Given that there was now a collection of failed units I decided it was worth the time to investigate the causes of failures and so reduce the expenditure on new units. Different models from Sunkko have been purchased over time but the most common is the 709A. This is also the model most frequently mentioned in web comments.

Sunkko 709A

Internals of Sunkko 709A

Opening the unit what is found is a large power transformer and incoming AC power lead and fuse, a spring loaded mechanism to trigger and convey the high current welding pulses to the pair of welding electrodes, and a single circuit board mounted behind the front panel of the unit.

The spring loaded welding arms assembly passes through a square cut-out in the circuit board. To the left of the cut-out are 2 wires going to a temperature switch. This is installed in thermal contact with the power transformer’s winding. This safety device would stop the current pulses if the power transformer winding got too hot, although it has never been seen to operate in practice.

Two heavy cables from the transformer secondary connect to the pivoting welding arms. Two additional heavy cables from the transformer go to the PA Out connectors on the front panel. This is for the optional external welding probe which can be used instead of the on-board spring loaded welding arm mechanism.

AC mains power into the circuit card and out to the power transformer is via a 5 pin connector at the bottom left of the circuit card. At the bottom centre of the board is a 2 pin connector that connects to white illumination LED mounted on the lower surface of the welding arms. Finally wires soldered at the right hand bottom of the circuit card connect to the front panel’s soldering iron connector.

All the controls and indicators to the front panel are mounted directly on the other side of the circuit board.

It is possible that the more recent version of the 709A has revised the circuit board layout and removed the necessity for the PCB cut-out so making it easier to remove the PCB, but the circuits will probably be much the same.


To do any useful inspection or repair on the PCB the front panel of the unit needs to be removed.

After the top cover is removed, remove the 2 screws that attach the front panel to the chassis.

The front panel will then be partially free to move but the thermal switch, the power connector to the board, the connector for the illumination LEDs, and the heavy wires going to PA Out sockets must now be detached.

The power connector just unplugs but is usually held in place with adhesive which makes unplugging it a little difficult.

The heavy cables to the PA Out sockets are held in the sockets by small Allen key head grub screws. After much fiddling these can be loosened and the wires removed from the connectors.

The thermal switch is just a push fit into the transformer winding and held in place with a blob of sealant, so is easily removed.

You should also now be able to unplug the connector for the arm illumination LEDs.

With these disconnected the front panel can move freely but the welding arms still pass through the cut-out in the circuit card. The front panel and welding arms must be manipulated to eventually clear each other. What makes it difficult to remove is that there is a small sub-circuit board containing a limit switch soldered at right angles to the main circuit board and hidden under the welding arms.

With the front panel separated the PCB can be inspected in detail. You will note that the built quality of the board is often poor. Solder flowed onto the SMD components and tinning of the larger PCB traces is often quite poor. This may be the most common cause for failures which I will describe later.

Close up of welder control section of PCB

A triac can be replaced without fully removing the circuit board from the front panel. To do this cut off the leads right at the device and soldering the replacement to the stubs of the leads. But with the front panel removed it is not too much more effort to fully remove the PCB and replace the triac by properly desoldering it.

Note that if the unit’s mains fuse has blown catastrophically (heavily blackened glass tube) then it can generally be assumed that the triac has also blown, or at least been severely overloaded, so should be replaced.

Unfortunately it will then be found that just replacing the triac often does not fix a failed unit and the replaced component will blow again on test.

During triac replacement some forums have recommended adding a finned heatsink as the PCB only provides a small area of copper to cool the triac. Installing a finned radiator heatsink can be accomplished by attaching the replacement triac with heatsink at right angle to its original position on the PCB.

I though prefer to heatsink the replacement triac by wiring it on extended leads so that it can be relocated and bolted to the welder’s metal work because small finned radiators are not very effective inside a sealed enclosure. The triac used must be a fully insulated variety or a silicon pad used to insulate it when it is bolted to the chassis.

Also in my experience a triac blowing is generally not because of overheating, but a consequence of other faults.

To get full access to the components on the PCB for inspections and repair the PCB should be fully removed from the front panel.

To do this the knobs of the SET CURRENT and SOLDER potentiometers are first removed. They just pull off. The mounting nut of the SET CURRENT potentiometer should then be removed so the circular clear escutcheon can be removed.

Ready to remove the potentiometer escutcheon

Now go to the back of the front panel and remove the 3 self-tapping screws and fibre washers holding the PCB . The 2 wires to the IRON sockets can be desoldered from the PCB. Alternatively, if you have no plans to ever use the units soldering iron just cut the wires off. The PCB can now be pulled free from the front panel. If the circuit card does not easily release then the 4 spade terminals connecting to the POWER switches may be the problem. These spade terminals can be spread slightly to free them from the switch terminals. Once the board is removed the spade terminals should be squeezed back into shape to ensure good connections are made with the switch terminals on re-assembly. Various bits of the PULSE selection push buttons will fall off once the board is removed so retrieve them for re-assembly.

SMD side of Sunkko 709A PCB
Through hole component side of Sunkko 709A PCB


The 709A welder’s circuit was reverse engineered by detailed inspection and probing of the PCB. Only the welding circuit was analysed. The soldering circuit was not investigated but it appears to just be a variable output DC switching supply. Note as there are 2 wires only going to the soldering iron socket there can be no tip temperature feedback. Therefore the iron temperature is not regulated and the solder temperature setting selected is only indicative. For quality soldering a dedicated temperature controlled soldering station should be used.

The welding circuit was traced sufficiently to gain understanding of how it worked so that repairs could be undertaken.

In usual Chinese manufacturing fashion the identification markings of the ICs have been erased from the devices. Therefore my circuit shows a number of devices with part number unknown. These devices’ function has been inferred from their surrounding circuitry.

Sunkko 709A Schematic (Incomplete)

My published schematic is not complete and there is no guarantee that it is correct, but with sufficient knowledge of electronics the information this schematic provides will be enough to successfully diagnose and repair many faults.

The labels (TP-V to TP-Z) shown on the schematic are test points found on the PCB. They had no identification so have been given nominal identities.

Further reverse engineering is underway and a more complete and correct schematic may eventually be published.

Circuit Operation

The welding control circuit is powered by a transformerless power supply. This is energised when WELDING is selected. Multiple SMD resistors drop the half wave rectified AC mains to DC on C6. The DC voltage is zener limited to around 12V and feeds a 3 terminal 5V linear regulator which powers the control circuity.

The blinking red LED is driven by a SCR relaxation oscillator. No actual purpose for this blinking can be determined.

The first amp of the dual Op-Amp IC5 provides a ramp synchronized with the zero crossings of the AC mains. This ramp voltage is compared with the SET CURRENT control setting. Once the ramp level exceeds that setting the second amp output goes high.

My explanation of IC3 and IC4 operation is purely hypothetical as the part numbers for these ICs could not be determined.

IC4 appears to be a triple latch. I could not find a common part that performs such a function but its operation is clear. Pushing a pulse number button causes the corresponding output LED to light and latch. Pressing the button again causes the output to turn off. The 3 latches can be turned on and off independently hence cumulative values of pulse numbers from 0 to 18 can be selected. The latch outputs are also inputs to IC3.

I believe IC3 is a microcontroller due to its complex functional. It takes in the weld initiation signal from the internal limit switch or the external foot pedal, the phase control turn-on point, the number of pulses selected, and outputs a signal to trigger the triac.

When a weld is initiated the phase control trigger point creates a gate trigger signal for the main triac at the appropriate point in the AC half cycle. C20 ensures the trigger signal is just a short pulse. By phase control the effective welding current can be varied. The number of pulses selected sets the number of half cycles the controlled current is present for. Because current flows for only part of a half cycle it is being called a pulse.

The value of the current is not actually regulated as the current flow depends on the resistance through the materials being welded, but by maintaining a pressure between the materials to be welded the currents, hence heating power for each weld, will be reasonably consistent. The pressure adjustment knob at the top of the unit sets a spring tension that opposes movement of the welding arms. By pressing the battery to be welded up against the welding arms until the arms move sufficiently to actuate the limit switch each weld will take place at a consistent pressure.

Various waveforms at key points of the circuit are shown below:-

Fault Finding

Having a schematic and knowing the expected operation of the various functional areas, systematic fault finding can take place.

Note you will be working on a live AC Mains circuit. Even the electronic common can be at a lethal AC potential. It is safest to use a mains isolation transformer to power the welder while fault finding.

The only connection that needs to be made to the PCB for testing is the AC power. To save energising the welding transformer or blowing a triac while initially fault finding the output wire to the power transformer (right most red wire of the power connector) can be disconnected by extracting it from the connector.

The unit has numbers of LEDs that come on or flash at various times during operation. Some provide no useful operational function and appear to have just been added to provide bling, but all can be useful to help in fault-finding.

On plugging in the AC power and turning on the WELDING power switch the red and blue LEDs at the top of the SET CURRENT knob escutcheon should be checked. The red blinks at around once a second while the blue is steady.

If no LEDs light there is obviously a control power problem to locate.

Due to poor quality of construction common faults noted are caused by dry joints or even resistors falling off the PCB! Components falling off appears due to poor reflow soldering or running very hot then coupled with the vibration each time the welding power transformer energises. This problem has been noted with the dropping resistors (R72, R73, R78, R79) of the power supply and the driving resistors (R68, R83) of the zero crossing detection transistor (Q19). If zero-crossing detection is not occurring reliably the triac may be triggered on randomly or for excessive time which will then blow the fuse and triac.

By triggering the welder by pushing up the welding arms the 2 red LEDs at the bottom of the CURRENT SET knob escutcheon should be seen to flash. The duration of the flash will vary dependant on the SET CURRENT and PULSE controls setting. The red blinking LED may also be noticed to extinguish for the duration of the pulse.

If the SET CURRENT adjustment appears to have no visible effect on the LEDs pulse the potentiometer itself could be faulty. Because it is mounted on an escutcheon that is not actual fixed to the front panel, the potentiometer body can twist when the knob is rotated to an end stop. This eventually causes the potentiometer to fail.

Once the lights are working as expected and the triac is known to be good then the power connector wire to the transformer can again be re-attached. With the transformer connected, on triggering the welder by pushing up the welding arms there will be a distinct audible clunk from the transformer even though no welding current is flowing.
The 2 white LEDs above the welding arm will also light whenever the transformer is energised.

Test welds can then be tried and hopefully everything will be normal and nothing will blow.

Note the unit’s name plate indicates the mains power fuse should be 20A but 15A is the highest rating that is readily available in the M205 package. A 15A fuse has been found sufficient.

Installing a lower rated fuse during testing is of no benefit when the transformer is in circuit. The fuse will invariably blow due to the high magnetization inrush current of the transformer. Also the type of fuse used has no chance of protecting the triac if there is still a fault.

If wishing to be cautious during final tests an external current limiting device such as a NTC thermistor can be used. Remember thermistors providing a soft turn-on function needs to cool down between operations to restore their current limiting resistance for subsequent operation.

Sunkko 788+

Sunkko 788+ PCB

I also investigated a Sunkko 788+model, again only the welding circuit. This is an older model which has been superseded by the 788H. It was looked at for circuit comparison purposes but actual operation could not be checked as it previously had been cannibalised by someone.

Its circuit is obviously different to the 709A as it has a digital display and different interface for setting the number of pulses but I assume that the general principal of operation for both would be somewhat similar. Looking at the circuitry of the 2 models did give a few answers to questions I had about then 709A’s circuitry.

It is noted that the 788+ uses a physically smaller transformer compared with the 709A. This implied that its maximum welding current or duty cycle is less although their specification sheets do not indicate this clearly.

Externally the 788+ looks identical to the 788H although photos seen of the 788H internals show significant difference in the control circuit board layout. The specification sheet for the current 788H model versus the 709A also indicates a significant difference in weight. This is consistent with the smaller transformer of the 788+ that I investigated.

Reverse engineering was again made difficult by the erasure of part numbers on ICs.

Its circuitry confirmed a microcontroller is being used. U5 interfaces with U6 which is a 24C02 I2C memory so the 14 pin IC U5 has to be a micro.

This U5 and U6 combination as well as manage the interface pushbuttons and digital displays appear to provide the similar core functionality to IC3 in the 709A so confirmed that the 709A’s IC3 is also a micro.

I may eventually complete the reverse engineering of the 887+ circuitry but I would prefer to focus on the current 887H model if one becomes available.

This welder’s control circuit needs more power to operate because of its LED display . The dropper resistors for its transformerless power supply are 1W through hole components rather than SMDs. This suggests that to prevent re-occurrence of the resistor problems in the 709A it would be useful to replace any missing 1206 SMD resistor with 1/2 W leaded resistors. Many of those SMD resistors are running far too close to their 1/4 W rating.

Conclusions and Rants

My experience indicates that failed Sunkko 709A battery spot welders can be repaired, often with only a few components. All that is needed is knowledge, which I have gone some way towards providing in this blog.

Can the Sunkko circuitry be improved? I am sure it can but to improve something you first need to know how it was supposed to work.

Junking then dissing the product or totally modifying it is not the technical way to repair something.

Although many comments on the internet criticise Sunkko products, they have obviously sold in large numbers so many of them must be in use trouble free. They also effectively meet the market niche for
low cost battery spot welders for hobbyists or small commercial enterprises.

All commercial products will have some design problems that affects a varying number of the units manufactured. A company would not still be in business if all their products were lemons.

As Sunkko welders work successfully for a period and are still in manufacture they should be able to be restored to working condition again. With information and cost effective spare parts most products can be repaired. Unfortunately now days most Chinese and other manufacturers do not readily entertain providing such support.