Category Archives: Electronics

Electronics

Blaupunkt OSTIA Home Radio: revamping an old beauty

As a family heritage, we ever had an old radio from my great-uncle (brother of my grandfather) named Modestus, and ever since I can remember is had been standing in the bedroom of my parents. Eventually, it was no longer used there and moved into my mechanical workshop where it still serves to play background music while I am operating machines.

It was build some time in the early 70s, and is based on germanium transistors – to be precise, 11 germanium transistors. The sound is not bad given the relatively simple circuit. However, in the last year it must have suffered some degradation of the FM tuner, because this tends to drift, and the reception is not clear always. Especially in winter, switching it on after a “cold” start, it needs some re-tuning after about 30 minutes of operation. A little inconvenient. Rather than spending a long time trying to fix an old FM tuner, I decided to take another approach – adding a new digital (PLL) tuner.

In my stock of old parts I had a no longer used PCI TV card, which incorporates a Philips FM1216MK tuner, a combination TV and FM tuner use a TSA5523 PLL, and can operate from a single +5 V supply (because of an internal DC-DC converter).

The card is a combined ISDN-TV-FM card. The tuner can be easily desoldered. Control is by i2c bus, two wire interface. Some libraries exist, but I didn’t use those. Rather straightforward to send the bytes needed to set the frequency and to do some more configuration needed. The tuner has a stereo decoder, but I operate in mono mode – there is only one speaker in the OSTIA radio.

A quick setup with a i2c LCD added for debugging. Using a Arduino Nano3 board clone with an ATMega168p microcontroller. But any microcontroller will do.

Now, integrating the new tuner to the OSTIA – my objective was to not destroy the old beauty, integrate minimally invasive. A first attempt to use the build-in transformer failed, because it could not provide the roughly 200 mA current needed for the Philips tuner.

To feed the audio signal, I cut a bridge on the board (which carries the FM audio from the old tuner), and injected the audio from the new tuner via a 100 nF foil capacitor.
For control of frequency, there is no an incremental encoder on the back of the radio (I rarely change the station if at all), and when you push on that encoder, the last frequency set is stored in EEPROM. The LCD has been disconnected, not needed during operation.

Finally, the OSTIA back at its accustomed place in the workshop. Reception is good and stable now, all frequency locked to a small quartz crystal.

Certainly this radio now has no longer just 11 transistors – maybe 500 transistors now!

NE555 Watchdog Timer: the ESP32 needs some oversight

The readily available ESP32-DevKitC boards have served me well in many application, but there are some issues with one of the circuits that is up all throughout the year in my house to record moisture and temperature levels. Occasionally, like, every few month, this ESP32 gets stuck, so the web server running on that ESP32 is not responding anymore, and the logging of the data will stop (red marked portions in the plot).

The root cause of that relates to the current pulses drawn by the WLAN circuits of the ESP32, and despite connecting a good USB power supply, proper cables, and capacitors, it seems that there are occasional issues that I haven’t been able to solve be capacitors, better power supply, or software restart-features. I added the later, but the ESP32 freezes to a level that any software reset triggered by the code won’t work. Shortly disabling the power converter on the ESP32-DevKitC (of the on-board 3.3 V regulator – its EN/enable pin is pulled high by a resistor) will restore the function and get the circuit started again.

As I am not always around watching this circuit, I added a good old trusted NE555 timer, which will send a reset pulse (by pulling the EN signal low through a Schottky diode), and the capacitor is shorted by the small MOSFET, as long as the ESP32 is sending a pulse (this is send every 10 seconds approximately, for a few milliseconds) — if the ESP32 gets stuck, there won’t be any pulses, and the NE555 will then reboot the ESP32 every other minute by cycling the power to the ESP32.

Another Micro-Tel 1295 Precision Attenuation Measurement Receiver: irresistible green

I am trying hard to resist the temptation of buying more test equipment, but the Micro-tel special green color has a hypnotic effect on me, and combined with the right price, I could not resist to buy one more Micro-tel 1295 receiver. These are very capable 0.01~40 GHz fundamental-mixing receiver (fundamental mixer until 18 GHz, above that, harmonic mixer), with very large range, like, 120 dB, and 0.001 dB attenuation resolution. Ideally suited to calibrate attenuators or to check antennas, etc.

The unit – offered as non-working – arrived very well packed. Unfortunately, many people send sensitive equipment in some thin cardboard boxes. This particular equipment cost close to 85 kEUR in 1989, plus mixers. Also, it has long been under export control from the US, because of its unique range and accuracy.

Bubble wrap, other fibre wrap inside.

Finally all in foil.

The defect, it doesn’t show any reading on the display, and both the HI and LO leds are on, which is abnormal. The 1295 has a 12 dB range bolometer detector, any signal below 0.5 dB or above 12.5 dB will light up the LO or HI lamp, and you would need to select another 10 dB step of the IF attenuator (a high precision 30 MHz attenuator), or let the automatic attenuation selector do the job.

There are many boards inside, but all nicely numbered and with instructions in the manual.

The HI and LO level detection is done on the A3B2 assy.

According the the schematic, U2, a MC1458 generic dual opamp is switching the LEDs and providing signals to drive the automatic attenuation selector.

A quick check revealed that U2 is defective, so I replaced it quickly, and this already solved the issue and brought back the display.

Another trouble related to unstable lock of the 2.3 GHZ auxiliary LO that is used for the 0.01-2 GHz range (which uses a two-stage down mixing).

Fortunately, I had a spare 2.3 GHz from my parts unit (which I bought years ago – a partial unit – while I was living in the US). That part was missing one of its covers, and had also some issues earlier, but I had fixed it a while back just for curiosity. Now I can fix the unstable 2.3 GHz removed from the unit during next winter. It has a 2.3 GHz VCO, a 100 MHz local oscillator and a PLL inside.

After calibrating all the oscillator frequencies, which went without trouble, I noticed that the top 120 dB attenuator was 0.04 dB off, well, not a big deviation, but I would rather have the unit working perfectly. So I removed the attenuator for further study.

It is build with really high quality relais, more than USD 50 (each!!), and some precision resistors.

Nothing could be found wrong with the unit by visual inspection.

Also I used the VNA to check the attenuator, and all seems well working.

All the 3 segments, virtually equal at 10 dB each.

Finally, I put everything back together, a little clueless, but, now, for some reason, all is working and stable. Maybe it was some lose connector, or other strange effect that is now gone. All attenuators calibrated perfectly, using by HP 3335A level generator (which has a top-accuracy attenuator).

Finally the 1295, working just perfectly fine. Maybe better than ever before.

Interestingly, as with all of these Micro-tel devices, the side and top/bottom panels were painted with various kinds of special military paint – some with a rubberized paint that will dissolve into some gluey substance over time, some with a type of “abrasive” paint, other already re-painted in forest green.

The paint has very large and hard grit, almost like sandpaper. But I will leave it untouched, it seems the original looks for this serial number range (the 1295 seems to have been in production for 10+ years).

Now, a little gallery of all my Micro-tel 1295 receivers: the first two, part of my frequency-locked attenuator calibrator (can measure reflection and transmission at the same time).

One as part of an E-band (60-90 GHz down-converter).

Any now, already two spare units in perfect calibration.

Still, in the basement, a box of spares… likely I won’t run short of receivers soon. Maybe even buy another one should it come around.

HP 11517A aka 08747-60022 Harmonic Mixer: a little study of a very intriguing device

As part of a HP R8747A 26.5-40 GHz reflection/transmission test unit (for the 8411A network analyzer; 6300 USD in 1973 — about 40 kEUR today), I got two HP 08747-60022 harmonic mixers, one didn’t seem to work right, the diode has just 0.2 V voltage drop. These were fairly fragile devices, only designed for 1 mW of power, and very static sensitive, point contact devices.
In addition to the regular 11517A, the 08747-60022 has a bias connection (needs about 1.5 V DC bias, center positive).

The main unit can work from 12 to about 40 GHz, with a set of adaptor waveguides.

The unit can be taken apart, all precision machined.

The diode is pressed in, on some holder (haven’t tried to remove it from the case).

There are several other precision parts, a coaxial resistor, held on to the diode with a spring.

There is also a spacer, with a very flat capacitor, a DC block. The spacer is modified to connect the center conductor to a surface at the perimeter (used for DC bias).

Further up, there is a low-pass, machined from a single piece and gold plated.

The N-type connector, stainless, is screwed on.

The DC bias uses a small 1.5 kOhms resistor, and a custom connector, so that the resistor is pushed onto the spacers’s connection.

Here, a quick schematic. Seems a lot of engineering went into this device…

Finally, we need a microscope to study further here, the diode (the square), about 0.25 mm side length. It is isolated from the case by an air gap.

The diode is made by a contact junction, a small tungsten(?) whisker.

Probably, this whisker needed some adjustment during manufacturing. I tried to adjust it a bit, but this didn’t change the diode characteristics of my broken unit, unfortunately (anyway, these devices are more for study than for use; currently using only cartridge-based diode mixers).

Also, looking into the waveguide of the assembled mixer, with good long-range optics, I could get a shot of the actual point contact in action. Very interesting historic technology.

Fixing a really-high-frequency phase locked oscillator: a noisy opamp and a little bit of sticky tape

Recently I got hold of a really marvelous bit of kit, an assembly of millimeter wave phase locked oscillator, all the way from 60 to 89 GHz. It is already 35 years old, but all based on solid state Gunn/Impatt oscillators, so there is little aging. For each frequency (there are 5 discrete frequencies), there is a full assembly of reference upconverter (100 MHz reference to some intermediate frequency in the 6-12 GHz range), a voltage controlled fundamental oscillator (e.g., bias-tuned Gunn diode), the necessary isolators and splitters and occasional attenuator, along with a harmonic mixer. The IF is 100 MHz or 200 MHz, depending on the unit.
Only one of the oscillators has been more than 20 kEUR in 1988 currency, and there are five such assemblies on this plate, along with control equipment and power supply…

Only one of the sources is playing up, not achieving phase lock, it is the 79 GHz oscillator. Notably, some of the small screws are missing and the lid of the oscillator cavity has been removed, which points to prior repair attempts. The Gunn has a protection network, a 2.2 µF capacitor in parallel with a ~10 Ohms, ~470n series network — this is to protect the Gunn diode from the inductance of the bias current supply (when the diode snaps-off according to its characteristics, it will induce a very fast current spike that could increase the voltage at the diode above its damage threshold).

Upon close inspection, the 2.2 µF capacitor had been tampered with, bad soldering, only one end connected, and in reverse polarity (it is a high-reliability tantalum cap).

When checking the down-coverted output, there is no stability at all, it has a very strange FM modulation. What could be the root cause?

Checked a few items:
(1) Upconverted reference, 11.3 GHz (7th harmonic will be 79.1 GHz): it is a very clean and stable signal, well locked without any visible noise.
(2) Checked all the cables and connectors by pushing gently, no sign of any trouble, all unchanged.
(3) The supply voltages are all practically noise free.
(4) Also fixed the 2.2 µF capacitor at the gunn diode cavity. No particular effect.

(5) Disconnected all the phase lock, bias driver, and driving the oscillator from an external supply.

Finally, with just an ordinary power supply connected and the voltage ramping up (don’t ramp it up too slowly or let the oscillator sit in an unstable region or at the Gunn peak current for any length of time!), there is a stable (surely, non phase-locked) output, but none of the strange modulation. So it seems, the oscillator is good. But wait, with some wobbling and touching on the part, it is shorting out the supply. Hmm. Time to go a little deeper, and I decided to remove the biasing rod.

Just for explanation, the biasing rod is isolated from the cavity (the metal block holding the diode, with the waveguide cavity in the middle), and conducts the current to the diode, which is at the tip of a metal screw holder.

Under the microscope, the very thin isolating tape (looks like some PET/Mylar transformer tape) is quite damaged and some metal of the bias rod exposed. Also the spring holding down the rod on the diode (which is fixed by a nylon screw) can contact the case easily. So all was newly isolated, and the screw and spring positioned carefully. Surely with all the soldering at the capacitor, things may have shifted a little. At least now no isolation problems any more. Sometimes when switching the oscillators on the assembly, the 79 GHz signal is not coming up, the Gunn drawing much less current. But it can be fixed by just power cycling the assembly, so it seems to be some rise time issue of the power supply.

This is the driver circuit, it has a hybrid high-speed Kennedy electronics 722 amplifier, but the low frequency path is a common NE5532 low noise opamp.

After checking around the low frequency path, the opamp seems to introduce some noise, note that for this level of noise at GHz levels, a few millivolts are more than enough to cause a lot of disturbance.
Fortunately, the opamp was socketed, so I replaced it with a OPA2277, which has about the same noise compared to the (low-noise) NE5532, and much lower offset voltage drift, and 40 dB better CMRR, excellent low frequency characteristics, and lower gain at >1 MHz.

Now, with stable current drive, we can measure the output power (downconverted by an harmonic mixer driven by a 11.45 GHz source, 7th harmonic: 80.15 GHz — shown is the minus mixing product, i.e., 79.0 GHz correspond to 80.15-79=1.15 GHz).

You can see clearly, the oscillator has good power from 79.1~79.25 GHz, but falling down just around 79.0 GHz. Note that at such high frequency, every mW counts…

After some thinking, I decided to try to lock at 79.2 GHz, and as it turns out, it is working fine at that frequency. With the 11.3×6=79.1 GHz, and 100 MHz IF, it works out, and the PLL doesn’t seem to be affected, regardless if you use the minus or plus side IF.

The IF signal can be probed conveniently at a test port, it is pretty clean.

Also the down-converted signals look good (this is 10 MHz span at 79.2 GHz center, corresponding to 80.15-79.2=0.95 GHz downconverted).

Also the close-in side bands are good and a very clean signal.

Hewlett Packard HP-85B: a marvelous desktop computer revived

At its time, the HP-80 series of computers were really desirable and expensive computers, mainly intended for control of test equipment and associated calculations. There is a screen, a printer, a tape storage device, all in one case.

For its age, still looking great!

Some cleaning of the CRT, and some other parts of the electronics to remove dust. But no other repairs were needed to the electronics.

All the shielding, all the parts, it seems to have been hand-assembled in small series, with each part individually checked and hand-labeled…

Only trouble is with some stuck keys. These can be operated, but don’t spring back easily.

Unfortunately, a common problem that can’t be fixed easily. Reason is the age, fatigue of the plastic. So I just switched the few broken keys with less-used characters. This is easily done by pulling on the white actuators firmly.

Surely, the HP-85B had quite severally limited memory, and there were many programs available that would need to be purchased piecewise, but thanks to great enthusiasts (google: EBTKS), there is a solution: the EBTKS extension board will provide huge additional memory, mass storage, and a replacement of the tape drive.

A little test program, to set the time, date (no year 2000 problem…), and even the printer still works (just needed a little cleaning).

The paper is thermal paper, but easy to read and can be even used to print simple matrix graphics.

LVDT converter: a Mahr P2004M, some electronics, and sub-micron resolution

Recently, I got a Mahr P2004M linear variable differential transformer (in short: LVDT), which is a device that can measure distance of roughly 2 mm with basically unlimited resolution. As the name says, it is a transformer, and the primary is to be fed with 19.4 kHz (or there abouts) sine, at 5 Vrms, and if the plunger is half-way in, the secondary coils with balance out, and there will be zero voltage. For any displacement from that position, there will be an appreciable voltage at the output. With the right amplifiers and converters, we can use this to measure distances extremely precisely.

To do some test, I mounted the LVDT in a height gauge, because I didn’t know if it was actually working.

The plug was broken, mechanically, but the little board inside was OK. So I replaced the plug, it is rather common 5-pin DIN plug with screw shield, same as is used for precision 100 Ohm Pt100 temperature sensors.

The circuit appears to have some capacitor, resistor, and an overvoltage protection device. I drew the circuit, but nothing special found.

For a basic test, I used a HP 3325B generator and a dual-channel scope.

Clearly seen, the LVDT is working. There is a certain phase shift of the incoming and outgoing signal, which is normal.

The noise is very small, well below 1 mV with some averaging. Note that the signal will probably go through a filter with 1 Hz or slower time constant.

To check the frequency response, I connected the LVDT to a HP 3585A analyzer, and clearly there is a peak sensitivity around 20 kHz. Better to operate close to that frequency (Mahr may specify 19.4 kHz for most of their sensors).

The Mahr datasheet also specifies how the input is supposed to be connected. There is a similar R-C circuit in the plug, at the other end.

Following earlier circuit designs, and also some Application Notes (Analog Devices AN-301 in particular), a circuit has been put together, consisting of a phase-shift oscillator with buffer and stabilized amplitude (TL431 used as a reference).

The key part is the switched rectifier, which is in a fixed (adjustable) phase relationship to the exiting signal. For adjustment, first null the comparator, then adjust the phase shift for precise switching around the zero point and check that this also coincides with the maximum amplitude at reasonable deviation from the zero position (about 1 mm of travel may be good for a 2 mm probe). The adjustment of the phase is fairly non-critical, but will ensure linearity around zero.

For some basic measurement, connected a 16×2 LCD, but finally decided for a 128×64 dot matrix display with white backlight. With that I can use large lettering which is easy to read in the workshop from a distance.

The full schematic, it a bit crude, may need to be re-drawn eventually. There is a power supply, +-15 Volts firstly, for the amplifier circuit, +5 V for the LCD and microcontroller, an ATMEGA128A.

The A/D conversion is done by an ADS1211U (even if the schematic may show ADS1210), a very reliable and highly precise part. A 24-bit sigma-delta converter. These parts don’t come cheap recently, about EUR 30 a piece, but fortunately, I had one in stock.
It has two separate power supplies of 5 V, one for digital, one for analog (with additional filtering): both are derived from the +15 V rail.

The switched rectifier for phase demodulation is done by a DG202 analog switch (all switches paralleled up for low resistance) rather than a FET transistor – simply because this is a way I normally design the lock-in amplifiers and phase detectors.

With everything arranged and tested, I put the circuit in a sturdy aluminum case. The switches are toggle switches that are easy to operate in the workshop. Sure we could attached various touch screens and buttons, but these are not convenient in a workshop with oil and dust.

The little device runs from 230 VAC mains, and doesn’t need much power at all (to most is consumed by the LCD backlight, which is LED based and supplied from the unregulated negative voltage via a resistor current limiter.

Finally, placed the LVDT setup on the granite surface plate.

So far working very well. There is no visible drift, at a 0.1 micron resolution. I have no intention to go below 0.1 micron in my workshop, as this is a metal working facility, no intention to fabricate telescope mirrors or optical parts.

Automated Basement Ventilation: keeping it dry

Basements in older German houses are usually pretty humid and cold, and there are various rules about the proper ventilation. You are supposed to open the window in the early morning, let some dry air in, but during the day, especially in summer, it must be closed. Summer air contains a lot of moisture, because the quantity of water that air can absorb strongly depends on the temperature, the so-called saturation vapor pressure of water. When such moist warm air enters the basement, it will cool down and water will precipitate on the walls. Not good. For me, this is all a bit inconvenient because rather than potatoes I store a lot of electronic parts in the basement, and I want to keep all as dry as possible. So I decided some month ago to set up a little system: (1) a window fan, (2) two humidity/temperature sensors, (3) an ESP32 to control the fan. As sensors, I use the ubiquitous AM2302, because it is easy to read and accurate enough.

For the fan, a KVVR K011301 Model, about 200 m3/h, it also has a feature to close the opening when the fan is off, so that no air can enter the basement when the fan is not running. In principle, you can also use two fans, one to supply air to the basement, and one to extract it, but for me, it works just fine with one fan to extract the air.

A little contraption made to fit the fan to the window. It is all reversible, so if I don’t like to use the fan any more, I can just fit the old window again.

A little control box was quickly made, with an ESP32 module, and a small transformer, a 5 V voltage regulator (be aware that the ESP32 needs pretty high peak current, several hundred mA in WiFi mode! So I needed to add some rather beefy capacitors. Next time I should use a larger transformer…

The key part is the calculation of the absolute moisture level. This is done by regularly (like, every minute) measuring the temperature and relative moisture level inside the basement, and outside, at a protected spot. Then calculate the saturation vapor pressure (which is a formula you can find in textbooks), and multiply with the relative moisture (in percent). This will give you a value that corresponds to the absolute water content (scaling to grams per m3, or similar, but I just use the hPa value, water partial pressure in air). If the water content outside is lower than inside, in absolute terms, I have the controller switch on the fan. There is some hysteresis to avoid all too frequent switching.

A nice box contains all the circuitry, and it can be accessed via a web interface, pretty handy. I also have a server poll the values every few minutes, to prepare some nice diagrams and to check if the system works as designed.

Indeed, it works brilliantly for several months, but then the AM2302 suddenly failed. It would read back the correct temperature, but the moisture value was stuck at 99%. Not good. I tried to clean the sensor, but to no avail. Also, this is the inner sensor, not exposed to the elements or anything. A is outside, B is inside.

So for the time being, I replaced it with a new AM2302, and hope it is just a freak defect and not a general limitation of these sensors — if it is, I will replace the AMS2302 by Bosch BME180 sensor.

This diagram shows the absolute humidity delta, outside minus inside, so if the outside is dryer than inside (for example, outside 10 hPa water, inside 12 hPa, the value will be negative, and the fan will switch on accordingly.

For now, in June, it is all working well, and the basement is indeed much drier than last year, and I don’t need to worry at all about closing and opening windows.

In this region, it seems that at least every few days there is reasonably dry weather for several hours, and the system uses these hours well to ventilate the basement thoroughly. Sure if you have rainy season in your country, this control won’t help, but it all the more moderate climates it seems to be a nice gadget to have.

Cheap personal scales: turned into parcel scales with USB interface

With many parcels being shipped, and for some other projects including measuring the contents and consumption of LPG gas cyliners, other gas cylinders, chemical tanks etc, I always wanted a slim and stable balance, at low cost. Sure we can fabricate one from steel plates and load cells, at considerable cost. But why not try with a personal scales, and convert it to some usable tool. This scales from local LIDL supermarket comes for EUR 8.99 in the shop, 10 dollars.

It is very slim and stable, basically a piece of hardened glass, with 4 load cells. There are 2 thin-walled stainless tubes to carry the wires to the main processor.

That’s the type, just for reference:

The load cells are the typical 3-wire elements (two load elements inside, red is the center).

The main disadvantage of these balances is (in addition to the absence of an interface) the absence of a continuous reading, in contrast to a good old analog balance it only shows one weight once, when you step on it. For various uses, I rather need a balance that continuously shows the weight, and can transfer it to a host for data analysis.

The load cells rest on certain plastic parts that are glued to the glass plate.

We need to cut a little modification on the milling machine, to make space for a small AVR controller board, and the USB (micro-USB) plug. There is no need to batteries any more, it will all be powered by USB.

For the load cell interface, the 4 load cells need to be wired up in a bridge (not important in which order of the load cells, but always white-while black-black, and alternating red wired for drive and signal inputs.

So we use a very common HX711 driver, it seems to work well with these load cells. I still had a board with higher data output rate (can be changed by floating a pin on the HX711), but you may select the data rate as you like. The HX711 is continuously active, and sending data to the host though a USB serial chip, CH340.

The internals, a arduino nano fake board (not running arduino code, but just some plain avr-gcc code), and the HX711 all wired up, we just need some hot glue to keep it together.

All ready to be put back together. Watch the wires, these are very thin.

The USB port, it all looks as if it had never been without.

The receiver side, the balance digital converted value is directly transmitted to the host, so all the conversion to kg and zero correction is done by the host, including smoothing.

It is just a simple software, I programmed it using wxWidgets, but you can use any software that can handle USB/RS-232 communication and read serial ports, including Python, etc.

One bug with Windows – because of the continuous data stream over serial, Windows 7 seems to believe the balance is a serial mouse, and starts randomly moving the mouse pointer. With the little code below, this can be disabled and avoided. Probably need to add some waiting time before transmission starts in the AVR code.

If you need any of the code or further instructions, just let me know!

For calibration, a good hint, you can use milk packages (UHT milk), one pack is about 1060 g with very little variance, and it can easily be stacked up.
The Zero-Point seems to be very stable, I tested it after 90 kg load changes and so on, and it is not moving by 10 g.

CNC Lathe Signal Conditioning: fighting the noise

For the control of my CNC lathe, I need to read the spindle encoder (index and rotation signal), and two glass scales. These encoders all provide TTL level signals, and so far it worked well, but there are cases were electric noise of the switching motor or other equipment in the workshop. So finally I decided to put a bit more effort and upgrade the interface.

So far, it is just a cable that connects the three sources (spindle-index, x, z) to a parallel port input (a PCI card).

For signal conditioning, the input signals are filtered with a 4n7 capacitor+330 R, followed by a 74LS14 inverter schmitt trigger.

Everything on a little PCB, and put in dust-proof case so that it will work in the dusty workshop.

Finally, put it to a test and it worked “out-of-the-box”.

A simple schematic: