Abstract Introduction: Transcranial magnetic stimulation (TMS) protocols are associated with specific combinations of stimulation parameters, including the location of the targeted site, E-field intensity and orientation, pulse shape and duration, variable/fixed inter-pulse interval (IPI), and coil shape and dimension. Among these parameters, IPI may significantly affect the direction of induced neuroplasticity and the possible interference of habituation and expectation effects with TMS-evoked potentials. The TMS units are not always flexible enough to generate customized pulse sequences, thus external devices/software are commonly used. To remotely handle the randomization of IPI, we designed an effective and cheap device (ArTGen – Arduino Uno-based Trigger Generator) for generating arbitrary sequences of square-wave digital pulses. Materials and methods: Using an external foot-switch pedal the TMS experimenter is able to handle the ArTGen’s firmware to remotely drive a customized sequence of pulses in the TMS unit. We designed the firmware to switch among four conditions (single pulse, sequence of jittered pulses, pause and stop) based on a single and double foot-switch taping. We used two BNC sockets to manage respectively the foot-switch signal and the randomized TTLs in output to ArTGen. We tested ArTGen on Magstim Rapid2 with AirFilm® figure-8 coil in tasks with the following characteristics: (i) %Maximal Stimulation Output at 50%; (ii) 100 pulses and (iii) central pulse frequencies set to either 0.1, 5, 10, 15, or 20 Hz. Results: Our results show that all the TTLs released by ArTGen were correctly detected by Magstim Rapid2, and highlight a short delay (computed as the difference between the Arduino trigger and the Magstim Rapid2 output) of about 5μsec across all pulse frequencies. Conclusion: ArTGen is a stand-alone, portable, and not cumbersome opensource device used to randomize TMS pulses or to trigger/synchronize different devices in a closed-loop TMS system with microseconds of accuracy. Keywords: TMS unit, Arduino board, Inter Pulse Interval randomization, Closed Loop TMS System Synchronization