Projects/TransistArduino

This is a small project log that I decided would be a good start for the wiki.

For this project I purchased a ready made circuit that can identify and measure various electronic components, soldered some pins and used Arduino as ISP (In-System Programming) to update the firmware.

A bit of history

A few years back I replaced the screen in an industrial computer that had gone blank when the cooling fan failed. The original screen had a 19" resistive touch panel and controller that were still in good condition but I wanted to get it working again as a challenge. The screen consisted of an LCD TFT panel with LVDS socket, an FPGA buffer board, the controller board, a power supply board, the CCFL back light driver and some push buttons on another PCB. Thinking it was a fault in the controller board I purchased a similar one that didn't work so I got the exact same board only to realise that there's a chip in it that contains a different firmware so it didn't work as expected (or it works as long as I swap the chip between boards) but that proved that the LCD was fine. However, I also realised by chance that the original board was working fine too at that point. I must be missing something...

After watching Dave Jones (EEVBlog) checking some capacitors that had gone bad in a few videos (like this one) I read a bit more about the ESR (equivalent series resistor) in electrolytic capacitors and how to measure it. The chances of a faulty capacitor were pretty high and since I had two boards to play with I could swap them over and get it working reliably.

What's the ESR?

An ideal capacitor doesn't allow current to flow through it but in reality that's not the case and depending on various parameters there's a small resistive component in the total impedance (or capacitance). This is usually represented as a. In the case of electrolytic capacitors, my understanding is tat it's most likely due to the free electrons in the electrolyte and the reaction that takes place in the electrodes when the voltage is applied (more info in this video from James Lewis at Kemet Capacitors). When the electrolyte dries out or there's a perforation in the electrodes this ESR increases and that usually has adverse consequences in the rest of the circuit.

Measuring the ESR

In my case, I wanted to find out if that was the case so I started by following a few tutorials for using the oscilloscope and a function generator to measure the ESR. Basically, if a high frequency (200kHz) and low voltage (< 1Vp-p, peak to peak) square wave is applied to a capacitor with a resistor in series, the capacitor won't have enough time to charge before it's discharged so the capacitive part can be ignored, leaving the resulting signal as a linear function of the voltage applied. Using Ohm's law and knowing what the external resistor value is we can calculate what the ESR must be. Unfortunately, my oscilloscope has a minimum range of 2mV and at that frequency I couldn't get repeatable readings even though I managed to identify two faulty capacitors using this method.

TransistorTester project

I realised that this was very tedious and I was probably going to find myself using it in the future both as a hobby and most likely at work. A quick search on Google came back with some results and one of them was a review on Hackaday http://hackaday.com/2015/04/24/review-transistor-tester/ regarding some cheap Chinese electronic components tester that I had also seen on Dave Jones' desk at some point. With a bit of research I realised that these boards are clones of a project called TransistorTester https://www.mikrocontroller.net/articles/AVR-Transistortester which in turn was also based on someone else's work.

Hardware selection

I went for the LCR-T4 board from China with the blue button (seemed like the yellow button model was a bit older and I could see in the pictures that this one had the same ATmega328P microcontroller as in the Arduino Nano. I didn't order a box but instead I would source my own.

First test and concerns

After I had the chance to inspect it I found some common issues with the Hackaday post like the screen flapping in the breeze, scratched and looking like a second hand or repurposed item even though the rest of the board was looking pretty good and had good quality soldering. Something was missing and that was the programming port. At that point I noticed some six through holes that looked a lot like the ISP header in the Arduino boards. A couple of years ago I managed to upgrade the bootloader in my Arduino Mega using an Arduino Nano as the programmer and then I did it the other way around through this header so perhaps I could do the same with this. A continuity test between these proved that the pins in the microcontroller were in fact connect to these holes so I soldered the missing pins in place and double checked against the TransistorTester manual and the ATmega328 datasheet to be sure that the board was compatible with the original project. Turns out that the pins were upside down but no big deal, at least I didn't have to remove the screen.

Why would I want to mess around with reprogramming the board if it was working fine? Well, if you are familiar with microcontrollers and PCBs you'll know that they don't like electrostatic charges and they tend to "forget" their program with time. Unlike FPGAs, these devices have a high probability of losing their program and are only specified to hold it for some ten years. This timeframe is not exact and it changes drastically with use. My first concern was to backup the memory so that I could put it back in case something went wrong and the second concern was not knowing what version of the firmware was actually being used. The project is still alive with contributions at the time of writing of less than two weeks old so chances are that the new code has a lot of improvements that I'll find useful.

Upgrading the bootloaders

First things first, before trying to upgrade the firmware on this unit I should refresh my memory on the procedures for using the Arduino boards as programmers. In order to do that I searched for a few schematics and examples of circuits until I came out with a solution that worked:

Arduino as ISP

In order to burn the bootloader on an Arduino using another Arduino we need to connect them together and upload to one of them (the programmer) the Arduino sketch called ArduinoISP. Since I had two Arduino Nano this is the procedure I followed:

Arduino Nano sending bootloader to Arduino Nano

PS: I found the faulty capacitors to be effectively faulty and after replacing them the 19" screen is working like a charm :)