How We Built an X-Ray Machine

A homemade 100 kV supply, two tubes, and a glowing screen.

January 10, 20265 min read

After the , the same group of friends built an X-ray machine in the fall of 2025. We made a doc again (that was useful with the coil) and split the build into modules: high voltage supply, filament supply, tube, shielding, camera and controls. Build log, not a guide!

Safety First

We needed to read more to have high confidence in this, but so far it seems like the electrical stuff remains the primary danger if you stick to a small X-ray tube + short exposure times, and we learned some of it the hard way. A good list of safety things to keep in mind:

  • Capacitors remaining charged after power off, at around 100 kV. From one of us, after touching part of the wiring after powering it off: "felt identical to a higher-end static shock."
  • Standing in the beam. Don't. Distance and lead between you and the tube. We tested our shielding with the Geiger counter (more on that below).
  • Legal stuff. In the US most states require X-ray producing equipment to be registered with the state's radiation control program. Check yours before building one.

How It Works

  1. X-ray tube: a vacuum tube, heated filament (the cathode) at one end, metal target (the anode) at the other
  2. High positive voltage on the anode → pulls electrons off the hot filament and slams them into the target, and some of their energy comes out as X-rays
  3. Filament temperature → how many electrons leave it (so filament current controls tube current). Anode voltage → how energetic the X-rays are
  4. X-rays that make it through the subject hit a phosphor screen, which glows where they land, and a camera photographs the screen

The High Voltage Supply

The "canonical" hobby X-ray supply: a 24 V DC supply → a zero voltage switching (ZVS) driver, for high frequency AC → a step-up transformer → a Cockcroft-Walton voltage multiplier, which is a ladder of capacitors and diodes that turns AC into a much higher DC voltage.

  • 60 Hz, like the Tesla coil's NST: the multiplier's capacitors would have to be enormous to hold the voltage up under load
  • ZVS driver: tens of kilohertz, so much smaller capacitors

We started with an off-the-shelf ZVS driver board and a flyback transformer salvaged from a CRT TV. After one session it got worse instead of outright not working, and our best guess is we burned out the flyback (or overheated the ZVS MOSFETs). Rewatching Hyperspace Pirate's build, we found the ferrite cores he used, and they were on Amazon, 5 for $20. So the replacement transformer is wound on UY16 ferrite cores, with a 750 turn secondary on a 3D printed bobbin, using the same jig as the Tesla coil's secondary. It only worked once the two halves of the primary were wound in the right direction relative to each other.

The first 24 V supply died while testing the multiplier. Its replacement, a , has a trimmer to set the output voltage and documented ports for remote on/off, so the voltage can be dialed down for early tests.

No high voltage probe, so we measured how far its spark could jump, with a rough rule of about 3 kV per millimeter. About 33 mm, so roughly 100 kV with no load.

  • Arcing in the oil: a bad solder joint. Ran reliably once that was fixed.
  • At these voltages the multiplier arcs to whatever is nearby. Large plastic discs helped with insulation.

The Filament Supply

  • DC-DC buck converter, adjusted with a PWM circuit built around a 555 timer
  • Needs fine control, since a small change in filament current makes a big change in tube current
  • More filament current also loads the high voltage supply, which pulls its voltage down

The Tubes

First tube: small, rated for 70 kV.

  • First transformer: radiation (the Geiger counter read it clearly, and a camera pointed at the beam picked it up as specks of "snow"), but no glow from the phosphor screen. The supply couldn't push enough power through the tube.
  • Second transformer, wound with thicker wire: the whole screen glowed, anywhere from 35 cm to 100 cm from the tube.

Second tube: rated for 160 kV, which opens up thicker subjects. It was sold as a Lohmann type and is probably a copy, so its ratings are a guess from the original's product page. Radiation on its first run, and it lit the screen the next day.

Shielding

  • Collimator. A single piece of lead wrapped around the tube, with one hole for the beam and a slot for swapping apertures. Beam: a 70 mm circle at 200 mm, a cone of about 20 degrees. Sized the collimator so it wouldn't cut into that.
  • Filter. Aluminum over the aperture. It's supposed to absorb weaker X-rays but leave stronger ones untouched. Weaker X-rays don't penetrate as far and so pollute images, and less useless X-ray exposure for e.g. someone's knee is probably a good thing.
  • Lead sheet. 1/16 inch, about 1.6 mm. Ours measured ~1.59 mm with some variation, which should be thick enough, and we have plenty to double up. Cut with heavy tin snips and handled in nitrile gloves.
  • Oil. The tube sits in mineral oil inside an acrylic tube, 34 mm inside and 38 mm outside, for insulation and cooling. Roughly: 0-30 mm X-ray tube, 30-34 mm oil, 34-38 mm acrylic, then lead and printed mounts outside that.
  • Distance. For testing: tube on the far side of a brick wall. Behind the wall, the Geiger counter read background.

Camera and Controls

The screen is a DuPont Quanta Fast Detail intensifying screen, the kind dental and medical offices sell as surplus. A DSLR photographs it, controlled from a Raspberry Pi with gphoto2. That part was surprisingly easy: plug in the camera, turn it on, install gphoto2, and you can take photos from the command line.

  • Mirrors. Keep the camera out of the beam, since cameras hit by X-rays get grainy. One works. Two as a periscope both redirect and correct the angle distortion.
  • Pi. Switches the supply on and takes the photo.
  • Interlock. The plan is a physical one wired in series that has to be engaged before the Pi can energize anything.

Two lessons so far:

  • Interference. While the supply was on, its electrical noise stopped the Pi from talking to the camera. Moving them a little further away fixed it.
  • Switching. A relay on the mains side: fine at turning the supply on, bad at turning it off. Stressful during a run with large arcs and a small fire. Next time we'll switch it at the ZVS driver, with a transistor and a soft start.

Where It Stands

The screen glows and the camera captures it, all from a laptop at a safe distance. The vision is to hit a button and have the Pi energize the high voltage and filament circuits, wait for them to "come up", then take a photo. Next up is the enclosure and the first real image.

Further Reading