Category Archives: Electronics

Electronics

Rong Hua (Bianhuan) “50 Watt” Travel Adapter: not enough iron, for this “wattage”

In interesting find, Made in China, a 50 Watt travel adapter.

autotrans sc-20c a

autotrans sc-21c

autotrans sc-21c receptacle

autotrans plug

This is used to convert 220 V (despite the US plug!) to 110 V – same device also seems to exist for conversion from 110 to 220 V.

The build quality is exactly what you expect for less than USD 7. A crude plastic case, two screws, no protection circuits or fuses, and a rather small transformer.

autotrans inside

Total weight of the transformer – about 140 g.

Looking at some transformer tables, this is about 6-10 VA (=”Watt”, if you wish) nominal size. For autotransformers like this, the nominal size needs to be converted to the actual power rating, by using the conversion ratio (voltage ratio). P_nominal=P_actual*(1-voltageratio). I.e., for a 220 to 110 Volts transformer, the ratio is 0.5, and a 10 VA nominal transformer can handle 20 VA if configured as an autotransformer.

Quite obviously, 20 VA is not 50 VA – please use these these transformers with great caution, and only for really small appliances. Never leave it plugged in unattended, it might catch fire any time if overloaded, or if it fails!

Resistive Power Splitter: trying out a low-cost construction

For leveling of signals, or test that require two tracking channels, like tracking insertion loss measurements, a resistive two-element divider is very handy. These are broad-band, and rather robust devices.

One input, two resistors (50 Ohms each), in series with two outputs.

Such devices are available from various suppliers, and cost anywhere from 25 to 300 USD, depending on level of precision and frequency range.

Why not try to build one yourself, with some small 0603 resistors; I used China-made SMA connectors, and 4 pcs of 100 Ohm resistors.

splitter

How does it perform? Well, let’s connect to it a network analyzer and try:

splitter test

Port A through measurement (port B terminated):
thru port a

Port B through measurement (port A terminated):
thru port b

Tracking is pretty good, 0.05 dB @2 GHz, 0.15dB @2 GHz.

ret loss

swr

1.2 input SWR – well, pretty acceptable; might still be able to improve by adding some solder or by changing the length of the pin. Good enough.

Here, some specs of a HP resistive splitter:

hp11667a

DCF77 Frequency Reference: a resonably accurate 10 MHz source

For those out there that need a good 10 MHz source to calibrate their counters – there is an easy method, at least in Europe – the DCF77 transmitter, near Frankfurt. It uses a 77.5 kHz carrier, which is kept very close to 77.5 kHz, all the time, and puts out about 30 kW of power. The carrier is controlled to within 2*10^-13, way better than I need.

To make use of these waves, I build a little receiver, using a tuned circuit, a FET pre-amp (which is located in a plastic case, several meters away from the bench, to avoid interference.
The 77.5 kHz signal is then converted to a square wave by a limiter circuit, and phase-compared to a 77.5 kHz derived from a 10 MHz OCXO. For the OCXO, I used a Piezo brand Model 2920136, but any reasonably good 10 MHz OCXO will do.

piezo 2920136

No need to go to a rubidium oscillator, which will only consume a lot of power and wear out over the years.

dcf77 input

dcf77 limiter

The amplified signal is also available at a rear BNC connector, for troubleshooting, and to find the best spot for the antenna (just connect a scope and align antenna orientation/place for best amplitude).

The tricky part – deriving a 77.5 KHz signal from a 10 MHz source. This requires a fractional divider. First, the 10 MHz signal is divided down to 310 kHz (4x 77.5 kHz), followed by two :2 dividers (74F74 flip-flops). This will give fast transitions, and exact 50:50 duty cycle.

The 10 MHz to 310 kHz divider is implemented using an ATMega8515 (you can use any other microcontroller that can handle a 10 MHz clock). The program does a simple trick – it generates 31 transitions for any 1000 clocks; and it does this with reasonably well distributed jitter.
7 blocks, with 33-32-32-32 cycles; and 1 block with 33-32-32 cycles; in total: 23 sequences with 32 cycles, and 8 sequences with 33 cycles – a total of 1000 cycles over 31 sequences. I am so glad that microcontrollers exist, this would have taken quite a few TTL circuits to realize this hard-wired.

dcf77r_p.c AVR GCC file

dcf77 divider pll

The PLL, build around a 4046 has a long time constant, several minutes, however, you could improve the frequency stability by using a constant of several hours – which is not quite practical, and also not necessary, for the given purpose (to provide a reference that is accurate and stable to better than 1 ppm, and that has a phase stability of better than a few microseconds).

dcf77 aux

dcf77 output

Some auxilliary circuits, for the lock detector, and the outputs. Outputs are TTL, but you can also add some transformers, resonant circuits, etc., in case you need other signals. I found these TTL signal very suitable to lock all kinds of test equipment, and never had any issues with ground loops so far. If you do phase noise measurements, I would recommend to use a local Rb reference anyway, or a free-running precision/low noise OCXO, not the output of this device.

dcf77 view 1
Note the shielding of the input circuit, using some copper clad board. A bit curde but works.

dcf77 view 2

The thing, put into a nice box:

dcf77 front

After some days of monitoring the output phase vs. a GPS-adjusted Rb oscillator – the device is working just fine. There are some phase fluctuations, most likely, due to the propagation of the 77.5 kHz waves, and these cause phase shifts of about 1 µs. Well, just temporary shifts, and by all means good enough to calibrate any OCXO to full resolution.

Why not use a GPS disciplined oscillator, or a Rb oscillator? Well, the GPS signal, who knows when they will shut it down; and it needs a rather facy antenna, and, you can’t build it from scratch (well, you can, but would be a major effort!). Why not a Rb oscillator, well, I actually have a good Rb, but rarely use it, because it needs so much power, and way too accurate for the general tasks at hand – rather have the DCF77 running, which only needs very little power and generates no heat; and, the OCXO won’t wear out so soon!

Oscillator Driver/PLL: tuning fork oscillator

Recently, a “very special” circuit had to be designed – a driver for a mechanical oscillator. The objective – to find the natural frequency of such oscillators, to a very high degree of precision, and at very small amplitudes, in the µm range.
Measurement of the frequency is easily done by a frequency counter – what is needed is a circuit that keeps the oscillator going at a constant amplitude.

The oscillator (a mechanical tuning fork, metal tube) carries a small magnet that can be used, together with a stationary coil, to make is oscillate and sustain the oscillation.
The movement of the tuning fork is sensed by a light gate – an IR emitter diode, and a photodiode.

The oscillator is running at a few 100 Hz, in a very well thermostated environment.

First part, the photodiode amplifier, and signal conditioning circuits.
osc pickup and amp

The second part, the PLL (a classic 4046), and some auxiliary circuitry to provide monitor outputs.
osc pll-vco
For operation at other frequencies – adjust the VCO timing capacitor, or use an external VCO.

The coil driver – and monitor driver, this is a very low power systems, a few milliamps are plenty for the coil.
osc coil driver

Tesla/Voltcraft BK127C Power Supply: a trusty fellow

One of the first pieces of electronic equipment I have ever owned, maybe the very first, a 0-20 V power supply, 1 A max. current. Made for Voltcraft (brand of the “Conrad” electronic mail-order company, popular in Germany), by Tesla, “Czechoslovakia”.

In the mean time, I have 3 of these, and despite the “1 Amp” limit, these are very useful supplies, and there are hardly any circuits that need more than 1 Amp. The output is reasonably low-noise – very similar to other DC supplies or power packs.

bk127c

Build quality is very sturdy, folded steel – and a basic but very reliable circuit, designed around a uA723.

bk127c schematic

Years ago, I had one of the supplies fail on me, when powering a high voltage circuit – this caused the power transistor, a KD606, to fail. Replaced it with a BD317 – working perfectly fine.

The manual – sorry, in German only.
tesla bk127c pwr supply

Regulated High Voltage Power Supply: Switchmode control, 30 kV, about 1 mA

Disclaimer: This circuit description is for your information only. Do not attempt to duplicate! Danger! High voltages can kill you!

For many purposes, a regulated high voltage supply can be very handy. Purchasing one is not easy because such supplies are in high demand by all hobbyists that love sparks, and used units are quite expensive.
Fortunately, high voltage transformers are much more commonly available, from TV sets, so-called “Flyback” transformers. These provide, depending on type, up to 30 kV of DC voltage, at a pretty decent power of about 20-30 Watts.

Quite a few circuits are around, to provide drive signals for flybacks. These work, but often only for a short time – after a few sparks, the driver stage transistor blows. And, most of them have no means of adequately controlling the voltage.

Control of the high voltage typically requires measurement of the high voltage, a task that is not easily implemented – requiring expensive and bulky divider resistors.

The circuit described here is time-proven, and eliminates many of these shortcomings.

(1) Snubber networks around the coil and switching MOS-FET eliminate spikes in case of a shorted output (sparks act like shorts on the output).

(2) The primary winding – it is of very low inductance, just a few turns. This makes it easier to control the voltage spikes on the primary, and allows low voltage drive circuits (much reduced risk of electric shock, much better for amateur use). Still this circuit is dangerous! Do not attempt to replicate!

(3) Switchmode regulation with current limit – also this provides added protection against overload. Dead-time control limits the maximum duty cycle (power).

The design, all build around a real classic, a TL494 switchmode regulator.

hvpwr schematic switching regulator

Power is supplied via mains filter, and two transformers. Second transformer is only a needed for the LCD panel meter (Voltage display in kV). Note that the regulator and primary coil is on a floating ground. Earth ground is used for the high voltage coil, with a 1 mA full scale amp meter. Actual output current can be above 1 mA, depite the caption “0.5 mA”. Make sure to adjust the maximum current conservatively, and also the dead time, to keep the output power limited – otherwise, the flyback transformer will suffer and eventually stop working.

hvpwr schematic pwr supply

The most interesting part, the flyback driver and snubber circuits. The snubber circuits were designed with a lot of effort, using a scope to probe the overshoot voltages, etc. – if you change the flyback or primary inductance, make sure the check proper dampening! The BY329-1200 is a fast diode, with rather slow (soft) recovery. This will lead so some extra power losses, but this can be tolerated here. The VDRs add some more protection, but actually, they were added more for peace-of-mind than for any real purpose.
One thing to be improved in further design updates is the gate drive: the gate to source voltage is currently the full voltage of (about 24 Volts), it works, but it is running close to the limit of the IRFP450 device, or even above the limit. Furture circuits will include an independent linear regulator, to run the TL494 from a 15 V supply, derived from the main supply, and maybe a Zener diode added to the gate drive signal path, for added protection agains gate voltage excursions.

The IFRP450 is driven rather hard, via a 47 Ohm gate resistor, and has very small switching losses. No heatsink required, mounting it to the rear panel will provide ample heat dissipation.

hvpwr schematic flyback driver

The flyback itself, a 0100170 equivalent to HR 8409 type. The only coils used are the secondaries. The high voltage coils, for the output, and the 11-12 coil, for the voltage feedback. The voltage derived from this coil by half-wave rectification is a very accurate representation of the high voltage output. This has been checked at multiple voltages and load conditions!
The primary winding is 8-1/2 turns of rather heavy copper wire. You can also twist multiple thinner wires, if no thick wire is handy. I used double-isolated type; the device below is just a lab demonstrator for personal use, for professional cirucits, it is suggested to use PTFE (Teflon) or silicon tubing to provide additional isolation of the primary winding from the ferrite core.

Keep your fingers (and other wires) off the other primary windings!! These carry dangerously high voltages, at significant power, and might be more dangerous than the acutal high voltage secondary!

hvpwr flyback hr 8409 equiv 0100170

The actual unit:
hvpwr front panel

hvpwr inner workings 1

hvpwr inner workings 2

hvpwr inner workings 3

hvpwr inner workings 4

hvpwr rear panel

The rear panel has the high voltage output: a big isolator, machined from HDPE plastics, with a 4 mm receptacle hidden inside.

Stepper and Multi-phase Motor Control: LMD18245 based driver

For quite a few projects, I need to control DC, stepper or similar motors, with moderate power, anywhere from 0.5 to 2 Amps. For smaller motors, I have a well-established circuit using ULN drivers (to be described elsewhere), and for powerful motors, I generally use the reasonably inexpensive Leadshine or Leadshine-compatible controls – but for the intermediate range, below circuit has provided great service in many applications over the years.
Mostly, it is used together with bipolar stepper motors, like, in a big engraving machine build about 10 years ago. Recently, I re-used the design to control a rather uncommon 3-phase stepper motor.

The original prototype:

lmd18245 driver

The key part is a LMD18245 from National, now, Texas Instruments, about USD 10 per piece. This is a full H bridge, with 4-bit DAC current control, integrated diodes, and utilizing DMOS technology. It is working up to about 3 Amps, 50 Volts; and has overcurrent/overtemperature protection. Not bad, and it allows for very small designs, without going to the trouble of thermal engineering of power SMD components used in more recent designs (and reliability issues, if such design is not properly done).

The LMD18245 uses a remarkable current sensing technique – the main DMOS switches are made up of about 4000 elements, and only one of these is used, along with a current sense amplifier, to provide a 4000:1 scaled version (250 µA per Amp) of the coil current. This eliminates the need of heavy/expensive low-ohm low-inductance resistors.

lmd18245 dmos current sense

To protect the circuit, two capacitors are used – a 1 µF film capacitor, close to the VCC input of the LMD18245, and a 470 µF electrolytic (1 for each pair of phases).

The digital interface is very simple, and has been used in assemblies of multiple motors/multiple phases with success. The data bus input is buffered by 74LS374 edge-triggered D-flip-flops. Many units can be connected to a common bus, using a ribbon cable, and solder bridges for the address (LS374 clock) lines.

Typically, these are set by a micro-processor, using a look-up table (if MCU pin number is limited, a shift register, 74LS164 or similar, can be used instead). This allows full control of magnitude of current (4-bit DAC), and direction (via H bridge).

lmd18245 driver schematic

Judging from experience, the LMD18245 is a very robust device that can be employed of all kinds of motor control, in particular, if you need a easy to implement, but still fully customizable, reliable solution.

USB RTL SDR 28.8 MHz Reference: VCXO

One of the shortcomings of the USB RTL SDR devices is the build-in oscillator. It is actually very stable and sufficient for all kinds of everyday uses, but I am using these SDR devices for narrowband applications, with down-converted microwave signals. So utmost frequency stability is a must.

Not only needs to frequency be stable, it is also a good idea lock all oscillators to a common reference, which typically is derived from a 10 MHz rubidium source (like in my lab), or a GPS-controlled VCXO.

How to get from 10 MHz to 28.8 MHz – well, not all that difficult, but needs quite a few parts. First, we need a circuit that can receive 10 Mhz signals, and clean them up and prepare them to be used by a PLL. Then, we need a VCXO (voltage controlled quarz oscillator) that can be tuned by the loop filter of the PLL to keep it at 28.8 MHz. The loop BW will be very very narrow, a few Hz at maximum. Comparator frequency can be up to 400 kHz, the largest common divider of 10000 and 28800; but I might select a value more like 100 kHz which can be readily derived from a 10 Mhz reference. There are plenty of programmable PLLs around, but I might just use a hardware solution here (only need to put together :288 and :100 dividers using some TTL logic).

The circuit-
rtl sdr 28-800 MHz ref pll

– nothing too fancy, and still needs some fine tuning. The xtal, it’s the original part de-soldered from the RTL SDR stick. These are actually pretty stable and well-behaved, at least for the devices I sourced from China.

The circuit employs a Pierce oscillator, build around a J310 FET. This is coupled into a common-bias amplifier, another J310, which provides the low output impedance. A matching network is added the make the circuit rather insensitive to changes in the load impedance. The circuits draws about 20 mA at 12 V. Not quite a power safer, hey, but this is not the objective here.

The items circled are just temporary parts, will need further optimization.

The big question – tuning range (pullability) of the xtal. Ideally, it should be a few 10s of ppm, to give the PLL some room to operate, and to account for aging effects over the years. Temperature-induced changes are on the order of a few ppm (see earlier post); but there is also drift, and other factors.

A quick test with some capacitors, and, stable oscillation can be found in a range of -1.8 to about 1.8 kHz around the 28.8 center frequency, this is quite satisfactory.

rtl sdr ref vcxo circuit

At the moment, still run with fixed capacitors, but I will add a varactor network to provide about 8 to 40 pF tuning capacity, by voltage input.
In an effort to keep phase noise down, I might employ a circuit used a lot for earlier projects, with anti-parallel varactor diodes.

rtl sdr ref 10 pf

rtl sdr ref 37 pF

The spectra look pretty clean, and the power is as expected, about -10..-6 dBm. I will use this output to drive the PLL, and add another amplifier to drive the RTL SDR R820T reference input – well shielded from everything else to avoid spurs from the divider and PLL circuits.

A quick test of the phase noise – hooked it up to a 3585A Spectrum Analyzer – there are some mains spurs, which will be reduced by adequate filtering once the circuit is fitted to a shielded box. Other than that, nothing really suspicious. All very close or at the noise floor of the 3585A.

10 pF sdr ref0

3585a noise floor

AIOM: updated schematics, differential input bias, high-impedance input protection and amplifier

Some progress, with the universal analog input output module, analog response analyzer, or line tracer, digitizer – however you want to call it. Added a few features – a bias supply for the differential input, and a high impedance amplifier (and a bit of protection circuitry) for the single-ended input.

First the bias supply – to allow a wide range of input voltages, say +-20 V (even below ground and well above the positive rail), we need a resistive divider network, and this needs to convert a differential voltage (with absolute voltages centered around ground), to a differential 0 to 2.5 V input, centered around 2.5 V (the internal bias of the ADC). A little calculator is used to find the right resistors and bias voltage. About 2.65 V will do the trick, for the desired input range, and resistor combination. Bias current is just about 1 mA or so, easily sourced/sinked by a OPA703 opamp.

adc input bias calculator

This input is mainly designed to sense low impedance sources, e.g., current shunts or supply voltages (lead compensation, or similar configurations). So the ~50 k input impedance will be perfectly fine.

aiom schematic 1 of 2

aiom schematic 2 of 2

The general circuit, nothing really exciting about it – the AD7712 has a 8 MHz crystal, will run easily up to 1 kHz conversion rate. But mostly, it will be run at 50 or 60 Hz, to suppress any mains related noise, or even at 10 Hz.

A quick test showed that the USB communication is working (using a JY-MCU ATmega32L minimum board) – just waiting for some long waiting times and train travels to write a simple user interface, to control the outputs and the data acquisition by Windows GUI. For plotting and data analysis, I will resort to gnuplot and/or R, not re-inventing the wheel here. Maybe a simple preview screen.

AIOM – Analog Input Output Module: the low-voltage low-current SMU

Quite frequently, I encounter rather large stacks of system power supplies and multimeters to test various types of equipment or circuit prototypes. Often, voltages are just in the 0..10 V range, sometimes, up to 40 V, at small currents. The response of the ciruit is then measured, often, after conversion to a voltage, or as a frequency, etc, with a counter.
This all works, but consumes space, a lot of power, heavy lifting, etc.

Therefore, what is needed, is a kind of Swiss Army Knife, a ADC-DAC unit, with some capable software, a small box that replaces at least two power supplies, and two voltmeters. Preliminary name: AIOM

Essentially, a small brother of the now very common source measure units, aka, “SMU”s.

Possible uses include:

(1) Test of diodes etc – trace recorder.

(2) Control of sweep generators, synthesizers, analog spectrum analyzers (most of these devices have a 0..10 V tuning-frequency control input, and often, a chart recorder-analog output, +-5 V, +-10 V, +-1 V, or similar).

(3) Test of VCO tuning curves, YIG current drivers, YTF circuits. Special VCO analyzers exist, but no need to block a whole lot of space just for some tuning test, and are too expensive to have multiple units at hand all the time. Often VCO tests need to be done at various temperatures, and over considerable time, to ensure performance of a circuit – multiple small test units will allow parallel testing, at very resonable cost.

aiom scheme draft

Features:

(1) Two 0..10 V outputs, 16 bit resolution, low drift, better than 0.05%; source and sink. Needs to have reasonable low noise.

(1b) Optional, to be added, voltage to current converter (to control current, rather than voltage, 0..10 mA, source and sink).

(2) Two inputs, one referenced to ground, one fully differential +-10 V.

(3) Ramp generator and similar features (rough sine, triangle, square/PWM), in hardware, to allow fast sweeps or steps or PWM-related tests (something like a simple arbitrary function gen).

(4) While the basic design will be kept strictly unipolar, there will be a simple switching matrix, to allow polarity reversal. This will also ensure fully symmetrical tests, e.g., for charge counting-battery test, charge-discharge efficiency tests.

The whole little thing has two parts: the AD/DA converter board (prototype build), and a switching materix (still waiting for some parts).

aiom board

First tests successful, stay posted!

aiom test setup