All posts by Simon


I can tell you, these sparks are quite noisy! Keep you children (and yourself) at a safe distance!
Never attempt to energize such apparatus at your home!


With the given 0.5 mA supply, there is a spark every few seconds. Triggering is nice, and stage voltage reaches about 23-24 kV – the design limit.

Should you ever operate a Marx generator, make sure to properly ground and short it prior to approaching it any closer than a few feet!

Stage design

Some boundary conditions:

(1) Stage voltage equals charge voltage – 20-25 kV range would be most suitable to fit an easy-to-build flyback transformer type supply.

(2) Discharge energy should be at least 10 Joules, otherwise, there is not enough noise and the thing doesn’t look and feel dangerous enough (you might as well use a piezo fire lighter to make some sparks…)

(3) Charge time should be reasonable, not more than a few seconds.

With 16 0.1 µF capacitors, rated for 1.6 kV and operated at 1.5 kV (24 kV per stage), a design was established that uses 10 stages – about 220-230 kV peak voltage. This results in about 20 Joules of discharge energy.
It was also found that there is no need to make the stage charging resistors very large (some sources suggest multiple Megaohms, 1 M is just fine for most of the designs relevant in this context). A value of about 8 M was determined for the charge resistor – mostly because of the 0.5 mA current limit of the power supply – you can use a lower value, if you want to put more current into the Marx. But remember that a high-value charge resistor will also protect the rectifier cascade of you power supply, so you might not want to take too big risks.

Detail view

For the spark gap – these are the approximate voltage for a gap mm:
voltage vs gap

Accordingly, the gaps were adjusted to about 8.5 mm using a plastic gauge (to avoid scratching of the spheres).
Note that the stage carrier plates have cut-outs at the spark gaps! This is to avoid unwanted discharge, but also to ensure line-of-sight contact of the spark gaps, which ensures stable triggering (because of UV radiation, emitted from one gap, lowering the spark cap threshold voltage of the next).

Full view
(in the back, you can see an earlier experimental model, using Wima FKP-1 capacitors – however, this design added a lot of inductance, and the adjustment of the spark gaps was not thought out very well).

The starting point

What is a Marx generator – essentially, a device that lets you charge a set of capacitors in parallel (say, to 24 kV), and then discharge they in series, say, at 240 kV, if you have 10 capacitors. There is much more theory to it, all has been very well described elsewhere since the times of Mr. Marx, who first deviced such circuits, arguably, in 1923. If you need more explanation – please ask, I will be glad to explain it to you.

To build a nice Marx generator, you need a few parts:

(1) High voltage resistors – don’t assume this is the easy part – the resistors need to be able to withstand quite some voltage, several kV, and high discharge energy-changes in potential. Carbon composite resistors are best for such applications, but rate to find nowadays. You can get away with series connection of some high-value metal oxide layer transistors. I used some Vitrohm 1 M (Megaohm), 7.5 kV rated resistors obtained as NOS (now-old-stock; series 176 – could not find any data, but seem reasonably robust), some current/more widely available types that may be suitable: Vishay 0207 High Pulse Load Resistors (2 in series), or similar, successfully used for similar projects of more serious nature.

(2) Capacitors – also these must be not only be designed for high voltage, but also pulse rated. Best are especially made pulse discharge capacitors – but these often are oil-filled, rare, and too big for the given purpose. Best alternatives are PP type film capacitors, like the Wima FKP-1 or FKP-4. I used Vishay MKP1841, 0.1 µF 1.6 kV capacitors, metallized PP. The spec to look for is the maximal pulse rise time – the 1841s are not too bad, at least, good enough for this project, and a large bag could be sourced at low cost.

(3) Spark gaps – these need to trigger precisely, otherwise, the apparatus won’t work at full performance, or constantly misfire. Best use polished stainless steel spheres, about 15-20 mm diameter, readly available, already threaded, and easy to attach to the stages.

(4) Some hardware – isolating stand-offs, and some isolating sheet material for the stags – I used some FR4 glass fibre-epoxy boards (leftovers from failed printed circuits, with the copper fully stripped).

(5) A high voltage supply and a feed resistor (about 3-10 M, capable to withstanding at least 50 kV). A series of resistors, item 1, mounted along a plastic rod (Plexiglass, or the like) will do. For the supply, this needs to provide about 20-25 kV (make sure it doesn’t provide more, otherwise the capacitors will suffer!), about 0.5 mA. A fly-back transformer based supply. I’m use a regulated supply (TL494 switchmode regulator, flyback transformer), so the stage charge voltage can be adjusted precisely, and no risk to damage anything.

(6) A good ground connection (earth conductor). Never use plain mains ground, if you don’t want to damage your home electronics! Anything will do, like a water pipe (if fully metallic down to the inlet), or a heating pipe).

(7) Plenty of ground wires around that you can use to safely discharge the apparatus and to keep it shorted to ground if not in use. RISK OF ELECTRIC SHOCK! ALWAYS SHORT THIS APPARATUS WHEN NOT IN USE!

The current regulator

The current regulator – this module converts the current setpoint signal (from the position regulator) into a drive current for the magnet coil. This is achieved using a TL494 PWM modulator chip, and two BUZ11A (50 V – 0.045 Ohm – 26 A) MOSFETs, each operated at 50% duty.


Brief description:
The current setpoint signal is connected to JP1-9, connected to one of the comparators of IC2, the TL494. The other comparator is used as a current limiter: the sense wires of a 0.05 Ohm shunt in the coil supply line are connected to the input of IC1, and intrumentational amplifier, via JP1-7 and JP1-8. You might have to change the amplifier gain by modification of R5.
Current setpoint is adjusted by trimmer R14. JP1-3 and JP-4 provide the gate drive for the two BUZ11A MOSFETs. The drains are connected to the coil, the sources are joined at the current shunt.
Directly, at the MOSFETs, which are mounted on a heatshink (but don’t actually get hot), together with current shunt, there are several electrolytic capacitors (low ESR type), and a 1 µF PP cap (polypropylene dielectric, for pulse current service) in parallel with the (non-regulated) magnet supply. In combination with a strong and fast Schottky diode (anode at the MOSFETs, cathode a the positive supply), these caps are the best protection against any transient voltages when the coil is de-energized.

The position regulator

The position regulator takes the output from the position sensor, and converts it into a voltage drive signal. Nothing fance-it is just an opamp implementation of a PID regulator.


Brief description:
The position signal is connected to JP1-8, and converted to a 0-referenced voltage, relative to the desired position setpoint (R13, 10-turn pot), using IC1A, 1B and 1C.
JP7-1 provides this shifted signal for monitoring (position error signal). Opamps IC2A, 2B and 2D for the proportional, differential, and integral parts of the PID regulator. The P-component is made user-settable via R14 – a 10-turn pot. The other components only need some initial adjustment, depending on the coil you are using (C5 and C8 might also need adjustment; use high-quality capacitors, Mylar or similar). IC1D sums all the regulator components, and has R12, another 10-turn used-adjustable pot for total gain adjustment. Total gain is the most critical adjustment, if you change the type/weight of the suspended part.
IC2C adds a constant offset-just to prepare the signal (available at JP1-3) for the current regulator. JP1-5 has the intermediate current regulator setpoint, for monitoring purposes.

The position detector

The position detector module senses the exact position of the object suspended below the magnet, using a modulated infrared (IR) light beam, and a frequency-selective phototransitor amplifier, and converts it into a voltage signal. The range is a few mm, so there will be a need to adjust the position of the detector, if you want to change the distance from the magnet.
The circuit is pretty fast, and can detect position changes in the range of a few micrometers easily, and at kHz bandwidth. Also, the output (voltage vs. gap) is very linear, this has been checked with the help of a micrometer stage, used to block part of the beam.


Brief description – lower part, the IR emitter driver:
This part of the circuit uses one half of a 324 quad opamp – IC1D is running as an oscillator, and IC1C, as a current regulator for the IR emitter, a Fairchild QED233 (940 nm, 40 degrees emission angle, 1.5 A peak forward current). R11 is the current sensing resistor – a BUZ11 is used as a driver. The QED233 is attached to JP1-1 (cathode) and JP1-2 (anode). R12 and C7 de-couple the IR emitter supply, to avoid interference with the receiver circuit.

The upper part, the IR receiver: active element is a Fairchild QSD124 phototransitor (narrow angle, 24 degrees, IR diode with daylight filter), attached to JP1-5 (collector) and JP1-6 (emitter).
The phototransitor output first passes through a high-pass filter, R6/C3, and then through a rectifier, D1. The resulting signal is then low-pass filtered to remove the ripple (R8 added to reduce noise/oscillations), and amplified (IC1A). IC1B does some further clean-up, and provide a nice drive signal for the other circuits. R1 really serves no function other than being a handy test point for troubleshooting.

The coil, the circuits

Others have explained at length the theorical background of magnetic leviation, and the associated regulator maths. I don’t want to get into this here – feel free to ask, I will explain it to you.

The goal: an apparatus that can hold a sphere of at least 1 kg mass (about 60 mm diameter, 2 1/2″) suspended from the pole of the magnet, in a distance of at last 25 mm/1″. It should be adjustable to hold also other parts, and not restricted to magnets (many of the available hobbyist leviation circuits can only hold magnets).

With the goal set, and after some calculations, related to electric magnet, heat dissipation, allowable maximum temperature for free air operation, time constants – the coil: about 10 kg of copper, of roughly 3 mm diameter wire. I selected a high-temperature type W210 isolated copper wire, this will withstand long term use even if the coil is operated permanently at full current. Don’t worry about the space the 10 kg will take, copper is very dense… Winding it can be a bit tough, as always, ask a friend for help, and best wind it with the help of a lathe (by manually turning it), or some other makeshift fixture. Winding it free-hand is not a good choice, because you won’t get a nice and tight coil.


For the circuits, these were build in modular style:

(1) The position detector – based on an infrared LED, and infrared photodiode, and fully independent of the lighting conditions. Is uses a modulated emitter, and a frequency-selective detector. It needs to have a reasonably fast response, and low noise/drift, otherwise, the regulation loop will be unstable – the sphere will start oscillating, and drop off.

(2) The position regulator – this is a classical PID regulator, build using a few TL074 opams. It compares the position setpoint and acutal position (from position detector, item 1), and determines the current needed to hold the sphere stable (current setpoint signal).

(3) The current regulator – this circuit converts the current setpoint signal into a drive current for the coil. To avoid undue powder dissipation in the regulator, this is achieved use a classic TL494 PWM regulation scheme. There is also a current limiting circuit, build-in, with a 0.050 Ohm 4-lead sense resistor in the coil current loop, and an AD620 instrumentation amplifier.

(4) Some auxilliary circuits – to switch off the magnets by disabling the current regulator, if there is no object attached. Otherwise, the magnet would run at full current, if the sphere drops off, and dissipate a low of heat for no good reason. Some power supply circuits – to provide 12 V power for the regulators, and unregulated 35 V to drive the magnet.

Magnetic Levitation – revisited!

There are some standard project around that more or less every electronics enthusiast will engage in, and one of these is a magentic levitation device. Don’t get me wrong, standard doesn’t mean boring. This class of project has certain characteristics that just make them very suitable for the hobbyist:

(1) They don’t need a lot of fancy equipment or parts to start with, can be build (mostly) from some electronics scrap.

(2) They offer a good combination of theory and practical circuit design. Beginners should be able to get it going, even if they don’t fully understand how it works.

(3) The effect should be striking, not just a blinking light, but something a bit more exciting. Noise, sparks, etc., or special visual effect – here, for the levitator, nothing less than the electronic compensation of the ubiquitous gravitational force.

Why revisited? Well, a long story – my first magnetic levitation device dates back to 1992, which was not much more than a few transistors, resistors, and capacitors (picture to come).

The basic circuit – which I modified a bit, using an infrared LED, a phototransistor, and some tuning of the capacitor/resistance values to make it work better with the given magnet:
Source: Hobby-Schaltungen : für d. Anfang ganz einfache Elektronik-Schaltungen mit geringem Materialaufwand.
Schreiber, Herrmann
München : Franzis, 1984.

As basic as the circuit were its capabilities – it could hold only very light objects, say, a few grams. Nothing substantial.
It still was enough to attract some attention at a German young scientist competition, Jugend Forscht.

At the same time, I discovered an exhibit at the “Deutsches Museum” in Munich, which is unfortunately no longer at its place, and this was a much bigger machine, dating to the 1960s, with serious thyristors, and a huge coil, that could hold something like a 50 mm/2″ massive steel sphere at several cm distance.
This was something that was very intriguing, but at the time, I didn’t have the means to replicate such a device. I figured that is should be much easier now than in the 60s, with all kind of semiconductors around – but still there was a need for a massive electric magnet, and a few more parts than just the regular circuits that can be found around the web.

Terminations: 50 Ohm, +-1%

Proper termination of all high frequency transmissions lines is critical; unless you want to get some signals reflected, which is not the topic of this little post. For most of the items we deal with, systems are operated at 50 Ohm characteristic impedance, at least when it comes to instrument-to-instrument and sub-system/module connnections, and GHz frequencies.

There are many types of terminations around, from all reputable corporation manufacturing RF parts. Here, we want to look at 5 devices:

(1) Huber+Suhner, Switzerland, N-type termination, rated to 6 GHz – specified maximum SWR: 1.05@1 GHz, 1.1@4 GHz, 1.2@6 GHz

(2) Midwest Microwave, USA, N-type termination Model 2070, rated to 18 GHz – specified maximum SWR: 1.25 up to 18 GHz

(3) Aeroflex, USA, N-type 6 dB attenuator AH-06N, rated to 18 GHz – SWR 1.35 to 12.4 GHz, SWR 1.5 to 18 GHz

(4) and (5) No-name BNC 50 Ohm termination, labeled “+-1%”, connected to the test system with a reasonable quality N to BNC adapter, the two terminations are of the same kind, just two samples to check part-to-part variability

The warriors: Left to right-items 1 to 5

The test setup: Micro-Tel SG-811 Signal Source, Micro-Tel 1295 Precision Attenuation Measurement Receiver, Narda Precision High Directivity Bridge Model 5082, Narda APC-7 to N adapters.

The test procedure: At each frequency, full reflection (open) is used to set the “0 dB” level. Return loss can then be measured directly as attenuation of the reflected signal, when the termination is attached to the test port. To determine the error limits of the SWR measurement, the directivity is known, the insertion loss of the bridge has been measured, and the attenuation measurement error itself (by the Micro-Tel 1295) is negligible.

140827 swr of various terminations d0
140827 terminations data

SWR vs. frequency, all terminations
140827 terminations1

There are clearly two groups, the terminations made for GHz service, and the others – BNC, items (4) and (5), that were not. Interestingly enough, at 6 GHz, these terminations are more or less ideal, with SWR close to 1. So you can use these at exactly 6 GHz, and integer-multiples of 6 GHz, but still, I would suggest not to. They are also working great at DC, because of their “+-1%” accuracy which is mentioned on the label.

SWR vs. frequency, only the items (1) through (3)
140827 terminations2

A closer look at the real performers – the Huber+Suhner, although only specified to 6 GHz is working well within its SWR max. 1.2@6 GHz specification, even considering the error limits of this measurement, and can be used up to 12 GHz, no problem.
The Midwest Microwave 2070 – I like this model very much, because of the rugged stainless steel construction (nothing gold-plated and fancy; you can get these for a few dollars, from surplus). It is way better than specified (SWR max. 1.25, measured: 1.12) – and, at 18 GHz, within the limits of the HPAK 909F Precision Coaxial Termination, intended as calibration standard, and listed for close to 1 k$.

A little hint – how to distinguish really high frequency N-type parts (18 GHz), from regular, say, several GHz (below 12 GHz) parts: the shield of the “precision” N-type connector is a non-slotted (see picture-right termination), where as the regular N connectors have a slotted shield, typically, 4 slots (see picture-left termination):