Repair of Samsung LE40M86BD Television (power cycling)

Introduction

Recently I have had cause for complaint with our Samsung LE40M86BD LCD Television.  It had been working just fine, and then all of a sudden it developed a power-cycling problem.  The symptom is as follows:

  • From power-on, the TV works perfectly for around 10 minutes.
  • After a while the TV switches itself to standby, waits a few seconds, and then switches itself back on.
  • Once this starts happening the cycle repeats itself every 30 seconds.

I decided to take a look, and that’s what this blog post is about!

Troubleshooting

A Peak Inside

I took the back off, and it never ceases to amaze me how little there is inside modern TVs.  They are for more complicated than older TVs of course, but all the technology is packed into densely populated embedded systems.

Inside the Samsung TV

In this photo you can see the two main parts of the Television.  Near the centre is an off-white coloured circuit board; that’s the main Power Supply.  To the right of the Power Supply is a similarly sized green circuit board.  This board is the heart of the Television.  It’s basically a custom computer!

Straight away I noticed something suspicious on the Power Supply board; nasty looking electrolytic capacitors! Let’s check them out:

The Power Supply Board

Here’s a photo of the power supply, on the bench.  Now, any time you see electrolytic capacitors mounted right next to a heatsink as they are here, you simply have to be suspicious of them, especially in older equipment.  That big old heatsink pumps heat into those capacitors day in, day out.  And if there’s one thing electrolytic capacitors don’t respond very well to, it’s long term heating.

Two of these capacitors, highlighted in the image above, are showing the classic signs of dielectric degradation.  The top of the cans are bulging at the seams.
Sometimes this type of capacitor will also leak electrolyte, which can be very bad news indeed.  In this case, it’s just the classic bulging.

At this point I decided to replace all the capacitors in the local area, as sometimes an electrolytic capacitor can be bad without displaying any obvious physical signs and they all will have been subjected to the heat pumped out by the nearby components.

More Trouble

After this I was quite hopeful of a quick and easy repair.  But my hopes were dashed when I discovered that the TV was still power-cycling after a few minutes of use.

So, what to do? Well, I decided to be a bit more scientific about it from now on.  I got my ‘scope out and checked each of the power supply rails generated by the PSU board.  I discovered two things:

  • The Power Supply rails were now rock-solid.  They probably weren’t before I changed those nasty capacitors, but they definitely were now.
  • I could run the Power Supply into a load, away from the rest of the TV, and it never power-cycles.

So… the original fault was not on the Power Supply board then.

As a point of interest, I discovered an input control pin on the Power Supply called “ON/OFF”, which is driven from the main system.  I decided to take a capture of it and I discovered that my estimate of ~30 seconds power-cycling was almost spot on:

You can see here that the TV stays on for 28.7 seconds, then switches OFF, and immediately back ON.  The cycle repeats with exactly the same period over and over again.

So, this got me thinking.  The fault is surely on the main circuit board, as this appears to be deliberately instructing the Power Supply to turn OFF at regular intervals.  Let’s take a look!

The Embedded System

Embedded System Main Board

So, at first glance, there isn’t really much for me to get my teeth into here.  There was next to no information about this board on the internet.  I found a schematic, but it was more block-diagram level than anything else.

The photo above shows the board with the screening can removed, revealing the microprocessor underneath.  I took the screening can off because I noticed a bunch of SMD electrolytic capacitors and I wondered if they had been getting a little hot under the collar over the years.

An inspection of all the SMD electrolytic capacitors didn’t reveal anything suspicious; no bulging or evidence of leakage at all.
However… that isn’t particularly definitive.  Let’s see what happens if I try to measure the ESR (Equivalent Series Resistance) on some of these capacitors!

C1104 ESR

So, the ‘scope capture above shows the voltage drop across C1104 when stimulated with a 100kHz square wave at 1V peak-peak (50Ω output impedance).  C1104 is a 100uF capacitor, so the voltage drop at this frequency on a healthy capacitor should be close to zero.  What do we see instead? 286mV!

If you do the math, you’ll find that this comes out as approximately 5.5Ω ESR.  A horrendously bad capacitor!

At this point I went all around the board measuring ESR on the SMD capacitors.  I was able to measure the majority of them in-circuit, and I found a whole bunch of bad caps.  I replaced them all.

Success!

After this, the TV is finally working properly.  The fault has not re-appeared in over a week.

The total components replaced are as follows:

Power Supply Board

CM880 1000uF 25V
CM876 1000uF 25V
CM852 2200uF 10V (evidence of bulging, ESR 2.4Ω)
CM853 2200uF 10V
CB850 1000uF 10V (evidence of bulging, ESR 3.2Ω)

Embedded System Main Board

C1140 100uF 16V (ESR 5.5Ω)
C2267 100uF 16V (ESR 3.2Ω)
C1204 100uF 16V (ESR 5.5Ω)
C1131 100uF 16V (ESR 3.2Ω)
C1104 1uF 50V (ESR 21.5Ω) (!!!)

Another perfectly good piece of kit saved from the scrap heap.

Good luck!

Sorting out the Velleman MK170 Christmas Star

Last Christmas I bought a Velleman MK170 Christmas Star project for my Wife to build.  She often shows interest in my various electronics projects and I thought it would be a good way for her to build something that she could show off to friends and family, whilst at the same time teaching her a thing or two about electronics, components, and soldering.

First Try

After the build was completed we connected it to a 9V D.C. supply, as instructed by the documentation, and…

Star Before Mods

I was quite disappointed! The project was definitely functional, but the display was extremely dim and underwhelming.  At first I was convinced we’d done something wrong during the assembly, but nope; everything was as it should be!

The camera flatters the result.  To the naked eye the brightness of the LEDs is completely unsatisfactory.

I decided to revisit the project for this year.  I downloaded the schematic from the Velleman website, and took a look to see what was going on.

 

 

MK170 Schematic

Looking at the schematic (click the image for a larger version) you can see that we basically have three sets of LEDs, each of which is split into sub-groups of series and parallel LEDs.

Now, one thing that jumps out straight away is the value of the series resistors; they’re HUGE!

Take, for example, the series chain consisting of LED1, LED2, LED3, LED4.  I measured one of these individual LEDs and they don’t even begin to conduct until ~1.7V.  So to work out the current through these resistors we have:

(9V – (1.7V * 4)) / 2200R = 1mA!

I looked up the datasheet for the LEDs and I found that the typical forward current should be around 10mA.  Practical tests showed that these LEDs conduct 10mA at around 2V forward voltage.

So, to work out more appropriate resistor values:

Four Series LEDs

For the chains with four series LEDs, the forward voltage drop will be 2 * 4 = 8V.

This means the drop across the current limiting resistor will be 9 – 8 = 1V.  In order for 10mA to flow, we’ll need a 100R resistor.

100R!! The 2k2 resistors that Velleman fitted are not even in the ball-park!

Two Series LEDs

The same process can be used to determine the appropriate value for the chains with two series LEDs.  The drop across the resistor ends up being 5V, so you need around 500R for the current limiting resistance.

Conclusions

Star After Mods

I really don’t know what Velleman were thinking with this project.  Their choice of current limiting resistor values are way off.  I can only imagine that their intension was to reduce the current down to the absolute minimum, so that the project could be powered by a standard PP3 battery for relatively long periods of time.

That’s all very well, but the result is a project with totally unsatisfactory LED brightness.

I changed all the resistor values on ours, and now we are able to show off the project along with all our other Christmas decorations.

The current consumption on my unit, after my modifications, is 120mA when all LEDs are lit. Not all the LEDs are lit all of the time, but I guess it would be reasonable to assume >90mA average current consumption.

A standard 9V PP3 battery is going to be wasted very quickly at this current consumption.  I would estimate 1-2 hours use before the battery drains flat!

That’s probably why Velleman used such high resistor values.  But my take on this is that it was a poor design decision to build the project around a PP3 battery in the first place.  These batteries have very low capacity, so they were on to a loser from the beginning.

We are powering ours from a 9V DC adaptor, which is the only realistic way forwards for a project like this.

Simple circuit for controlling LED brightness

Photo of LED dimmer pack

Recently I was asked to produce a circuit to create a variable ‘dim’ control for an existing LED based exhibition.

I decided to go with a simple 555-timer based design which provides control of the pulse width of an output, whilst keeping the oscillation frequency fixed.

The circuit is shown below.  It’s an unusual design, because the output is taken from pin 7.  This ‘output’ is not capable of driving current (at least not without affecting the circuit behaviour) so you have to be careful with the connections you make to it.

Image of Circuit
555 PWM Circuit

The circuit works because of some very simple rules:

  1. When pin 7 is high, the output pin (3) is low.
  2. When pin 7 is low, the output pin (3) is high.
  3. Pin 7 will be high when the trigger/threshold pin is > 2/3 of VCC.
  4. Pin 7 will be low when the trigger/threshold pin is < 1/3 of VCC.

When the circuit is first powered on, pin 7 is low because C2 is discharged.  This causes pin 3 to go high, and C2 begins to charge via D1.  When C2 reaches about 2/3 of VCC pin 7 goes high, causing pin 3 to go low.  Now C2 discharges through D2 until its voltage falls below 1/3 of VCC and then the cycle repeats as an oscillation.

The resistance in the charge and discharge cycles is controlled by RV1.  When the resistance is increased for the D1 side of RV1 the resistance falls by the same amount on the D2 side of RV1.  This changes the relative ‘speed’ of the charge/discharge cycle, which has the practical effect of pulse width adjustment.
Since the total resistance of RV1 (for the total charge/discharge cycle) is constant, the frequency of the output is stable and is determined by the values for RV1 and C2.

The frequency of the output is governed by a simple formula:

FREQUENCY = 1.44 * RV1 * C2

The power switch is a PMOS FET.  It controls the switching of a 12V feed onto the existing LED array at the exhibition.  RV1 is adjusted to provide the desired brightness for the display, and LED D3 provides an indication of the level of ‘dimming’ that the circuit is currently providing.
The circuit oscillates at 100Hz, so there is no perceived flicker.

Happy circuit building!

Happy Valentines Day Project

Happy Valentines Day!

A few years ago I created a little valentines day project, shown in the video at the end of this post.  It’s basically just a multi-vibrator circuit with two groups of LEDs, arranged as an inner and outer heart:

LED Design V0.5_black_s

The full schematic is shown here, click on it for a full enlarged display:

Valentine_Schematic

Finally, if you want to download all the project information, you can get it here.  This project is considered to be in the public domain.

I’ve thought about doing a new version actually, with micro-control of the LEDs for brightness fade in/out etc.

Maybe next year!

Panasonic AE700 Projector Diagnosis & Repair

Panasonic AE700

In the tinkering cave this week we have a Panasonic AE700 HD Projector. These units are pretty old now, but they come highly recommended in many online reviews and the HDMI support means they remain a useful home cinema option.

The unit was first presented to me by a work colleague who complained that the unit would not illuminate. It powers on just fine, but returns to standby after about 30 seconds without displaying any picture. My colleague had already completed some diagnosis of his own and had determined, correctly as it would turn out, that the power supply is not generating a 15V rail – which is required for the lamp circuitry to work.

Dismantling

IMG_20150208_133305With the cover removed, it can be seen that this unit is a bit of a beast! It’s packed with a mixture of high-tech electronics, complicated optics, and extensive cooling components.  Dismantling is slightly tricky; you have to remove the top sensor board first (the one with the buttons on it) and then you need to very carefully remove the dark grey cowling.  The power supply sits underneath; which is why the cowling must be removed for further diagnosis to take place.  There is a wiring loom which connects the PSU to the main board, and this will need to be disconnected temporarily (at the main board end) because it feeds through an opening in the cowling.  You can connect it back after the cowling has been removed.
IMG_20150208_133535With the cowling removed,  you can now take a look at the PSU.  “Let the dog see the rabbit”, as they say.

The first rule of electronics diagnosis is “Thou shall inspect!” In this case there were no signs of explosion, trauma, or electronic stress of any kind to be found on the board.  So it’s time to get the schematic out.  Fortunately, the service manual for this unit was ‘freely’ available on the interweb.  You can download my local copy of the service manual here.  You might see a warning about “untrusted connection” – that’s because I can’t justify the expense of an SSL certificate.  But I assure you there are no harmful files in my repository!

PSU
PSU Schematic

The schematic for the power supply is a little bit limited; it shows some discrete components but other circuitry is presented in block diagram form.  Still, there’s enough information to start a line of diagnosis.  The circuit I am interested in is shown to the left; click on it to open up a larger copy.

The second rule of electronics diagnosis is: “Thou shall measure voltages!” The circuit diagram shows P3 as the main connector – this is the wiring loom that had to be disconnected to remove the cowling.  With the wiring loom connected back in, I measured the following voltages on P3:

[table id=1 /]

Nothing to be too concerned about there.  Here’s the voltage measurements for P2:

[table id=2 /]

As can be seen – no 15V! Looking at the circuit, we have an output from the photoisolator which drives transistor Q107.  The transistor is switching a voltage (which I measured to be 18V) to IC102 which is a 15V regulator.

One thing that I found really suspicious about this, is that we have a tiny transistor (only a small signal device, as it turned out) driving a much larger linear regulator.  Going by the circuit we are looking at, the small transistor has to pass the same current as the linear regulator.  I don’t know what current the linear regulator is supposed to drive, but it definitely has a much larger current carrying capability that the transistor which supplies it!!! It stinks of poor design choices to me.  And Q107 has now become prime suspect for this failure.

And, sure enough, a quick measure of transistor Q107 revealed that it had indeed succumbed to its (inevitable?) destruction.  18V in, 0V out.

Q107 mod
Q107 mod

To remedy this, I replaced the component with one I had in my junk bin.  The choice of transistor is not too critical here; it’s just switching a voltage.  So I chose a ‘beefier’ device, which will happily support the current carrying requirements of the linear regulator – hopefully for the rest of this projector’s life.

 

 

 

A brief triumph – and a gift!

The projector worked after this, and I handed it back to its owner.  Unfortunately it was returned to me a few weeks later with the same complaint.  I was told that I could have the projector to play with, and keep if I could get it working! 🙂

I re-visited the power supply expecting a repeat problem, but everything checked out.  Since the 15V supplies a H.T. power supply circuit for the lamp, and the symptom was that the lamp doesn’t illuminate, I began to wonder if the H.T. power supply needed some attention.  Unfortunately this supply is cocooned inside metal shielding which does not seem to want to come apart very easily.  As I was poking around with my screwdriver, I noticed that the projector had suddenly begun to illuminate, but she only fired up for a few seconds before there was an arcing sound and the projector switched back off.  At the time I had been poking around a flat-cable signal loom which comes from the H.T. power supply and connects to the main board.  I noticed that this loom was routed inside the H.T. leads for the lamp! This is almost certainly where the arcing had occurred!

Nailed it!

IMG_20150208_165054I re-routed the small signal loom so that it gives the H.T. leads a wide-berth, and tucked it into the scart PCB.  I imagine that the cable had become disturbed through repeated dismantling of the unit and had found itself tangled in with the H.T. leads somehow.  You know cables, right? They tangle themselves up when you’re not looking!

After this I switched on the projector and voila! We have illumination.  I took this opportunity to play Karate Kid: Classic.

Repaired
Projector Working!

Result! One working projector, saved from the scrap-heap.

Good luck!

JVC TH-S5 Diagnosis and Repair

Symptoms

I’ve owned the JVC TH-S5 home theatre system for many years.  It could be as much as 8 or 9 years.  In all that time it’s been a reliable machine, although to be fair it’s also had quite an easy life; I don’t watch much TV (what self-respecting Engineer and tinkerer has time for that?) and even when I do I rarely give the system a run for its money.

About 6 months ago the system developed a problem.  When started from cold the base unit (i.e. the DVD player and system controller) would fail to power on.  I also noticed that if I listened very carefully I could hear a [tick-tick-tick-tick] sound coming from the unit.  I recognised this straight away – it’s the switch mode PSU trying (and failing) to start.  I was about to take the unit away to my tinkering cave for some diagnosis but I further noticed that the [tick-tick-tick] sound would gather pace, getting faster and faster, until eventually it was possible to bring the unit into life after a power-cycle.
The unit would work perfectly from that point onwards, provided that it was left connected to the mains.

Of course, I always knew this was a temporary solution.  This problem was not going to go away.  It was going to deteriorate for sure, and eventually I would be faced with a completely dead system.  And sure enough, 6 months down the line, that’s what I’m faced with now!

An Inspection

First thing’s first, I needed to get the cover off for an inspection.  With an old system like this I already had some preconceptions about what I thought I’d find.  Bad electrolytic capacitors were absolute top of my list for this kind of symptom.  Dry joints were a close second.

IMG_20141011_103310-3600x2700
JVC-THS5 base unit with cover off

As can be seen here, the power supply is self-contained on the right hand side of the unit.  This is where the focus of the attention should be.  An initial inspection yielded a disappointing result.  With bad electrolytics at the height of my suspicion, I was hoping to spot one or two displaying the classic physical symptoms of bulging or weeping.  This would be a sure-sign of trouble, and usually an easy fix.  The capacitors all looked physically healthy, though.  Time to whip the board out of there for a closer look.

PSU Board removed
The PSU board removed

Looking more closely at the PSU board itself, there were no obvious (physical) causes for concern.  I didn’t spot any dry joints on the underneath of the board either.  The focus of this investigation should be the primary side of the PSU because the symptom is that the PSU completely fails to start.  The primary side is marked clearly on the board and consists of everything to the left of the yellow-banded transformer.  The transformer bridges the electrical gap between primary and secondary sides of the PSU.  It’s an electrical gap because there is actually no direct electrical connection between primary and secondary sides.  The two sides are said to be electrically ‘isolated’.  This is important because we have dangerous high voltage mains A.C. on one side of the transformer, and then low voltage rectified D.C. on the other side of the transformer.  Never the twain shall meet!!!

Anyway, back to the fault diagnosis.  Since I am concentrating for now on the primary side of the PSU, and I have electrolytic capacitors as #1 on my suspicion list, it makes sense to have a look for some.  There’s only two of these on the primary side of the board; there’s the big fat one, which is a reservoir capacitor (and certainly not the cause of my trouble) and then there’s a small skinny one next to the chopper transistor heatsink.  The chopper transistor drives the transformer.  It switches high voltage, high frequency A.C. and dissipates significant power.  If you look at the surrounding board, it’s darkened brown from the heat that is generated by these components.  This is where all the electrical stress is to be found on this circuit.

Our suspect capacitor
Our suspect capacitor

Since the skinny electrolytic capacitor is mounted close to the chopper transistor heatsink, it will have been subject to the heat that has been pumped out of the high energy part of the circuitry over the last 8 years or so.  Electrolytic capacitors do not respond well to heat.  Often they bulge and weep, effectively holding their hands up to say “I’m faulty!!!”.  Other times they violently explode.  And other times still, they just die quietly without any fuss or obvious signs of defect.  They’re a bit like vampires in this regard; many different dying behaviours.
So the fact that it’s not showing signs of death doesn’t rule it out of my suspicion.  I’m going to whip that little guy out of there and subject it to some electrical tests which will reveal once and or all whether it’s healthy or not.

Capacitor ESR Test

One thing you can measure on an electrolytic capacitor, which generally gives a good indication of its health, is its ‘ESR’.  This stands for “equivalent series resistance”.  An ideal capacitor would have properties of capacitance only, with no ESR and no inductance.  But it’s impossible to manufacture the ideal capacitor.  In practice all capacitors have some small amount of ESR and inductance.  Electrolytic capacitors have relatively high ESR compared to some other types of capacitor, but when it is healthy the ESR is still pretty low.  When it is unhealthy, however, the ESR increases significantly.  And then we end up with a very poorly performing capacitor indeed, and that’s when they begin to prevent SMPS power supplies from starting.
The test I am going to perform here is going to tell me approximately what this capacitor’s ESR measurement is.  I don’t actually own an ESR instrument, so I’m going to have to measure it in another way, using SCIENCE. 🙂

Here’s the circuit which shows how I will complete the measurement.  Click on it for a larger version.

ESR-Measurement-600x308

 

 

So what I’ve got here is as follows:

A signal generator which I will use to apply a measurement stimuli to the capacitor under test.  I will be applying a 100KHz square wave @1V amplitude.  At 100KHz most electrolytic capacitors appear as close to a short circuit, provided that their ESR is low.  This particular device has a capacitance of 39μF.  If you do the math, the impedance that it should prevent to a 100KHz signal is:

Impedance Calculation
Impedance Calculation

The 100Khz signal is injected via a known output impedance of 50Ω.  This is the output impedance of the signal generator.  I then measure the resulting signal that appears across the capacitor under test with an oscilloscope.  The 50Ω signal generator and electrolytic capacitor effectively form a ‘potential divider’.  The capacitor becomes ‘R2’ in the equation:

Potential Divider Formula
Potential Divider Formula
Potential Divider Circuit
Potential Divider Circuit

where Vout is the voltage measured across the capacitor with the oscillpscope, Vs is the supply voltage (1V in this case), R2 is the capacitor’s impedance, and R1 is the signal generator output impedance.
If the capacitor’s ESR is low, then at 100KHz it will only present 0.04Ω resistance.  If you plug that into the formula above, you’ll see that we should only expect a miniscule voltage at 100KHz.
If, however, the capacitor’s ESR is high, then the resistance it presents will be far far greater than 0.04Ω and in that case we would see a fraction of the 1V square wave voltage being developed across it.  From this measurement we can solve the equation for R2, effectively providing us with a measurement of the capacitor’s ESR.

First let me do some measurements without the bad capacitor fitted, so that I can show you what to expect to see in a good scenario

Measurment with no capacitor fitted.

With no capacitor fitted at all, the resistance of the capacitor (R2 in the potential divider equation) is effectively infinite, so the voltage dropped across it will be the open-circuit voltage.  Basically the off-load output of the signal generator.  We should therefore expect to see the full 1V, 100KHz output as shown below:

Off load signal generator output
Off load signal generator output

Measurement with brand new (good) electrolytic capacitor fitted:

Here’s what happens when you insert a good electrolytic capacitor into the circuit.  It presents close to 0Ω resistance at 100KHz, so the fraction of voltage that appears at the oscilloscope is also close to zero:

Output with good capacitor fitted:
Output with good capacitor fitted:

If you look closely here you can just about see a square wave appearing on the flat-line.  If I zoomed into this I could calculate the capacitor’s ESR, which would be small.  But it does have some ESR.
There are also some rather large spikes.  This is because the step change from 0V to 1V is relatively high speed, and this signal is reflecting back down my cabling as a result.  Suffice to say I don’t need to concern myself with the spikes – they are interesting, but they are not related at all to this measurement.

Measurement with capacitor removed from system

Measurement with 'bad' capacitor
Measurement with ‘bad’ capacitor

Here is what happens if I put the capacitor I removed from the system in the circuit.  You can see that a very large square wave is being developed across it! Almost 500mV, in fact.  I could do the math here, but I really don’t need to.  If you see a square wave of this sort of amplitude being developed at 100KHz, then it’s clear that the capacitor has excessive ESR and is no longer performing very well.  As a quick mental approximation, we’re seeing a fraction of the 1V square wave being developed which is almost equal to 0.5.  So this means that the impedance of the capacitor must be close to 50Ω, since a potential divider with the same value resistance for R1 and R2 would give us an output of 0.5Vs (or 500mV in this case).

Replace the capacitor!

With this in mind it’s definitely time to replace the capacitor.  I didn’t have any 39μF capacitors in my home stash, but I had a 47μF so I decided to try that.  It did in fact work fine, and my system is now up and running again.

Conclusion

If you suffer a power supply problem with an aged piece of electronics, electrolytic capacitors are a good place to start.  They can fail on the primary or the secondary side, but will show different fault symptoms in the product depending on their function in the circuit.  Sometimes it is plainly obvious which ones are faulty; they’ve either exploded or they’re bulging at the top or leaking fluid.  Other times, as I’ve just shown here, they look okay physically but are hiding a nasty decline in capacitance performance internally.  In that case you can use this method to gauge whether they require replacement or not.  You can actually do this test in circuit, but it’s not recommended.  It’s always better to remove them first if possible.

Enjoy!

Resolving duplicate part name problems in KiCAD

The Problem

In KiCAD, a problem occurs when you try to create a new schematic symbol for a custom library and you happen to give it the same name as another part that exists in a different library.

IC-Example
An Example of a custom IC

For example, let’s say you decide to create a part called “MAX3232”, and there happens to be another part in a different library already called “MAX3232”.  This can happen for a number of reasons; you may not have noticed that this part already existed in the standard library set, or you may have seen it but decided that you’d rather make your own.  This happens to me quite often – for example, I have a bit of a personal standard for the way I like ICs to look on my schematic.  I like my ICs to have a thicker border than on normal components, and I like them to be filled in yellow.  Additionally, I often have preferences about the pin layouts.  It is unlikely that an existing part in a different library will satisfy all of my personal preferences, so usually I’ll cook my own.

When you first set up the custom part, KiCAD will create your part for you and add it to your custom library using the name you chose at the beginning.  If this name is the same as an existing part in another library, KiCAD doesn’t complain – it adds it to your custom library as requested and initially there is no obvious conflict.
The trouble starts when you come to add the component to your schematic.  You select the “Place a component” button, choose your custom library, and select the part you just created.  KiCAD highlights the part and shows a preview of it, which matches the custom symbol that you intend to place.  So all looks well.  However, when you actually try to place the part you’ve selected something unexpected can occur.  It places the part without complaint, but sometimes it will place the existing part from the standard library instead of the custom part you intended!

Pulling Hair OutClearly there is a conflict here that KiCAD hasn’t warned us about.  When you actually try to place the part, you’d think that KiCAD would dive straight into the appropriate library and pick out the part you actually selected.  But this is not what happens.  Instead, KiCAD searches through its entire set of libraries and picks the first part whose name matches the one you selected.  If your custom library is scanned first, it picks the part you intended.  If the other library is scanned first, it picks the existing part that you didn’t want!

Workarounds

I haven’t managed to find a completely satisfactory solution to this problem.  But it is possible to get close to a satisfactory solution using one of two optional workarounds that I will describe here.

#1 The nomenclature workaround

The first workaround, and the easiest (though neither are difficult), is to simply be careful when you’re choosing names for your custom parts.  For example, I could decide to append all of my custom parts with “_BJH” for the rest of eternity.  Then, when I want to create a custom MAX3232, I would create it with the name “MAX3232_BJH” instead.  It’s unlikely that another part in some different library is going to match this name, so I can feel pretty confident that no conflict will ever occur and the custom part I intend to use will be placed on my schematic every time.
An alternative that I’ve seen suggested on other websites is to append your library name to each of your parts.  So if your custom library was called “Devices_BJH”, then you’d call your part “MAX3232_DevicesBJH”.

A problem with the nomenclature workaround

This works fine, but when you place your part it ends up being titled “MAX3232_BJH”.  There are two problems with this.  One is that it’s just plain messy; who in their right mind would want all their component names appended with workaround text? The second problem is that somebody else, reading your schematic, may be fooled into thinking that the appended text has some other importance – for example, they might think the “BJH” is a specific variant of the part which they need to pay attention to.  So clearly we will want to do something about this.

Fortunately it’s quite easy to solve this problem, with one exception which I will talk about in a minute.  If the part you’ve created is a regular schematic part (resistor, IC, diode, custom component, etc) then you can select the component on your schematic, select “edit”, (or hover over the component and press e on your keyboard) and then you will be presented with the following dialogue box:

KiCAD-Edit-Window

 

As you can see, all you have to do in order to change the way the title looks for your custom component is change the Value.  This allows you to call your part “MAX3232” while KiCAD still refers to it by the conflict-free name that you chose earlier.  The annoying thing with this workaround is that you have to repeat this process for each part you add to your schematic, and you leave yourself open to the possibility of accidentally naming multiples of the same part differently.  For example you might end up with two MAX3232 parts on your circuit, one with a Value of “MAX3232” and the other with a value of “max3232”.  A trivial issue, yes, but one that would annoy the heck out of me!

 An exception

PSU-Rail-Symbol-standard
A standard KiCAD PSU Rail symbol

There is at least one exception to this workaround which I have discovered.  The other day I decided that I wanted to create my own power symbols.  KiCAD already has a suite of power symbols to choose from, but I find that the supply rail symbols (the ones which are a pin with a circle on top like that shown to the left) are too small for my liking.  Power supply rails are quite important connections, and I think they should be displayed more prominently.  I also have issues with the legacy “VCC, VDD, VSS” power rail nomenclature, which is a rant for another day.

Having created my new power rails, and taken care to append them all with “_BJH”, I thought I would be able to use the edit dialogue box in the same way as for my other components to change the Value field so it was displayed, for example, as “+3V” instead of “+3V_BJH”.  Unfortunately, if you try this for yourself, you will discover that the Value field is greyed out for power pins.  You can’t change it! To solve this problem we must move on to workaround #2, which is now my preferred method which I am going to use for all my custom symbols from now on (or until the KiCAD team fix the naming conflict problem).

#2 The Custom Field Workaround

Since we can’t change the Value field on power pins, we need some other way of changing how KiCAD displays the name of our custom parts.  Thankfully, we can do it quite easily using custom fields.  You have two options here.  The first option is to apply a custom field manually to each custom part after placing it on your schematic.  The second option is to generate the custom field when you’re actually creating or editing the custom symbol in the library editor.  The second option makes the most sense by far, because this way you can set up exactly how you want your symbol’s title to be displayed, position it just-so, and then it will be automatically repeated in exactly the same way for every single part you lay down with no need to go about maintaining it retrospectively.  The second option also shields you from the horror of accidentally naming your parts in slightly different ways (capitals here, dashes there, etc).  For these reasons I am only going to talk about the second option, but the principle is exactly the same anyway so you can pick your poison for yourself.

Generating custom fields in the library editor

Assuming you know how to edit components in the library editor (if you don’t then I guess your problem starts at how to create symbols, not how to tweak their names), launch the library editor and open up your custom component.
Along the top toolbar you will find a T-shaped button FieldPropertiesButton for editing custom fields.  Select this button and then you will be presented with the fields dialogue box shown below.

Now, at the moment KiCAD is using the Value field – which on power pins you can’t edit – to display a title for your component on the schematic.  So the first thing you want to do is select this field and change its visibility setting so that the “show” checkbox is no longer checked.  This will stop it displaying on your schematics.

The next thing you want to do is create your custom field.  Select the “Add Field” button, and then set the Field Value to something sensible that denotes your component in some pedantic way of your choosing.  Set the text size, its style, and set the position.  Once you’re happy, make certain that you set its visibility checkbox to “show” so that it’ll display on your schematic.  Then you can exit the dialogue box.

Custom Field Properties
Custom Field Properties

Done!

That’s it! You’re done.  Save your component back to the library, and update it.  You’ll probably also need to close the schematic editor and open it back up again.  From now on, you can place your custom component without any nasty surprises and it will display with a sensible name of your choosing.

Have a FAB old time with your PCBs! <groan>

Hardware Hacking the IOMEGA StorCenter ix2-200

Introduction

The StorCenter ix2-200 is a RAID network drive supplied by iomega.  I have used the 2TB version for about two years now to keep secure (backed up) copies of my precious data.  Any data I write to the device is mirrored on its paired 2TB drive inside the unit, so one drive can fail and I’ll still keep my data.

Recently I’ve had cause for complaint with this unit’s default network setup routine.  When you switch the device on it goes through a boot-routine which involves setting up the network address and subnet.  If possible it does this via dhcp so if you’ve got it connected to your router it’ll be assigned an appropriate IP and will be instantly visible on the network.
The problems start when, for whatever reason, the device is not able to obtain network settings via dhcp.  In that case it assigns itself an address in the range 169.254.x.x with subnet 255.255.0.0.  In that case the network drive could end up with one of 65536 possible IP addresses in that range.  How is one supposed to know what IP address it’s assigned itself?

Hardware Hacking

Location of JP1 on ix2-200
Location of JP1 on ix2-200

I had two choices.  Set my computer to scan all of the 65536 possible IP addresses until it finds an active one.  Or, take the unit apart and see what hardware hacking can be done.  The former is probably quicker, but the latter is more fun.  Hence, this hardware hacking blog was born.

With the unit apart, I found a conspicuous looking pin header called JP1.  A few pokes around with my ‘scope revealed what looked like microprocessor level (3.3V) RS232 comms on one of the pins.

 

Completing the hack…

RS232 data on pin (2)
RS232 data on pin (2)

The next task was to try and see if I could view these signals on a PC.  The main problem here is the fact that the data output is 3.3V logic levels (basically it’s the raw output from a microprocessor) and the RS232 input to a PC is +/-12V standard RS232 logic levels.  It’s easily solved though, you just need to get yourself an RS232 level-shifter chip such as a MAX3232 and rig-up a circuit as per my schematic shown below, and then connect it to JP1 (as shown on the schematic) according to the pinout in the photo.

Schematic

JP1_2

 

 

 

 

I only had an SMT version of the MAX3232 part in my junk bin so I soldered it onto some proto-board with the 0.1uF capacitors tacked on top and then I wired it up to JP1 as shown in the photo below.

My hacked on level shifter IC to interface with the PC
My hacked on level shifter IC to interface with the PC

Viewing the data on the PC.

In order to view the data on a PC you simply need to put everything back together, connect the ends of your cables to a DB9 connector as shown in the schematic, and then connect the DB9 connector to your PC’s serial port via a standard 9-way serial cable.  Then fire up a terminal (I recommend PuTTY) and enter the following settings:

PuTTYConfig
PuTTY Terminal Settings

 

 

 

 

 

 

 

 

 

 

 

Once you’ve entered in the settings, select connect, and power on the NAS.  If all goes well some boot-time debug data should start spitting out on the terminal.  Something like that shown below:

Debug data coming through over the terminal
Debug data coming through over the terminal

After 2-3 minutes you should be presented with a login prompt.  If you want to gain root access to the NAS over your PC terminal simply log in with the following credentials:

USER: root
PASS: soho

Gaining root access via the terminal
Gaining root access via the terminal

Sweet!

That’s it – you’re in with root privileges. You can now enter the standard Linux commands and change whatever you wish.  My main reason for going to all this trouble (apart from enjoying hardware hacking) was to find out the boot-time network settings it was assigning itself.  Once I knew those I was able to gain access via the standard PC based web interface and change the settings to suit my home network.

I hope you enjoyed! Here is a quick video of the entire boot process and logging in:

Agilent U1253B Input Impedance Problem

 Gotcha!

I’ve experienced a problem recently whilst measuring high voltages with a 1000:1 high voltage probe and an Agilent (U1253B)/Fluke (28II) multimeter.  The problem is that the two meters don’t agree with each other!
The Fluke (my meter of choice) returns voltage readings within expectation all the way up to 12kV (12V as displayed on the instrument).  But the Agilent meter only seems to agree with the Fluke up to about 3kV, after which it starts to drop off.  By the time we get to 12kV the Agilent is reporting a voltage that is more than 1000V less than expectation.  I tried another Agilent U1253B and experienced the same drop off. What is going on here?

Know your input impedance

So I started to think about input impedance.  The high voltage probe is designed to work with a 10MΩ impedance.  Both these high-spec handhelds will be 10MΩ, right? That’s standard for handhelds these days.  Is this a fair assumption?
It turns out, no it isn’t!!!

Firstly, RTFM.  Both the Agilent and Fluke claim 10MΩ input impedance for the D.C. voltage range in their manuals.  However, the Agilent has a fancy dual display mode whereby you can measure two different properties (say, A.C. and D.C. voltage) simultaneously.  In this mode each display presents as a 10MΩ impedance so you end up with an effective impedance of 5MΩ in total.

…but I wasn’t using the dual display mode, so I should expect 10MΩ, right? Well, that’s what the manual says.  But let’s measure it!

Measure the Agilent’s Single Display Input Impedance Using the Fluke

Firstly we connect the Fluke up to the Agilent and take a resistance measurement of its inputs.  We should expect to see 10MΩ, and sure enough we do:

Measuring the Agilent’s single display input impedance using the Fluke.

 

 

Measure the Agilent’s Dual Display Input Impedance Using the Fluke

Next we set the Agilent to dual display mode and take the measurement again.  We should see 5MΩ, right? Yes! So far so good…

Measuring the Agilent’s dual display input impedance using the Fluke.

 

 

 

So far we seem to be doing well.  The Agilent’s input impedance is as expected.

But there’s a problem…

There’s more than one way to measure the Agilent’s input impedance.  We can use an insulation tester.  The difference is that the Fluke is applying a constant current and then using the measured voltage drop to calculate resistance, where as an insulation tester does it the other way around – it applies a constant voltage and, I presume, uses a measured current to calculate the resistance.  It’s six of one and half a dozen of the other – both types of measurement should agree with each other.  But do they? Let’s find out:

Measure the Agilent’s Input Impedance Using the Insulation Tester

Here we connect the Agilent up to the Insulation Tester.  I tried it at various test voltages and they all agreed with each other, but there’s a surprise in store – the insulation tester reports 5MΩ input impedance for the Agilent’s voltage measurement range.  And this measurement is reported regardless of whether the single or dual display mode is used!

Measuring the Agilent’s Single Display Input Impedance Using the Insulation Tester

 

 

 

What is going on here? Why is the insulation tester reporting 5MΩ input impedance for the Agilent’s single display mode? And could this explain my measurement problems with the high voltage probe? I think it could! But in that case, what can we say about the Fluke’s input impedance? Let’s measure it, first with the Agilent and then with the insulation tester:

Measure the Fluke’s Voltage Range Input Impedance Using the Agilent

Okay so we connect the Fluke up to the Agilent and measure its input impedance using the Agilent’s resistance range.  We get 10MΩ as expected:

Measure the Fluke’s voltage range input impedance using the Agilent.

 

 

Measure the Fluke’s Voltage Range Input Impedance Using the Insulation Tester

Now we measure the Fluke’s input impedance using the insulation tester.  We should get 10MΩ:

Indeed we do get 10MΩ.  So, to summarise:

  • The Agilent’s single display input impedance measures 10MΩ using the Fluke’s resistance measurement, but the insulation tester says it’s only 5MΩ – and this is regardless of the display mode – both the single and dual modes look like 5MΩ to the insulation tester.
  • The Fluke, on the other hand, looks like a 10MΩ impedance to both the Agilent multimeter and the insulation tester.  This is what you would expect.
  • I tried the measurements again with another Agilent U1253B and I experienced the same thing.  I also experienced the same voltage measurement problems when using the high voltage probe.  This rules out a faulty instrument.

So what is going on?

This is a very good question! Why does the Agilent look like a 5MΩ impedance to the insulation tester? Why is it not 10MΩ as stated in the manual? And why is there a discrepancy between the insulation tester measurement and the multimeter measurement? This discrepancy isn’t seen when we measure the Fluke.

This input impedance problem provides an explanation for the voltage measurement errors I’ve experienced.  The high voltage probe I’m using is designed to work with a 10MΩ multimeter, so a lower impedance instrument is going to present a problem.  This is what I’ve experienced in practice.  The Fluke, on the other hand, works with the high voltage probe no problems at all.

Misleading Impedance Specifications

Here’s a copy of the input impedance specifications from the Agilent U1253B user manual:

As you can see, they are quoting 10MΩ for each VDC measurement range, from 5V to 1000V.  However, there’s a problem with this! Refer to note 3 in the fine print below the table.  That’s right – the input impedance actually varies with input voltage! So, even though they quote 10MΩ input impedance, it’s actually only 10MΩ for input voltages between -2V and +3V! Outside of that it’s only 5MΩ.

To put that in perspective, -2V to +3V is less than 0.3% of the instrument’s total range.  So for 99.7% of its range, the impedance is only 5MΩ.  Despite this, they somehow think it’s informative to quote the input impedance as being 10MΩ.  That’s a bit bizarre.

Anyway, this fact explains why the insulation tester and the multimeter disagreed over the input impedance.  The multimeter’s constant current stimuli yields a voltage that is <1.5V so it comes in on the 10MΩ impedance zone.  The insulation tester’s minimum voltage stimuli of +50V is well into the 5MΩ impedance zone.
Also, the fact that the instrument has 5MΩ impedance above +3V explains why it starts disagreeing with my Fluke after about 3kV.  The high voltage probe is designed to work with a 10MΩ impedance so as soon as the Agilent’s impedance changes over to 5MΩ, erronous measurements are returned.

The Moral of the Story Is:

Never assume your instrument’s input impedance! It’s not necessarily 10MΩ! And, in the case of Agilent, even if the manual quotes 10MΩ make sure you read the fine print because the might have been misleading you!

The “Repair Man” Trap

Anyone who has ever worked in the electronics trade will almost certainly have been asked to repair consumer electronics products for friends, family and even random neighbours.  How do you deal with these requests? Do you politely decline or do you end up getting sucked in?
Rookies usually get sucked in.  I’ve been there, done that, and got the T-Shirt.  But give yourself a few years and you’ll soon learn that it can be a huge “trap for young players” (as EEVBLOG is fond of saying), and that once you’ve fallen into the trap it can be very difficult to get out!

I’m older and wiser now, so usually I’ll politely decline a request for this sort of work.  Occasionally I’ll agree to do the odd thing for close friends and family, but even then I only tend to agree if I feel confident that the symptom is indicative of a quick/easy and permanent solution.  If there’s any kind of uncertainty involved, or if it’s someone I don’t know, forget it – I’ll avoid it like the plague.  Why? Well, let’s have a look at it!

My main reasons for declining this sort of work are as follows:

  • Once you agree to repair something for someone, suddenly everyone in the neighbourhood will want you to provide a similar service for them too – and once you’ve agreed to do it for one person, it becomes difficult to say no to anyone else! How can you justify saying no to Mr. Jones at number 4 when you previously said yes to Mr. Edmunds at number 3? You’re almost obligated to become the local repair guy, and from then onward your spare time will be constantly eroded by other people’s problems.
    At least you can make a few bob for yourself on the side though, right? No! That neatly leads me on to my next gripe…
    .
  • Nobody ever wants to pay you money for the work.  They think your technical expertise in this area is worthless, and in one way (as explained further on in this point) they are right!
    It doesn’t matter that you may have spent 4 hours tracking down a problem, and that the only reason you can do it at all is because you spent years (decades) honing your electronics skills – they’ll still want it done for free.  Or, at least, for a very small amount of money.
    In fairness, this kind of attitude has mainly been fostered by cheap consumer electronics products from countries like China.  Your diagnosis/repair work might be worth £80 an hour in terms of your expertise, but why are they going to pay that when they can just get a brand new one from the local supermarket for <£100? Cheap goods from developing countries have literally decimated the monetary value of a Technician’s work.  Products have become more complex and hence more difficult to diagnose, but the amount that consumers are willing to pay for their repair has fallen to a pittance.
    Naturally Mr. Jones won’t want to add £100 to his next TESCO shopping bill though – he’ll just want you to fix the one he’s got for free.
    .
  • Once you’ve placed your hands on someone’s product, you instantly inherit any future problems it may present.  If Mr. Jones bought you a pint of beer in return for restoring power to his television last month, then he’ll bring it back to you when the colour goes down on it and assume that the two problems are linked.  “The colour was fine before you started fiddling with it”, he’ll say.  “It must have been something you did!”.
    Naturally, he’ll not only expect you to fix his colour problem as well but he’ll also expect you to do it for free.
    Sometimes you’ll even be blamed for totally unrelated things like, for example, poor reception.  You fix their dead television for a measly tenner (even though it’s not even worth 15 minutes of your time, and the job took you three hours!) but then they’ll call you back 3 months later because the picture on ITV4 is breaking up.  “It didn’t do that before you took the TV apart, Mr. Hoskins!” and before you know it you’ll be up on their roof fixing an antenna or adjusting their satellite dish.
    .
  • Sometimes, if you don’t have your wits about you, amateur diagnosis work (and if it’s done in your spare time as an aside to a related but different professional trade, it is amateur – even if your skills are not) can even end up costing you money.  Faults (especially in the digital domain) can be very difficult to diagnose, and are littered with “gotchas” that you can inadvertently stumble into.   Fault symptoms will often lead you around the garden path.
    It can seem, for example, like a Microprocessor is to blame for your problem when in fact the firmware is simply hanging up because some other component is upsetting it.  But if you go ahead and order a replacement Microprocessor you’d better be damned sure it’s going to solve the problem, because Mr. Jones isn’t going to want to pay for it if it later transpires that the Micro wasn’t the root cause after all!
    If you work in the diagnosis trade (which, these days, hardly anyone does) problems like these are easily navigated – you can swap components on like products to see if the problem moves with them, and then you can be more confident of your diagnosis before you spend any money (even though at the very least it’ll certainly cost you more unpaid time), but if, for example, you’re a design Engineer who (by the very nature of your work) happens to also possess some skills from the fault diagnosis trade, you won’t have this luxury.  When Mr. Jones presents his faulty product to you it’ll almost certainly be the first time you’ve ever seen one.  If you’re lucky (provided Mr. Jones never brings it back) it’ll be the last time you ever see one! So the moral of this particular point is that if you order parts for someone’s faulty product, make sure you’ve made your disclaimer clear before you do so otherwise the cost could be coming out of your pocket, not theirs!
    .
  • The final reason I prefer to decline this sort of work is that it just isn’t my specialty.  Yes, I probably could track down the fault on someone’s TV, or laptop, or PVR.  Given enough time and sufficient motivation I could probably fix any electronic product.  But unless you actually work in the trade, diagnosing these things day-in day-out, it’s always going to cost you more time and money than it’s actually worth.  For a start you’ll hardly ever have schematics for the products, and that means you’ll have to reverse engineer them before you even start diagnosing the problem.  You won’t have spare parts hanging around so you won’t be able to follow hunches by swapping bits out,  and finally you’ll never have the opportunity to reap the rewards of a hard-earned diagnosis.  What do I mean by this last point? Well, no Technician wants to see a one-time fault.  Obscure one-time faults do happen occasionally, but usually (if you work in the trade) it’ll be something you or one of your colleagues have seen before.  So you invest the time in a diagnosis once, and then you apply it instantly to any future occurrence of the problem. In that way, you start to make money on your investment.  If a product costs you six hours of diagnosis time, most of which will end up being unbilled time, then you hope that it’ll pay you back when you see the problem again in the future.
    When you do these things as a side job, you typically only ever see the problem once, even if it’s a relatively common problem for that particular product.  So each time you complete a diagnosis you invest significant time, but never see its return.   Even if people were still willing to pay good money for diagnosis work (which they’re not), it would hardly be worth it for someone who just does odd bits on the side.
No I will not fix your computer!
No I will not fix your computer!

So that’s why I will almost certainly decline any request to fix someone’s consumer electronics product for them.
What about you? Are you a design/development engineer who has been asked to fix other people’s stuff? Do you agree to it or do you decline? What stories can you tell?!