Don’t Try This At Home, Transcranial Magnetic Stimulation Edition

Transcranial magnetic stimulation is one of those things that seems too wacky to be true. Depression not responding to treatment? Let’s smack you upside the head with strong magnetic fields! As odd as it sounds, it’s actually very well studied and works often enough that it has been approved by regulatory agencies as real evidence based medicine.

It’s also now open source, thanks to the OpenTMS project by [Zach McGinty]. Though since its not approved by the FDA or your local authority, be very aware of [Zach]’s disclaimer that this is not a medical device and if you do build something based on the extensive data on his GitHub, you do so at your own risk.

He’s got plans for the coils that go next to your head — made of hollow copper pipe to carry coolant, just like the pros do it — and the power supply to pulse them with mind-altering amounts of electricity. That might be literal in this case, but it’s also a hefty power supply: a pair of microwave oven transformers, switched through IGBTs in a flyback configuration. We’re talking kiloamps here, so make sure you know what you’re about before you try putting that kind of power right next to your skull.

[Zach] did, and he’s still here. Though to be fair, we’re not sure if he’s a very good engineer or just very lucky. Given he’s isolated the IGBT gate controls with fiber optics, and seems to follow other best practices, we’re going to guess the former, but it might still be both.

Either way, this one is going firmly into the “don’t try this at home” bucket. Even so we’re happy to see more medicine go open source, be it assistive sip-and-puff pointing devices, or ESP32 electroencephalograms. If nothing else, it keeps the big boys on their toes, and that’s what hacking is all about.

Transcranial Electrical Stimulation With Arduino, Hot Glue

The advance of electronic technology has been closely followed by the medical community over the past 200 years. Cutting edge electronics are used in medical imaging solutions to provide ever greater bandwidth and resolution in applications such as MRI machines, and research to interface with the human nervous system continues at a breakneck pace. The cost of this technology – particuarly in research and development – is incredibly high. Combine this with the high price of the regulatory approvals necessary for devices which deal in terms of life and death, and you’ll find that even basic medical technology is prohibitively expensive. Just ask any diabetic. On the face of things, there’s a moral dilemma. Humanity has developed technologies that can improve quality of life. Yet, due to our own rules and regulations, we cannot afford to readily distribute them.

One example of this is that despite the positive results from many transcranial electrical stimulation (TCS) studies, the devices used are prohibitively expensive, as are treatment regimens for patients. Realising this, [quicksilv3rflash] decided to develop a homebrew, open source transcranial electrical stimualtion device, and published it on Instructables. Yes, that’s the world we’re now living in.

It’s important to publish a warning here: Experimenting with this sort of equipment can easily kill you, fry your brain, or have any number of other awful results. If you don’t have a rock solid understanding of the principles behind seperate grounds, or your soldering is just a little sloppy, you don’t want to go anywhere near this. In particular, this device cannot be powered safely by a wall-wart.

To be honest, we find it difficult to trust any medical device manufactured out of modules sourced from eBay. But as a learning excercise, there is serious value here. Such a project requires mastery of analog design to avoid dangerous currents being passed to the body. The instructions also highlight the importance of rigorously testing the device before ever connecting it to a human body.

The equipment is based around an Arduino Nano receiving commands from a computer over serial, fed by an application written in Python & PyGame. To think, this writer thought he was being bold when he used it to control a remote control car! The Arduino Nano interprets this data and outputs it over SPI to a DAC which outputs a signal which is then amplified and fed to the human brain courtesy of op-amps, boost converters and sponge electrodes. The output of the device is limited to +/-2.1mA by design, in accordance with suggested limits for TCS use.

It should be noted, [quicksilv3rflash] has been experimenting with homebuilt TCS devices for several years now, and has lived to tell the tale. It’s impressive to see a full suite of homebrew, opensource tools being developed in this field. [quicksilv3rflash] reports to have not suffered injuries from the device, and several devices have been shipped to redditors. We’ve only found minimal reports on people receiving these, but nothing on anyone actually using the hardware as intended. If you’ve used one, get in touch in the comments.

It goes without saying – this sort of experimentation is dangerous and the stakes for getting it wrong are ludicrously high. We’ve seen before what happens when medical devices malfunction – things get real ugly, real fast. But hackers will be hackers and if you were wondering if it was possible to build a TCS device for under $100 in parts from eBay, well, yes. Yes it is.