Category Archives: Bits and pieces

AMP RJ45 vs WE/SS (Regular) RJ45 Plugs

We’ve all heard that they’re different (somehow?) I thought this was going to be straight forward, turns out I was wrong.

Before we get into the details, we need to define what exactly an “AMP” plug is. In the first instance an AMP connector is made not by AMP, but CommScope. The AMP company was dissolved many years ago and its products have gone through various rounds of divestment and acquisition. Other brands this type of connector has been sold under (historically) are “Tyco” and “TE Connectivity”.

Non-AMP plugs are generally referred to as Stewart Stamping (SS) or Western Electric (WE) Style.

The second thing to consider is that eBay is awash with counterfeit products described as AMP plugs, but are not the products of any of the aforementioned suppliers, nor are they even physically similar to the genuine articles. Most of these are low quality SS/WE style plugs, and should not be used with AMP tools.

Suspiciously cheap AMP connectors for sale on eBay. Crystal? I generally prefer plastic. These particular ones aren’t similar to any CommScope plugs and would be destroyed if used in an AMP style tool
A bag of 100 genuine AMP style plugs – CommScope branding

There are two distinct varieties of “AMP” (ish) connector.

  • Traditional or “Line” style (as their documentation refers to them)
  • “High Performance” style
(Left: “Line” style connector (branded CommScope). Right: “High Performance” style connector (AMP branding). Which ever variety you are dealing with, if it doesn’t have the laser etched logo under the tab, and the two indents at the base of the tab, it’s counterfeit)
Left: “Line” style connector. Right: “High Performance” style connector. The high performance style is open inside, allowing the cable to be inserted all the way up to the contacts. More about that at the end of the article.

Example part numbers:

  • 6-557315-3 (Line style, round, 8P8C)
  • 6-569278-2 (High performance style, round, 8P8C)

Since you are here because of differences in tooling, let’s get straight into that. It turns out that these two require different tools:

  • 2-231652-1 (Black dot die) – Crimps “Line” style plugs
  • 3-231652-0 (White dot die) – Crimps “High performance” style plugs
AMP 3-231652-0 (1-853400-0 Die, white dot)
Left: AMP “black dot” die, Right: AMP “white dot” die

Which one is the fabled “AMP” connector? Both varieties are quite different to regular SS/WE plugs, however from a tooling perspective, the “black dot” tool for “Line” style plugs is significantly different. It is this type which other manufacturers sell tools labelled as “AMP” style.

For comparison with SS/WE I’ll be using the Stewart 2990003-01 tool (2990006-01 Die, yellow dot).

Stewart 2990003-01 (2990006-01 Die, yellow dot)
Left: AMP “black dot” die, Right: Stewart “yellow dot” die

When we look at the “black dot” die next to the one from the Stewart tool, the difference is clear. There is a third punch-down in the centre which crimps part of the plug onto the stripped wire, a feature that no other type of plug has. Because of this, you cannot use this tool to crimp most SS/WE plugs.

6-557315-3 plug showing the extra “middle” crimp – specific to this type of connector

As for the “white dot” tool and associated “high performance” plugs, they’re not exactly the same as SS/WE plugs and associated tools but I’ve found that they are more-or-less interchangeable – I certainly could not see and problems with mixing them.

Left: AMP “white dot” Die, Right: Stewart Die

Since we’ve got all of this here – let’s put a clearly non AMP plug into the “black dot” die and see what kind of mess we end up with…

Non AMP plug crimped in “black dot” die

Not a great result, and unlikely to work very well.

But wait! Some non-AMP plugs are actually sort-of compatible with the “black dot” tool

A non-AMP plug, which has space for the wire punch-down

I would’t be making a habit of this. As we can see the wire has been damaged by plastic being squashed by the middle punch-down. Not recommended!

The “high performance” feature

If you care enough to read on…

Left: AMP High Performance plug. Right: Standard “Stewart” style plug

On the left is an example of one, and on the right we’ve got the bog standard alternative. Please excuse the rubbish bit of wire I’ve used here.

In the case of the “high performance” plug the cable is butted right up against the terminals, meaning that there is only a minuscule amount un-twisted cable, whereas the plug on the right has quite a lot.

When we’re running long distances or at 10GbE this matters, but not in any other case.

In summary…

Some (line type) 8P8C AMP plugs crimp onto the cable at 3 points, whereas the rest crimp at 2 points.

I have only seen one other connector type which crimps at 3 points (also originally an AMP specific type – now CommScope) – a special variety of 6 position “long” modular plug which has the lengthwise dimensions of an 8 position plug.

853400-7 “violet dot” die from a 2-231652-7 tool with shielded and unshielded 6 position “long” plugs

These are normally used where a shielded 6 position type is required. Even without this requirement – if you are using 6 position plugs regularly these things are a heck of an improvement over the standard type. They fit standard 6 position sockets, crimp very easily onto round cable, and the longer dimensions and tab make them a lot easier to connect/disconnect.

OMG. It’s a UK (BS1363) Piggyback Plug

So what I hear you say.

If like me you’ve spent any amount of time searching for such a thing, you may have also noticed there is virtually bupkis in the way of such products to choose from.

I come from the land of piggy back plugs: New Zealand. I’ve very much missed their convenience since moving to the UK.

Okay, so they’re not as common in New Zealand as they used to be. Thanks to regulatory crackdowns and changes in consumption habits,  we can say in retrospect the 1990s was zenith of piggy back plugs (or tap-ons as we apparently call them).

Piggy back plugs galore. Without them you’d need three of these socket strips to plug all that in

While the days of popping down the supermarket to buy one are unlikely to return, at least you can still get them on pre-made appliance and extension cords, and re-wirable ones can be purchased from electrical wholesalers.

A selection of PDL “40” piggy back plugs from the 1980s and 1990s – including a couple of examples of the “40A” interrupted phase version

Changes to Australian electrical regulations have crimped Clipsal’s ability to manufacture these items but PDL still makes them (cat# 940).

There are 5 appliances in this cramped domestic data cabinet, but only 4 socket outlets. Two PDL 940 piggyback plugs to the rescue!

But anyway, back to the UK…

A very long time there was a company called Clix who manufactured the first BS1363 piggyback plug (more information here). As those are now collectors items, a modern replacement is desperately desired.

Clix 13A piggy back plug. Credit: Image was taken from forums (stevehertz)

Let’s take a look at the UK’s only purchasable piggy back plug. The seller describes it as a “Surged pass through”, somewhat diminishing the piggybackness of it. Let’s open it up and take look…

Fortunately there are a pair of screws on the underside which let us look at the guts of it. These don’t need to be undone to wire the plug.

We are first presented with a plastic spacer which surrounds the socket contacts, and we can see the surge protection gubbins waving at us down by the neutral pin. This spacer also holds the (pointless) neon light.

Quickly we can see my biggest concern with these plugs. That contact is only just barely on the fuse. I’ve purchased a number of these, and can say they vary from unit to unit. This one isn’t so great. If concerned I’ve found they can easily be bent back into a sensible position with pliers.

But regardless I’d pull that 13 amp fuse out and put either a 3 or 5 amp fuse in its place. I’d not be in the habit of using these plugs with 13 amps.

Lifting up the spacer we can see the socket contacts and surge gubbins clearly. Once again, quality is less than spectacular. I cannot comment on the efficacy of the surge protection. In my opinion surge protection is of little value, and in my case I have de-soldered all of these components, as well as the neon, because all I wanted was a plug.

The one last gripe I have is with two protruding corners on the cradle which catch your screwdriver when you are tightening the line and neutral screws. I’ve clipped them off with side cutters (circled).


Surge protection device? Even if the surge protection is effective, it’s not anything to get excited about. There are plenty of other better made surge protection devices to choose from.

Piggy back plug? Definitely. Why the hell the seller isn’t advertising it as this, is beyond me.

Apparently the idea of such a thing is so alien to the British that it has to have some useless surge protection jazz stuffed in it to make the sale?

As I’ve said the quality of the contacts isn’t amazing, but it is acceptable, as this is the UK’s only piggy back plug, you’ve not got another choice.

If you need something like this – buy a box of them now. Who knows how long these will be available for.

Remembering the PDL 40A Interrupted phase tap-on plug

The final version of the 40A (likely discontinued in the early 1990s) – distinctively coloured white and red

Recently while watching the YouTube channel of UK Electrician John Ward I came across a most interesting clip where an eager viewer from New Zealand has posted in a considerable collection of electrical bits and bobs. Myself originally being from New Zealand it was amusing to watch. Among the collection is a most interesting combination antenna & power socket, which certainly, I had not ever seen before.

One item our enthusiastic mailer of electrical articles has not included, but has made the host aware of, is the subject of this article: The long-discontinued PDL 40A – the de-facto symbol of Kiwi electrical innovation and nostalgia.

Wired with a 4 core piece of red-white-blue flex, an uncommon practice. In this case red is used for phase, and white for phase return

The key difference between these plugs and a regular tap-on is that the phase pin on the rear socket is not connected to the plug side, therefore, using a 4 core cable, the socket on the back can be switched via some kind of control device on the end of the lead.

The underside of a “red-white” 40A. The screw in the centre holds the phase pin to keep it isolated from the rear connector

Typical uses were:

  • Float switches for water pumps
  • Timer switches for lighting or heating devices
  • In engineering environments it is common to find them with a loop of wire attached to the phase pins for attaching inductive clamp meters
  • Anything else you can think of that has to switch a single appliance, without the desire to expend effort fitting a socket to that device
A 40A retrofitted with the back of newer “slim” 40 plug, this particular one wired with a loop for use with clamps meters

While they were designed for use with 4 core cable – ‘Kiwi ingenuity’ is actually another form of the phrase ‘Hook or by crook’ and not surprisingly I have not ever seen one wired like this (that wasn’t wired by myself). Typically 3-core cable is used, then the earth wire gets re-purposed as the phase return, and the switching device has to do without earth. In the case where an earth is connected to the switching device, it’s because the neutral has been done away with, or some other solution is devised that doesn’t involve purchasing a length of  4-core cable.

An early “all-black” 40A found in a typical use-case, a wall thermostat

I find myself wondering if the practice of using these plugs with 3 core cable may have contributed to PDL’s decision to discontinue it. Certainly in the case of earlier versions of the plug which aren’t easily identifiable as interrupted phase versions, subsequently wired with 3 core cable in some unknown likely dangerous arrangement i.e. earth connected to the phase pin – that cable could be mistakenly re-wired onto a metal chassis appliance likely leading to a fatal electric shock.

As expected – the earth wire becomes phase, and red becomes phase return. Our thermostat doesn’t happen to need an earth. A death sentence in the case where this cord is cut from the thermostat and re-used on another appliance by an unsuspecting individual
The top of an older “all-black” 40A
The black 40A. Correctly re-wired (for demonstration) with 4-core brown-black-grey flex

The Australians have got their own version of this – made, of course, by Clipsal.

Clipsal 461SUA – Still manufactured at the time of writing

For anyone wanting this kind of plug, at least these are still made, and certainly, by the time I started wiring stuff it was the only one purchasable. I can say from experience it’s just not the same as using a 40A. While not quite of the same quality – It could be argued that the Clipsal is better, because both the line and neutral are “interrupted”, for the almost inconceivable scenario where an RCD is doing the switching perhaps? Making full use of this does require a rather unwieldy length of 5-core flex, which by the time we get to 1.5mm is pretty big stuff, typical for full load 10 amp applications.

The fact that we’re using one of these plugs at all indicates that we’re not exactly flush for time or money; and in practice I doubt anyone has ever bothered with two pole switching, typically bridging the neutral inside the plug, instead stuffing a couple of lengths of figure eight Christmas tree wire into it, getting us the minimum requisite four conductors.

The innovation of the PDL 40A is frequently complimented by comparatively innovative ways of avoiding purchasing 4-core flex

In this day and age 40As are exceptionally difficult to come by. They were unheard of in domestic environments, and uncommon in industrial / commercial environments too. I got a taste of its rarity when entering an electrical wholesaler with one about 15 years ago, to ask where I could get another: “Whoa!” said the guy behind the counter – “Haven’t seen one of those for a while!” Apparently that day when a 40A was carried into their store was a special one.

The few that still exist are very precious and typically hoarded by obsessive people like myself, a very unusual item to be in possession of indeed considering that I now live in the UK. I can boast a very large collection of 1 (and a broken black one), which is about as many as I’ll ever have.

Will I ever find a use for it? Even if I moved back to New Zealand, probably not.

A circuit for generating 100 Hz or 1 KHz square wave signals

Recently while assisting with an Arduino project, I found myself needing a simple circuit which generates either a 1 KHz or or 100 Hz square wave. The reason for this was to connect to an interrupt pin to generate a timekeeping-level accurate 1ms or 10ms timestamp, which the Arduino its self cannot generate as its crystal is fixed at 16.000 MHz

This turns out to be a little more difficult than I expected. Because you can’t divide 100 down to 10 with flip-flops, whatever you end up building is going to do one frequency or the other, requiring a change in crystal to switch. So first of all, let’s look at which crystals can generate these frequencies:

1 KHz

A crystal that can divide down to 1 KHz must be a power of two, multiplied by 1000. Some examples (all of which are easy to come by) are:

  • 32.000 KHz (divide by 32)
  • 2.048 MHz (divide by 2048)
  • 4.096 MHz (divide by 4096)
  • 8.192 MHz (divide by 8192)

100 Hz

Likewise, a crystal that can divide down to 100 Hz must be a power of two multiplied by 100. These are not so common. Some examples I could find:

  • 25.600 KHz (divide by 256) – I could only find one example from a single manufacturer, which is stocked by some vendors but no longer in production
  • 1.6384 MHz (divide by 16384) – Once existed, but at the time of writing none appear to be in production or for sale
  • 6.5536 MHz (divide by 65536) – Several examples in production at the time of writing, reasonably obtainable

My requirements are:

  • Must be easy to change from 100 Hz to 1 KHz
  • No expensive or obscure components
  • Must be all SMT
  • Vcc = 5V

The next headache

Now I have to find an IC which can divide two of the above frequencies down to 100 Hz or 1 KHz. The trusty old CD4060 immediately jumps out. If we switch between 25.600 KHz and 32.000 KHz crystals, also changing the output stage – we’ve got a solution. Problem is, this solution falls foul of two my objectives – that one-and-only obscure 25.600 KHz crystal, which is not SMT.

With the only practical primary clock (for me) for 100 Hz operation being 6.5536 MHz, that rules pretty much all CD4xxx timers, which according to their datasheets, can’t operate with such high input clocks.

So far as I could see that leaves two options: 74xx292 (Rare in SMT) and HEF4541. If we are to select 8.192 MHz for the 1 KHz option, both can divide by 8192 and 65536, and handle those input clocks.

One more bump in the road

Because of the obscurity of 74xx292 in SMT, I’ve gone for HEF4541. The HEF4541 can in theory have a crystal connected directly to it, but after hours of profanities I discover that running at Vcc = 5V it can’t quite self oscillate at 6-8 MHz. We can prove this by shorting RS and RTC, and we see that it self-oscillates (with no other components) at about 5.9 MHz, which reveals the shortest propagation time between those two pins.

Great, so now we need another IC. Fortunately that only needs to be a 74HC2G04 which is tiny and inexpensive, barely increasing the footprint of this circuit.

The final solution

First, the 100 Hz version. Note that R3 can also be a wire link.

100hz square wave generator circuit
And now the 1 KHz version. R3 is moved, and the crystal frequency is changed.
1khz square wave generator circuit

Silencing a Cisco 2911 router for home use

I recently purchased a Cisco 2911 to replace my 1921 for use at home, as I needed an extra WIC slot. Now that they’ve been obsoleted by the ISR 4000 series, they’re starting to appear on eBay for relatively palatable sums. For me, the 2911 was a good choice because it has four WIC slots and fits in a 450mm deep rack, whereas the 2901 requires at least a 600mm deep rack, which is far too large for my home office. The 1941 was another possibility, but it’s not enough of an upgrade, and quite frankly, too damn ugly.

Without even having to bother plugging it in and switching it on, I know this thing is going to be too noisy for a home environment. The good news is that the standard array of leaf-blower strength fans are only needed when this product is used in extreme situations, i.e. loaded up with a four WIC cards, a 24-port Gigabit switch service module, with PoE, all ports at full power, and roasting in a street cabinet on a searing hot day in Egypt.

As this does not remotely resemble my use case, I can do away with most of the cooling. First stop – the fan module:

Top is the original, which I am going deaf just looking at, and below is my modified module.

I’ve removed all four of the original fans and fitted a single 70mm 4-wire fan (Delta AFB0712HHB). In order to prevent the system log from filling up with warnings about failed / missing fans, I’ve connected the tach signal from that one fan to the input for the 3 fans.

A quick run of ‘show env’ reveals that this has done the trick. The router being none the wiser to three of the fans being absent.

 Fan 1 OK, Low speed setting
 Fan 2 OK, Low speed setting
 Fan 3 OK, Low speed setting
 Fan 4 OK, Low speed setting

Just in case it isn’t obvious – the pinout for that connector (Molex 44133-1208) is as follows:

  • 1 TACH – 40mm
  • 2 TACH – 70mm (rear-most fan)
  • 3 GND + Orange presence strap
  • 4 TACH – 70mm (middle fan)
  • 5 TACH – 70mm (front-most fan)
  • 6 GND (middle and front-most fan)
  • 7 PWM – 40mm
  • 8 PWM – 70mm (rear-most fan)
  • 9 +12V
  • 10 PWM – 70mm (middle fan)
  • 11 PWM – 70mm (front-most fan)
  • 12 Orange presence strap

Fortunately I have the Molex Micro-Fit 3.0 contact extraction tool, and crimp tool handy making this easy, but failing that a new connector and contacts could easily be purchased from Mouser.

Eliminating the power supply as a heat source

In my setup, everything runs from a single battery backed regulated DC +12V source. This is no coincidence, as most I.T. equipment internally runs from +12V, meaning that in almost all cases my gear doesn’t require an internal power supply. This router is no exception, needing only a single +12V source (with 5V standby voltage), so I effectively don’t need the power supply here either.

Good news for this conversion, because that’s another source of heat done away with, in fact it means that I don’t need any cooling in the lower half of the router, so that inlet vent can be blanked up – focusing the cooling Mojo of my single 70mm fan solely on the top (mainboard) half of the router.

But it’s not quite that simple. On my previous router (a 1921) the +12V could be feed straight through to the mainboard with no extra components. On the 2911, we need a bit of extra stuff to satisfy it.

I whipped up a small emulator PCB which fits in place of the power supply’s original PCB, and has all the extra bits needed to satisfy the routers’ software / hardware – i.e. present its’ self as a PWR-2911-AC, leaving the router none-the-wiser to the fact that it is now powered by an impostor power supply. The downside is that there is nothing but empty wasted space in the lower half of the router.

PWR-2911-AC with all of its original internals removed, replaced with a small pass-through / emulator board (blue) to allow 12V operation

I’m not going to go into the details of this, but you can download its schematic here. While I was at it, I moved the power switch and inlet to the rear and blanked up the front. A little more convenient, because it means I don’t have to grope around in the back of my rack. For anyone else with the desire and patience to construct an emulator board like mine, a 60W power brick can easily replace the internal power supply.

A quick check shows that IOS is happy with my phony power supply, with the temperature sensor working, serial number and model number still reading as per the original AC supply this replaces.

Router#show inv
NAME: "C2911 AC Power Supply", DESCR: "C2911 AC Power Supply"
PID: PWR-2911-AC , VID: V05 , SN: DCA1647R2GF

Router#show env

 Power Supply Unit temperature: 28 Celsius, Normal

From the rear. Showing 12V input feed.

How it runs

The power consumption of an idle unloaded 2911 at the 12V stage is 1.8 Amps (about 23W) – show environment reports a lot higher (38W), I am assuming this takes into account inefficiency in the power supply.

If we are to assume that this is also the unit TDP – It’s practically bupkis given its large size. According to my scientific ‘finger on heatsink’ tests, all of my WIC cards run very cool. The mainboard ASIC also barely gets warm to the touch.

The only thing I need to keep an eye on is the CPU temperature. The CPU in my unit is a Cavium Octeon (MIPS64), which is fairly energy efficient, but still chucks out the loins share of the heat. It has an internal temperature sensor, which we can read out with the ‘show environment’ command.

 Intake Left(Bezel) temperature: 31 Celsius, Normal
 Intake Left temperature: 23 Celsius, Normal
 Exhaust Right(Bezel) temperature: 34 Celsius, Normal
 Exhaust Right temperature: 27 Celsius, Normal
 CPU temperature: 61 Celsius, Normal
 Power Supply Unit temperature: 28 Celsius, Normal

At 61 degrees, it is 2 degrees hotter than it was with the stock hurricane grade array of fans, where it sat at 59 degrees. Suffice to say that for my light use case, those fans are indeed completely unnecessary.

For anyone thinking of attempting this…

Having a single fan is ideal, because there is no risk of irritating ‘beat patterns’ (which often occur when fans rotating at similar speeds are near each other) – but you can only get away with a single fan if also doing away with the power supply, there’s nothing in the service module bay, and the inlet for the lower half of the router is blanked up. As is the case with mine.

As the PWR-2911-AC does need a little bit of airflow at 30-40 watts, I would suggest replacing with three thinner 70mm fans (like the one I have used) and doing away with / blanking up the 40mm fan, because you are not going to find a quiet one, then strap the tach signal for the 40mm fan to one of the 70mm fans to eliminate software errors.

MC34063: A tough lesson

As a keen electronics hobbyist, I have designed some 50 or so PCBs to date. In each instance where a switching regulator is required, I’m typically reaching for one of two options: Where efficiency isn’t important – the trusty old LM2596, or when efficiency is required, I’ll be using a design from Linear Technology with synchronous regulation.

On my last two boards however, for reasons I am myself not entirely sure of (cost perhaps?) I used an MC34063. It’s been with us since the dinosaurs roamed the earth, and is unsurprisingly very primitive. It should have been designated to the dustbin of history, but thanks to the internet and the renascence of electronics in the hobbyist space, it has made an aggressive comeback, and for a simple reason: It’s dirt cheap.

My MC34063 was deployed on the PCB with the above circuit, lifted unchanged from the datasheet. It just so happened that I need 5V at 500mA max, from a 24-28V source. Perfect. What could possibly go wrong?

There is one very important thing we must consider when using this chip: It has absolutely no built-in thermal protection. The above circuit does have over-current protection, but this does not offer any protection from sustained short circuits. In many cases that isn’t a problem, but on this board it was.

From looking at the photo, we can see that there’s quite a bit of burned out stuff, making it a little difficult to piece together exactly what happened. Fortunately it all unfolded before my very eyes. The problem started with something that was nothing to do with the MC34063. See those two rectangular capacitors?  One of them is particularly toasty indeed.

That capacitor is an AVX “TAJ” series 330uF 10V tantalum. It had developed an internal short circuit which caused the MC34063 to gradually heat up, eventually reaching a point where its internals melted, then becoming a short circuit its self.

Once the MC34063 became a short circuit, the 25V input voltage surged straight through to the 5V secondary, bear in mind that, that voltage is coming from a bank of large lead acid batteries.

Both pairs of batteries were protected with battery fuses, but those were 15A a piece, as this is a very high power setup, also on the PCB was a 30A maxi blade fuse. Surely one of those would have blown? Nope. When silicon melts to the point of becoming a short circuit, there is typically still a few ohms of resistance, which in this case was not enough to blow any fuses.

What happens next? BOOM! The short circuiting of the MC34063 unleashed 25V @ ~40A of potential at that shorted capacitor, which promptly exploded, ejecting a significant amount of fire and hot gasses in the process. In the picture you can clearly see the internals of it have become a melted blob of metal, transforming it into a very effective short circuit.

The last phase of destruction was the MC34063 its self burning to a cinder, as it is now the weakest part of the circuit, doing significant damage to the PCB in the process.

It’s at this point that you start recounting exactly what is attached to the 5V rail, because it is likely now toast. The tantalum capacitor must have briefly been open circuit because all 10 ICs fed from the 5V rail were completely destroyed, as well as all of the chips on a second PCB also fed from this regulator, requiring hours of rework to replace them all. Just as well there was nothing expensive connected to it.

Lessons learned

  • When using an MC34063, or anything else without built-in protection – short out its output for a few minutes and see what happens. If you find yourself staring at a mess like the above, sort it out. Don’t ever assume it won’t happen.
  • In cases like this where the system is fed from batteries, protected by large fuses – add a second smaller fuse i.e. 500mA before small circuits like this.
  • In my case I have ditched the MC34063 and replaced with with a Wurth 173010542 7805 switching drop in replacement. It gets me a 5V output with 90% efficiency, over-current and over-temperature protection. Not cheap, but when you are talking about stuff that could start a fire…

An easy way to mount DS18B20 temperature sensors


One of the biggest advantage of these sensors over I2C sensors, is that you can mount them almost anywhere. That having been said, I’ve never quite managed to come up with an elegant solution, particularly when attaching to a heatsink (for cooling applications).

Typically I find myself drilling 5mm holes in pieces of aluminum, then stuffing the sensor in that hole, or using small metal clips, which aren’t always reliable.

One solution I looked at using the aluminum heatsink clips from vintage TO-92 transistors i.e. 2N3403 and 2N4425. These are absolutely perfect but unfortunately the clips aren’t purchasable without the transistor. Sadly these parts are no longer in production and becoming increasingly rare. Destroying them to scavenge thier heatsink clips is a little senseless.

Some old TO-92 transistors came with rather nice heatsink clips

Without wanting risk the wrath of the world’s remaining Ham Radio enthusiasts… What other options are there?

I recently had the idea of using ‘Yellow’ (6mm) ring terminals with 3.2mm holes:

Perfect! All I had to do was remove the plastic band, cut the crimp and open it a little, add a little heatsink compound (to be pedantic), then gently crimp the sensor in place with pliers.

This has turned out to be a robust and inexpensive solution, as those terminals are made of copper, they conduct heat very effectively. I wish I had thought of this a decade ago.

Putting a little heatshrink over the final assembly makes for a good finishing touch.

A simple low battery detection circuit with hysteresis

I recently found myself needing a simple circuit which could detect a low battery condition of a sealed lead acid setup, but also with a hysteresis function i.e. don’t re-enable the output until the battery voltage rises to a certain threshold.

The internet is practically exploding with low voltage detection circuits but many are quite complicated with exotic ICs and other fussy details.

Geez man. All it takes is a single comparator and a two resistors (three for hysteresis).


Okay so my circuit has a little more, that is because making something that is actually useful requires a bit of extra stuff.

With the above component values it will cut out at 11.2V and re-activate at 12V, which is good for most sealed lead acid batteries. There is also second comparator – this is purely acting as a logic inverter, because I needed a negative logic output. If you don’t need it, leave it out. One of the cheapest and most available comparators – the LM393 has two units anyway, so this works out well.

The main guts of the circuit is R1, R2, R3 & U1A. R4 & R5 are a simple voltage divider to get the input voltage inside of the 5V operating range of the comparator. R6, R7 R8 & R9 should be left as is.

The math

Because I’m using fixed resistors, I’ve worked backwards, from a ‘components first’ approach, simply working out the formula for the circuit then plugging a variety of E24 resistor values in until I got what I wanted. I find this easier than working from a ‘results first’ approach i.e. starting with the desired voltages, to then being told by your workings you need a whole bunch of resistor values that don’t exist!

  • VCC (Constant – 5.0): The output of the 78L05
  • VL (Constant – 0.1): The voltage the LM393’s output transistor can pull down to. Yours may vary. The expression containing this term can be omitted if you are happy to call it zero.
  •  VIl: The low battery input threshold voltagevil
  • VIh: The high input threshold voltage i.e. re-enable output when voltage reaches this level


If you wanted to adjust my thresholds, assuming a 12V setup, focus on R1, R2 & R3. Leave R4/R5 as is. If changing to a different voltage / type of battery, then R4/R5 need to be adjusted to bring the voltage at pin 2 within a 2-3 volt range.

Making use of recycled Xilinx XC9500 CPLDs

If you happen to be producing boards which use Xilinx’s long discontinued classic 5V CPLDs which are purchased as scrap from the far east (which I hope you are not); You may have found that getting quality samples is not so straight forward.

The situation is not so bad for smaller devices, but for the larger ones, it’s tough. One of my projects (8OD) is stuck with the XC95216. Being a 100% 5V design with a swag of 5V bidirectional I/O pins, converting to a modern 3.3V device is completely out of the question.

Without the spare time or willingness to adapt the design to an inevitably ridiculously expensive alternative; I have been dependent on purchasing recycled chips from the far east (typically sold on eBay or AliExpress).

In terms of what arrives in the post, it’s a mixed bag. I’ve had perfect genuinely new batches, and other batches which are in poor physical condition (i.e. scratched, pins bent / missing).

To frustrate matters further, the best (absolutely perfect) batch I received then prompted me to make a second purchase from that same seller. But upon arrival of that parcel, I quickly see that it was sent from a different address, different packaging. Surprise surprise… Some were clearly scrap, and most of them were dead.

Here is a sample of the kinds of errors I find when I assemble boards when dead chips:

Completely sodding’ dead

When dealing with properly dead chips we sometimes see an error like this from iMPACT:

PROGRESS_START - Starting Operation.
INFO:iMPACT:583 - '1': The idcode read from the device does not match the idcode in the bsdl File.
INFO:iMPACT:1578 - '1': Device IDCODE : 00000000000000000000000000000000
INFO:iMPACT:1579 - '1': Expected IDCODE: 00101001010100010010000010010011

I have also seen iMPACT spit out messages like this when attempting to connect:

Less than healthy

I have seen quite a few that sort-of work, but fail on the identification stage, like this:

Identifying chain contents...INFO:iMPACT:1585 - '0':The part appears to be of type xc9500, but could not be identified correctly .
'0': : Manufacturer's ID = Xilinx unknown part, Version : 1
INFO:iMPACT:1111 - Can't locate bsdl file xc9500.bsd.

This is quite a curious error, as I have had chips, both from the same batch, identical markings etc where one identifies OK, but the other has a bit or two twiddled (i.e. version as shown here).

Avoiding wasting your time with dead chips

I have spent a lot of hours checking soldering, voltages, JTAG signals on my scope etc, all to no avail. I do not know what is involved in recycling these chips but whatever the process, a crapload of them don’t survive it.

Quite how so many end up dead leaves one to ponder, because from my own experiences, they are pretty robust. I have some XC95216’s that have been carelessly soldered/de-soldered 5 times or so by myself, zapped with large electrostatic discharges and even those survived! Perhaps these chips are typically removed from equipment with a propensity for suffering lightning strikes? Are they de-soldered with a flame thrower?

A quick google image search for “Guiyu” gives us a hint of what this business is like. My own guess it that they are killed with excessive temperatures during de-soldering.

Rule of thumb seems to be, if it can be successfully programmed with iMPACT, it’ll work. I have not yet found one that then went on to fail the burn-in test.

And on that note, I took the time to build a simple rig to weed out the duds:


It’s a blank PCB with power, decoupling and JTAG components fitted. I then use a small clamp to press the CPLD onto its footprint on the board, with a block of polypropylene and a layer of adhesive felt to ensure even pressure. To keep it extra high-tech – I’ve also got a pad of post-it notes underneath.

As much as this may not appear to be a reliable mechanism, it most certainly has proven to be. I happened to have preserved a tray of known-good / known-bad chips and when I tested them with this, the good chips – even those weren’t very well cleaned up (i.e. still some solder on them) verified perfectly in this rig.

Last but not least:

If you end up with a bunch of dead chips, use buyer protection to get your money back.

This is a lot easier on AliExpress than eBay

At the very least we may be able to entice recyclers to be a little more cautious.