Category Archives: Various

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.

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.

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.

Crimping Molex Contacts: 3.96 mm KK Style, new capability add to my workshop

For year I have been using various Molex style connectors, 2.5 mm, 3.96 mm, and so on, but never by crimping own contacts. Criming is a special art, and if not done properly, it can cause all kinds of reliability issues. So I usually purchased pre-crimped wires, and just assembled them for contact blocks. In other cases, I just used regular pliers to mount wires to contacts, and soldered them in (best, to pre-tin the wire, then mount it in the contact with small pliers, then solder it in – this will result in a very reliable connection. Also, never use low quality wire, only full copper core, heavily tinned wire, UL 1007 or similar.

But why not try to crimp contacts ourselves and add a new capability to the workshop? So I went ahead, and ordered a low cost pair of crimping pliers, EUR 12, not bad.

It made it from China to Japan very quickly, delivered by a friendly postman (here they are very friendly). That’s the tool: quality looks quite OK, and the steel is pretty hard. Sure this is not a high throughput production tool – I am looking at a few 10s of contacts every year, not 1000s.

Step 1, remove the insulation from the wire, and get the contact and pliers ready.

Step 2, insert the contact in the pliers, and close it until flush (don’t apply much force).

Step 3, insert the wire, and crimp the inner connection. Don’t get any of the insulation caught up by the crimp. It is a bit inconvenient to get the contact out of the pliers, probably will make a special tool for it (a U-shape bent piece of steel sheet metal to push out the contact).

Step 4, Inspect the inner crimp. Use a magnifier if necessary (make sure no plastic and insulation got into the crimp area). Pull on the wire, it must be firmly held (a properly crimped wire can’t be pulled out by any reasonable force).

Step 5, slightly close the insulation crimp using the tip of the pliers.

Step 6, establish the insulation crimp.

Step 7 – It’s ready. Inspect. Carry out pulling test.

HP 8412A Phase Magnitude Display: really unusal supply voltages…

Looking for the CRT front bezel and frame to fix another unit, I found this 8412A Phase Magnitude Display on a Japanese auction site for EUR 8 plus shipping, really affordable! Also, I believe it to be a great source of spare parts, because there are many of the HP standard semiconductors of the 70s inside.

The unit arrived in great shape, almost too good to take it apart – maybe we can use it for something cool, like a CRT clock or some soundwave visualization unit?

How to get it to work – checked the 8412A manual, and, unfortunately, it needs a whole lot of unusual supply voltages (the 8412A slides into the 8410A/B Network Analyzer mainframe) – not easy to operate it without the mainframe. 175 Volts AC, to drive the CRT and 6.3 VAC heater, and +-20 VDC, for the other circuits.

Some pictures of the unit…

The dangers of high voltage are fairly obvious!!

Quite similar to other HP units – amazing how often they recycled the design!

2.000 kOhm, +- 0.05% resistors, a matched pair – not bad! Definitely, a lot of good parts in this unit, including high voltage parts, a good CRT, many semiconductors and transistor pairs, mica capacitors, etc.

HP even supplied a small test board to make service and adjustment easier! Great!!

US TEO Power Suppy: you want to get killed by a USB charger?

This is one of the worst electronic gadgets that my workshop has every seen, a US TEO Brand A5951 USB charger. Usually, not much can go wrong with the design of a 5 V switchmode power supply, but with this device, all went wrong, a combination of bad design, bad manufacturing, and non-existing sense for product responsibility.

Can you see the wires – right hand side is low voltage side, left hand side is mains! Can you see the solder stuck to the board – almost connecting mains and low voltage?

The only “safety” function I can see if a PCB trace fuse (left hand side zig-zag) on a mildly flammable paper board.

Even the case isn’t sealed – the manufacturer is even saving the glue!

That’s the brand name and numbers, if you have one of these, take it out of service immediately!

Seems Canada has some clever authorities – they found a whole lot of unsafe USB chargers. Remember the good old days when it was illegal to import just any kind of crap?