Low-cost open-source monophasic transcranial magnetic stimulator

Published: 22 August 2026| Version 2 | DOI: 10.17632/gb8tgtfk3c.2
Contributors:
,
,
,

Description

This repository contains the design and validation materials for a low-cost monophasic transcranial magnetic stimulation (TMS) stimulator. As of July 2027, the bill of materials (BOM) runs at USD 657.34. The repository includes the electrical design, controller firmware, and terminal control interface, fabrication files, LTspice simulations, raw magnetic-field measurements, and analysis code to characterize the system. CAUTION This system contains a high-energy capacitor bank and generates high voltages and strong, rapidly changing magnetic fields. Contact with the system can cause severe injury or death, and stored energy can remain after charging is halted. Never rely on the computer interface or firmware as the primary safety mechanism. Work must be performed by trained personnel. Do not connect this research prototype to a person or animal. System overview: The design separates the build into three voltage domains: control domain, power domain, and high voltage domain. The domains are isolated from each other. The Arduino lives in the control domain and sends signals to the other two domains to control charging and discharging. See the complete schematics/tms_schematic.pdf for a more detailed understanding of the circuit. Repository contents: 2d_models/ -- FreeCAD, SVG, PDF, and PNG fabrication drawings for the coil windings and busbars 3d_models/ -- FreeCAD sources and printable STL files for the coil winder and pickup coil helpers controller_arduino/ -- Arduino UNO R4 Minima firmware and the Python terminal user interface data_processing/ -- Raw oscilloscope captures, acquisition scripts, data analysis notebooks, SimNIBS helpers, and generated figures figures/ -- Build, software-interface, and validation figures used in this README schematics/ -- KiCad project, hierarchical schematics, and a three-page PDF export simulations/ -- LTspice models for the charger, discharge path, gate driver, and IL300 linear optocoupler Safety_Checklists.pdf -- Project-specific inspection, pre-charge, and de-energization checklists TMS_field_grid.pdf -- Coordinate grids used for magnetic-field measurements requirements.txt -- Pinned Python analysis environment Editable source files are included wherever possible. The PDF, SVG, STL, and PNG files are provided as convenient exports.

Files

Steps to reproduce

The data used in our analyses is provided under data_processing/waveforms. The MagVenture* components correspond to the data collected from the MRI-B91 MagVenture coil with the MagVenture MagPro X100 TMS. The other components correspond to the homemade coil under 24V and 1480V capacitor charges. Magnetic-field grid acquisition: data_processing/collect_grid.py automates oscilloscope captures at each location of a pre-programmed field-measurement grid. Before use: 1. Replace the VISA resource string with the identifier reported for the oscilloscope; 2. Select the measured field component; 3. Set `start_row` and `start_col` if resuming an interrupted acquisition; and 4. Confirm the oscilloscope channel, vertical scale, offset, sample rate, and binary-waveform format. Each capture is stored as a CSV file with `Time (s)` and `Voltage (V)` columns. Use [`TMS_field_grid.pdf`](TMS_field_grid.pdf) to help position your pickup coil. Deriving coil change of current: data_processing/derive_didt.ipynb: 1. Loads capacitor and three-axis pickup-coil waveforms; 2. Filters and maps the measured peak voltages; 3. Converts the measurements to empirical dB/dt maps; 4. Computes corresponding maps from a discretized figure-of-eight coil model; and 5. Estimates coil dI/dt by a global least-squares fit. Change `user_local_dir` at the beginning of the notebook before running it. Select `homemade_coil` and `low_voltage` to match the dataset being analyzed. Other workflows: - data_processing/plot_gate_pulses.ipynb compares the microcontroller and gate-resistor pulses and estimates the gate current rise rate. It expects local files under waveforms/gate_component/. - data_processing/create_simple_figure_of_8_coil.py creates the line-segment TMS coil model used by SimNIBS. - data_processing/plot_simnibs.py renders a SimNIBS mesh using PyVista. Replace the placeholder `msh_path` before running it. Safety documentation and limitations: Read Safety_Checklists.pdf before inspecting or operating the physical system. These checklists document the procedures used for this prototype, but they are not a substitute for a complete, site-specific risk assessment or formal training.

Institutions

Categories

Electrical Engineering, Neuroscience, Hardware System, Transcranial Magnetic Stimulation

Licence