Category Archives: Electronics

Electronics

New Smart Home: at least, gas&electric meters are talking to the world wide web

With the recent move to my new home, some curiosity about the consumption of energy, gas and electricity, first and foremost. The heating system is completely new, so there were no historic data about the annual consumption, and with winter time currently, I thought it could be interesting to collect some data and analyze.

The meters are not the best starting point, the electric meter says, manufactured in Western Berlin, e.g., during the period of separation in Germany, pre 1989… The gas meter is a but more recent but the well known old design.

At least, the gas meter has some provisions for digital read-out, probably, a magnetic system, with relatively coarse resolution, and a mirror “6” which aids itself to optical pick-up with 10 Liter resolution.

Here you can see the mirror… the “o” of the “6”.

To pick up the reflection, I used some IR transmitter-receiver pairs, you may take similar from an used computer mouse, I purchased some sets as surplus parts years back.

Now, the next challenge is to get the readings of the meters from the basement and 2nd floor, to the ground floor office that has the web server – to collect the data in one place and to analyze.
This is achieved by NRL24L10 transmitters in the 2.4 GHz band. These transmit to a common receiver that is connected to the web server (running Apache/Ubuntu) via a wired 9.6 kbaud RS232 link.

The transmitters and receiver are controlled by Atmel m328p, from some ready-to-use Chinese controller boards similar to Arduino nano, but the software and use is all avr-gcc, nothing to do with Arduino.

There is no need to deal with the NRL24L10 chip itself, because there are ready-made small boards available cheaply, less than 1 EUR per piece…

For the gas meter mechanical part, a small piece of plastic scrap and a Nylon screw is all that was needed to get a stable signal.

Sure it needs to be positioned well, but it is not a particularly sensitive or critical adjustment.

First, I just transmitted the strength of the reflected light to the server (receiver), and did all the calculation in the receiver, but this has various issues if the transmission of the signal is interrupted for some reasons, like RF interference or some other outage at the receiver end.

So I decided to change to counting the “6” pulses at the transmitter end, and the transmitter will send data every few seconds (including the time stamp of last counter change, and a time stamp synchronization data package every 10s of seconds).

Now it is counting very reliably, and can recover from receiver outages no problem.

The data received are interpolated to 6-minute intervals, i.e. 240 intervals per day.

With the electric meter, the mechanical part is a bit more difficult, as there is no place to attach a screw or anything, so I decided to use a piece of plastic, precision made to fit the front cover recess, and a metal wire (spring bracket) to hold it in place.

At the right positions, openings have been milled so that the wheel can be “seen” by the IR detector (the wheel has a red mark, and 75 rounds per kWh consumed).

It needed some fine adjustment and tuning of the pick up threshold, and an algorithm to avoid false counting by introducing a dead-time after each pick-up event, because with the wheel turning fast, e.g., when 10 kW are drawn, there have been extra counts. This has now all been eliminated by proper adjustment, more margin of the IR detector.

Some examples, with high power consumption in the workshop, i.e., 5 and 10 kW machinery and heaters in operation.

Additionally, the same system is used to record the living room floor temperature, in a corner, which is a pretty good representation of the heating system’s effect on the house. At nighttime, the heating is essentially stopped (13.5 degC as minimum temperature, which requires no heating unless it is a very cold night). The sensor is a DS18B20, which can be directly connected to the microcontroller with no further converters and delivers good accuracy.

It is seen that the regulation has some on/off characteristics, but the temperature stability seem stable enough for the purpose.

If you want to do similar things or need the code, etc, just drop me a line.

ADF41020 PLL: mysterious failures, and a not so mysterious fix

For years I have been building PLL microwave frequency stabilizers using the marvelous Analog Devices ADF41020 circuit, however, while in all permanent installation there were never any issues, occasionally the inputs failed in my attenuator calibrator setup – essentially a set of two microwave receivers, a microwave source, and a ultra-precision directional coupler (Narda 5082) and a HP transfer switch.

A EIP counter is used to monitor the rough overall power level of the incident radiation, as well as to check the correctness of the frequency and providing the 10 MHz reference to the PLL system. Each PLL has a ADF41020 board as the key input element.

One day, I noticed some ground loop currents, and again, one of the boards failed. So I decided to dig into it and solve it once and for all. Strangely, the board of the generator had never failed.
Looking at the datasheet, there are input diodes that may be easily destroyed by DC current flowing into the ADF41020 RF input.

It can’t tolerate voltages below ground or above 3 V much, so it is quite clear that some ground loops or other potential shifts can destroy it.

Further investigation showed that the RF sample output of the Micro-Tel SG 811 generator actually is AC-coupled (there must be some decoupling within the directional coupler that is getting the signal out, or in the switch leading to the sample output – which is quite possible because there are PIN diode switches inside that normally need DC blocking caps to work). The Micro-Tel 1295 receiver however have the center pin of the RF sample output connected to ground via a 50 Ohms resistor at the other side of the directional coupler taking some power off the line. So it is at least clear that the DC current from the center pin caused the ADF41020 to fail. Easily solved, added some 2.2 pF microwave caps. These are tiny parts, 0402 size, and remarkably cheap for their performance.

Soldering needs a steady hand, and definitely you don’t want to put a lost of stress on the board, which is mounted by the SMA connector only. Probably it could be made more rigid with epoxy, but I rather like to treat such PLL equipment and microwave gear with great care, because these are solid structures, but don’t handle impact and bending well.

After put all back together, so far no failures at all.

Siemens Electric Master Clock: after some years, a little repair

My trusty Siemens master clock, after some years of service without any trouble, it needed repair. The electromagnet coil that charges the weight, it is triggered by contacts that got dirty over time. So I cleaned all well with contact cleaner and some ultrafine abrasive paper.

With these little repairs complete, the clock showed another issue. It just stopped after some random time, and that is no good for a Master Clock. Generally speaking, pendulum clocks that stop oscillation randomly are difficult to fix. It may be dirt in some gears or bearings, it may be incorrect adjustment of the escape wheel, it may be some local disturbance.
Fortunately, the full clockworks can be removed without touching the Invar pendulum.

There are connectors at the top, well large in size, and with some silk spun wire.

Upon closer inspection, one of the main gears, which also drives the minute hand, showed issues. It is not fixed in position, but moved in and out. How can it be? When it gets out too far, there won’t be any reliable force transmitted to the pendulum, so it will eventually stop.

There is a washer, brass, on the back side of the movement, and this is supposed to hold the axle in a fixed position, while allowing it to spin freely.

Somehow, this washer had worn out. So I just rotated it.

Giving the clockworks a good clean and oil (only special clock oil made for medium-heavy clocks supposed to be used!), but without a full disassembly.

Now it is ticking away again, and showing the time, day and night.

Force compensating precision balance: a few very interesting, very rare schematics

With the recent repair of a Mettler AE analytical balance, I never thought that the schematics would be available and obtainable anywhere. Maybe even the Mettler corporation only has some dusty copies in their Swiss secret archive. But, as luck would have it, a very kind reader provided some of the schematics to facilitate repair and understanding of the working principle.

At the time of the balance, like, 40 years back, it was still a challenge (maybe it is still challenging today), to build a mechanical system and ADC converters that are stable in resolution and drift to 1:10E7 counts and similar.

The basic working principle of force compensation and precision balances has long been known from the relevant patents, Sartorius, Mettler, Shimazu and similar. There is position sensor that can very precisely detect the position of the balance, to better than a micron. Then, there is a force coil, a magnetic system similar to a loudspeaker to compensate the force. Various levels and hinges may be involved. Then, there is a current regulation, a current reference, and a ADC to deal with the conversion to digital information. There are also normally temperature sensors to compensate temperature drift. Normally, the balance is continuously measuring the reference current and the coil current, and for best results, always leave it plugged in. Inside, there is some quite heavy aluminum case not only as an electrical shield but to avoid temperature imbalance. Accordingly, even when “switched off” by the front panel switch, these balances are actually internally on, doing their thing.

Key part is the position sensor. It works by a differential pair of photodiodes, and the total photocurrent is kept constant by active regulation (the left opamp), both diodes work vs. ground in essentially short-circuit current mode. Note that at the red point, the currents of both diodes add up (as total flux reaching the diodes) and need to cancel out the current from the 680 k resistor to 15 V rail. One diode, of course, has a resistor in the feedback loop of the right opamp (transimpedance amplifier) that will drive current through the 680 k resistor in its feedback loop to cancel out any differential current of the two diodes (to keep the negative terminal at virtual ground). More precisely, both diodes are keep at constant bias (short circuit) even if the photo current various or is unbalanced. Such setup has very linear response over several tens of micrometers. Rather than the BPX48 diode, you can use better Hamamatsu parts. Normally a small slit is used to illuminate the diodes, say, 30 um. You don’t want to make it too small, otherwise, there will a lot of light needed with associated heat and drift, and you don’t want to make the slit to wide otherwise sensitivity will be less. Certainly good to use a high efficiency light source like the SFH401-2 (15 degree emission angle, IR emitter).

The ADC, it works by an integrator, a reference current source (based on a LM399 high precision reference in some balances!), and a few current switches.

The magnetic coil current is simply regulated by a control loop that has some lead-lag elements similar to a PID regulator (otherwise such loop won’t be stable because of the nature of the electromagnet and phase angle).

Such system is integrated in a custom ASIC. Probably the best solution at the time.

Fake DAC8512, AD8512, Mixup, or both?

The semiconductor industry is quite a bit plagued with counterfit parts, and there are all kinds of variations – plain fakes, parts that work similarly, parts that are actually true and real silicon dies but packaged by someone else, relabeled parts…

Troubled with these parts – clearly marked as DAC8512…

So I took a file and some patience to cut open the thing, until the bare die came to light.

Not easy to read on the picture – but my eyes are still good enough, clearly, there is the Analog Devices logo, and a marking, 17012, AD8512A.

Is this real? Did someone package AD8512 dies (probably sitting around in a box for some time, rejects or aged stock) and then put a DAC8512 label on then?

Found this picture on the web, of a genuine AD8512, decapped by a professional company – clearly, the same die.

No wonder I couldn’t get it to work as a DAC…. It is an opamp.

GHZCTRL6: a new GHz-PLL control board, and a few learnings when prototyping with cheap (fake!) parts

Recently, we have to work with many PLL designs, mostly the frontends, based on ADF41020, ADF5002, ADF4157 and similar circuits, including their programming. So I decided to design a little board that can flexibly interface to all these circuits, and provide enough power.

(1) Power supply to allow 10 V full scale output, 5V supply, 3.3V (or 3V) design. Noise should be low and flat without any discontinuities or peaks.
(2) A pretune circuit with 12 bit monotonous tunable voltage, scaleable to 0..10 Volts to control the main coil current drive of YTOs.
(3) A PLL loop amp to adjust the working range of the PLL FM tune (PLL circuit may provide 0-5 V, but need to have a driver to translate to, say 0-10 V). Used an ADA4048-2 low noise rail-to-rail opamp. These are reliable, and can tolerate somewhat capacitive loads like long cables.
(4) An isolated RS232 (TTL level) interface that can work at any reasonable baud rate (7.3278 MHz will do the trick as MCU clock).
(5) Easily in-circuit programmable, we use a common ATMEGA8L-8 MCU.
(6) Some status LEDs. Say, 3 LEDs.

After not too long, came up with this design and had it manufactured as boards at 40 eurocents a piece(!).

The schematics, they are a bit rough, but if you need more detail, let me know. All fairly standard. The regulators are good old LM317T, with 10 uF bypass caps. This gives reasonably low noise, and we can operate this without special cooling over a wide range of input voltages (15-20 VDC). Current consumption incl. LCD is about 40 mA.

The LCD, any common LCD board will do. I use a 1602A 2×16 character.

After some fiddling around, it is working temporarily. Programmed the ATMEGA8 just fine.

The LCD, it took some in-circuit repairs because after a short time of operation the contrast faded away. Note that this is a 3.3 V LCD that has an ICL7660 to convert +3.3 V to -3 V. But not with this module, just getting about -0.2 V. After replacing the ICL7660, it turned out to be a shorted capacitor (tested 10 Ohm!).

With things working pretty well, soldered in the SMD DAC, a DAC8512 (DAC7761 also works with same pinout and performance). But rather than the expensive parts for production sourced from major distributors, resorted to some low price parts purchased in sets of 10 pcs, and at hand here in my temporary Japanese workshop. Did do much D to A conversion, but rather shorting the inputs to almost ground and consuming lots of power. Not good. Some forensics showed that these are certainly not DAC8512, but something else (with diodes and circuits inside) marked as such. Strangely, from the same reel/cut tape, there are Philippines and China made parts, all a bit scratched and strangely smelling like fake. The laser marking are all the same.

Markings on the Philippines parts:

Markings on the China parts:

I have some genuine parts back in Germany but no picture handy currently. Well, I ordered some more DACs to get this to work, but won’t be an issue, the amplifier is working just fine.

Motorola 2N5160 PNP RF Transistors: new-old-stock, medium old stock, fake stock?

Some of the 1980s, 1990s pulse and signal generators use push-pull power amp stages to provide output levels of +-10 V into 50 Ohms, and similar. These are often discrete circuits, utilizing PNP-NPN small power transistors. While the NPN types are still widely available, there used to be some shortages of 2N5160 PNP transistors. Recently, there are are many offers for “Motorola” branded parts, with datecodes from about 1998 (K98xx) to about 2004 (K04xx). In contrast to the earlier Motorola parts (Rxxxx date codes), these have shiny cases. It is quite unlikely that Motorola actually manufactured RF metal can transistors in 2004… (1999 onwards, Motorola no longer made transistors, but transferred the business to ON Semiconductors).

Strangely, the cans have “KOREAN” stamped into them, in various styles and sizes. Would a fake producer have stock of many different kinds of fake cans? Or did ON Semi produce these parts with some existing stock from the 1990s? Many semiconductor producers actually have decade old wafers in stock that they package whenever there is a need.

Let’s have a closer study. Unfortunately, no electron microscope here. But we do our best. Here the die of the defective HP branded original Motorola part. Red arrow shows the burn mark, defect area.

I sacrificed one of the 0.7 USD suspicious parts with K0439 datecode. To my great surprise, they are exactly identical in die, bonding method, and die attachment method.

A quick function test – put the new K0439 date code 2N5190 into an 5 MHz power amplifier. And working just great at >20 dB gain and about 1 Watt output.

Further, we study the collector-base capacitance, at -28 Volts bias U_CB (note that some datasheets specify “28 Volts U_CB” but this won’t work with a PNP transistor – it is conducting like a diode in C-B, if the collector is positive vs. base).

A test with the trusty HP 4192A, and 2.5 pF measures. Exactly the typical value. Also checked one of the certainly genuine Rxxxx date code transistors, and this measured at about 2.7 pF.

Test done at 1 MHz, and calibrated the 4192A with open and short.

So far, so good. All I can say is that these transistors are good 2N5160, whoever made them.

A low frequency xtal oscillator: Austrian generosity, gold, and crystals

A while ago, an Austrian fellow contacted me for some collectibles, long-range telephone line filters (from carrier multiplex phone lines). Many decades ago, phone lines were used at some 50-100 kHz frequencies, to transmit several (!) calls per wire pair. This required good filter, quartz filters were commonly used.

These are 4-electrode filters that are held only by 4 wires soldered to it. Probably oscillating in some flexing mode.

The electrodes are normally connected diagonally, and with a few resistors and an amplifier, I got the part to oscillate nicely. Be aware that you can’t feed a lot of power to these crystals, so it needs a rather high impedance oscillator circuit.

Resonance is at about 50 kHz.

Also connected the specimen to a HP 3562A analyzer, in swept frequency mode, and good nice response plots. There is another dip at 100 kHz!

The schematic, pretty simple, using a 74HCU04 unbuffered inverter, it is a very handy circuit, and years ago I got several tubes of these… you may use any other type of amplifier, gate, or even transistor circuit to get any such xtal oscillating.

Also did some some study on the temperature effect – heated to 100 degC, the frequency dropped by 200 Hz!

A precision current source: a mirror, and a TL431

There are many uses for a good current source, in particular, to drive a noise generator, Noise Source TWS-N15. Not much to write home about, but because of frequent requests, I am publishing the circuit here. It will work for small current from 2 or 3 mA up to 10 or 20 mA with no problem, and very little drift over temperature and time. For R, uses a good resistor. Input voltage can be up to 35 V, or even higher.

The big crash: Server failure

This blog is hosted by a professional provider, but the manuals archive (which needs quite a bit of storage), and other webpages, and my fileserver, is running on two machines, a Dell OptiPlex FX160 as the main, eco-efficient system (in Germany), and a Dell PowerEdge SC1425 with a Raid 1, 3 TB hard drive system as the backup, and currently my main system in Japan (where I am living on a temporary business assignment). Recently, the SC1425 failed, it just would not start up anymore. Power supply seems OK – likely, a severe issue. Checked all the memory and everything, but to no avail.

After fiddling around for about 2 hours, and still no success, I decided to order a new server – a new old server, Dell PowerEdge 850. Just about 35 Dollars used. Rather than 2x XEON processors, it has a Pentium D, 3.2 GHz Dual-Core. Plenty of power for a web- and fileserver.

A couple of days later, the unit arrived – removed the SATA Raid controller (running on Ubuntu with software Raid), and some BIOS settings (activate SATA, disable Keyboard error, enable boot from USB, default power up status is ON) plus BIOS Update. Also, reconfigured the router to make sure this machine will get all the HTTP requests.

A few tests – the harddrive is working fine, about 100 MB/s (sure there is a cache). The Raid 1 is up with no repairs or anything.

A quick check – also the web server is reachable.

I wouldn’t recommend a single PowerEdge for your super critical applications, but they are pretty good for the current cost, as long as you don’t mind the fan noise.