*Article* **MEDUSA: A Low-Cost, 16-Channel Neuromodulation Platform with Arbitrary Waveform Generation**

#### **Fnu Tala and Benjamin C. Johnson \***

Department of Electrical and Computer Engineering, College of Engineering, Boise State University, 1910 W University Dr, Boise, ID 83706, USA; fnutala@u.boisestate.edu

**\*** Correspondence: bcjohnson@boisestate.edu; Tel.: +1-208-426-3842

Received: 17 March 2020; Accepted: 7 May 2020; Published: 15 May 2020

**Abstract:** Neural stimulation systems are used to modulate electrically excitable tissue to interrogate neural circuit function or provide therapeutic benefit. Conventional stimulation systems are expensive and limited in functionality to standard stimulation waveforms, and they are bad for high frequency stimulation. We present MEDUSA, a system that enables new research applications that can leverage multi-channel, arbitrary stimulation waveforms. MEDUSA is low cost and uses commercially available components for widespread adoption. MEDUSA is comprised of a PC interface, an FPGA for precise timing control, and eight bipolar current sources that can each address up to 16 electrodes. The current sources have a resolution of 15.3 nA and can provide ±5 mA with ±5 V compliance. We demonstrate charge-balancing techniques in vitro using a custom microelectrode. An in vivo strength-duration curve for earthworm nerve activation is also constructed using MEDUSA. MEDUSA is a multi-functional neuroscience research tool for electroplating microelectrodes, performing electrical impedance spectroscopy, and examining novel neural stimulation protocols.

**Keywords:** neuromodulation; multi-channel; stimulation protocol; FPGA

#### **1. Introduction**

Electrical stimulation is a broadly applied technique in neuroscience research and bioelectronic clinical therapies. Direct electrical stimulation of peripheral nerves has been shown to modulate physiological functions such as blood pressure [1] and rheumatoid arthritis [2]. In the central nervous system, electrical stimulation has been used to treat chronic pain via spinal cord stimulation [3] and alleviate the symptoms of Parkinson's disease with deep-brain stimulation [4]. Most neuromodulation is performed with charge-balanced, rectangular biphasic pulses [5] or monophasic pulses with passive recharge in order to conserve energy in an implanted device [6]. However, conventional electrical stimulation through a microelectrode has the highest current density at the electrode-tissue interface, meaning neural activation is maximized at the interface. Therefore, recent work has focused on utilizing novel stimulation waveforms to focalize electrical stimulus deeper in tissue away from the electrode interface. One proposed method is to use temporally interfering sinusoids with a small frequency offset (e.g., 10 Hz) and relatively high carrier frequency (≥1 kHz) so as to not excite tissue near the electrode interface [7]. Prior work has shown cell firing entrained to the low offset frequency deep into tissue where the sinusoids interfere. Relatedly, another method is to use multiple intersectional short pulses from several electrode pairs to focus the stimulus [8]. This technique relies on the stimulus-duration relationship of excitable cells and many time-offset electrode pairs, where the targeted cell will integrate several subthreshold stimulation pulses. Novel stimulation paradigms also look to maximum stimulation efficiency to minimize energy dissipated by implantable devices. Overall, stimulation efficiency is the product of the efficiency of the electronics and how effective the stimulation waveform is at inducing the desired physiological response. For example, exponential

waveforms are less energy efficient than rectangular waveforms in activating neurons and axons, but systems with exponential waveforms may be more efficient overall due to the way they can be generated with electronics [9].

While many ASIC implementations boast a powerful stimulation feature set [10–13], they are not widely available for low-cost neuroscience research. Since kilohertz stimulation frequencies have only recently garnered more interest, conventional neuromodulation equipment is not suitable for high frequency stimulation [14]. Furthermore, expensive benchtop equipment makes multi-channel or highly parallelized experiments impractical. As such, there is growing interest and research need in creating low-cost neuromodulation hardware [13,15]. In this work, we present MEDUSA, a low-cost platform capable of generating arbitrary, current-controlled stimulus waveforms. The platform can create high-resolution (<16 nA) currents of ±5 mA with ±5 V compliance. Additionally, the sinusoidal stimulus can be used for electrical impedance spectroscopy [16,17] or kilohertz frequency nerve block. This paper describes the architecture and characterization of the implemented system.

#### **2. Materials and Methods**

#### *2.1. MEDUSA System Architecture*

The implemented system architecture and system components are shown in Figure 1. MEDUSA was comprised of an FPGA/USB interface (XEM6010, Opal Kelly, Portland, OR, USA), an 8-channel, 16-bit DAC (DAC81408, Texas Instruments, Dallas, TX, USA), 8 voltage-controlled bipolar current sources that can address 16 channels through a 16:1 multiplexer, and a shorting switch for each channel. Users could configure stimulation waveform parameters through a Python interface on the PC. The settings were transferred via USB, and precise stimulation timing control was facilitated by the FPGA. The FPGA communicated with the DAC via SPI (serial peripheral interface) operating at 24 MHz and an asynchronous trigger signal (DAC\_TRIG) that updated the DAC outputs. The grounding switches, controlled by the FPGA, could be used as a current return or used to clear residual charge from the electrode interface after stimulation. The multiplexers and grounding switches were selected for low leakage currents (<10 nA) and suitable low on-resistance (250–300 Ω).

#### *2.2. Bipolar Current Source*

The voltage-controlled bipolar current sources in Figure 2 used an amplifier with auxiliary differential inputs (LT6552, Linear Technology, Milpitas, CA, USA), and either current source was able to sink or source current. The auxiliary input was used in a feedback loop to force the equivalent voltage of *VDAC* across the output resistor *RGAIN*. Therefore, in order to balance the current sinking and sourcing, the input voltage *VDAC*<sup>1</sup> and *VDAC*<sup>2</sup> must be differential. The resulting output current for each channel is given as:

$$I\_{\rm DAC} = V\_{\rm DAC1} / R\_{\rm GAIN1} = -V\_{\rm DAC2} / R\_{\rm GAIN2} \tag{1}$$

where *RGAIN*<*X*<sup>&</sup>gt; was switchable for each current source to 100 Ω,1kΩ, or 10 kΩ and was chosen on resolution and dynamic range requirements.

**Figure 1.** (**a**) System architecture and (**b**) implemented system.

Since the amplifier output could swing rail-to-rail (±5 V) and source or sink 70 mA, the maximum current output was limited by the input common-mode of the auxiliary amplifier input (VSS to VDD − 1.4 V). The amplifier could use an asymmetric supply (VSS = −5 V, VDD = 7 V) to extend the voltage compliance range at the expense of current source linearity. The total voltage supply required for an anodic stimulation pulse could be calculated to be:

$$VDD\_{MIN} \approx I\_{DAC} \cdot \left(R\_{GAIN} + R\_S + R\_{MILX} + T\_P/\mathcal{C}\_I\right) + 1.4\text{ V} \tag{2}$$

where *RS* is the spread resistance of the electrode, *RMUX* is the on-resistance of the multiplexer (≈100 Ω), *TP* is the stimulation pulse width, and *CI* is the interface capacitance of the electrode. The additional 1.4 V of headroom was required by the amplifier for anodic stimulation due to input common mode limitations. Note that this bipolar current source could also be used for unipolar current stimulation, since this system had active grounding switches, so the second electrode could be short to ground and made it unipolar.

**Figure 2.** Bipolar current source architecture.

#### *2.3. Digital Timing Control*

Digital timing for the pulse mode had 6 phases (W1, P1, GP, P2, W2, and ST) in one stimulation cycle (Figure 3a). Each phase had a resolution of 1 μs with 16 bits of range (65,536 μs max) and could be programmed independently. The stimulation frequency (cycle repetition rate) was independent to be set through the wait periods (W1 and W2). Stimulation frequencies lower than 15 Hz were implemented with software control using the Python interface. The DAC was configured using SPI to operate in differential mode prior to the start of digital stimulation cycle. During the first pulse (P1), both multiplexers were enabled to allow current to flow through the electrodes, while for the second pulse (P2), the multiplexer addresses were swapped so the polarity of current flowing was reversed. During the shorting time (ST), the grounding switches were enabled to short the electrodes to ground.

Arbitrary waveform mode used a lookup table to update the output current at pre-defined intervals. The lookup tables were written in the FPGA firmware to ensure high timing precision. Each point from the lookup table was written into DAC using SPI at a minimum delay of 2 μs. Note that the multiplexer control and grounding signals could be controlled simultaneously with an arbitrary waveform. Key specifications for MEDUSA are shown in Table 1.

**Figure 3.** (**a**) Example timing for biphasic, bipolar stimulation and (**b**) the resulting stimulation circuit.


**Table 1.** MEDUSA specifications.

#### **3. Results**

#### *3.1. System Transfer Function*

To validate the transfer function of MEDUSA, we measured the output current for all three gain modes (R*GAIN* = 100 Ω,1kΩ, and 10 kΩ) for current ranges of ±5 mA, ±2 mA, and ±250 μA. The output current was measured using a source meter at 0 V. The output current vs. digital DAC code is shown in Figure 4a, where the digital code was stepped into increments of 1000. To verify the linearity and resolution, we swept 20 codes around the zero-crossing and measured an LSB of 15.3 nA with a DNL of 0.13 LSB over that range (Figure 4b). Typically, such small currents are not biologically relevant for neuromodulation systems; however, microelectrode electroplating current levels can be on the order of 100 nA [18]. Note that the input bias current of the amplifier was roughly 10 μA, but this offset was canceled through DAC calibration.

#### *3.2. Compliance Voltage*

To verify the compliance voltage of the stimulator, we swept the load voltage on the source meter for programmed currents (Figure 5). For anodic stimulation, the current output deviated from its specification by 10% around 3.6 V (VDD − 1.4 V). To ensure 5 V compliance, a VDD of 7 V could be used. Cathodic stimulation, however, was compliant with VSS due to the input common-mode range of the current source amplifier.

#### *3.3. Arbitrary Waveform Generation*

To demonstrate arbitrary waveform generation, we measured the voltage across a 1 kΩ resistive load to ground during stimulation. Figure 6a shows a conventional biphasic waveform with rectangular pulses. All timing and amplitude parameters were configured by the user through the Python interface. The FPGA firmware implemented the timing diagram as shown in Figure 3a to generate the pulses, while the current amplitude for each phase was independently programmed via SPI. Each state of the waveform had a resolution of 1 μs with 16 bits of programmability. The system could also generate arbitrary current stimulation (Figure 6b). In arbitrary waveform mode, the firmware used a lookup table that could be scaled dynamically through the Python interface. The temporal resolution in arbitrary waveform mode was 2 μs, which was limited by the speed at which the DAC could update over SPI. In this mode of operation, the user could customize the scaling factor of the lookup table for both the period and amplitude of the arbitrary waveform.

**Figure 4.** (**a**) Measured transfer function for three gain settings (*RGAIN* = 100 Ω,1kΩ, and 10 kΩ). (**b**) Measured linearity around the transition point for high-precision setting (low-gain mode, 10 kΩ).

**Figure 5.** Measured voltage compliance for (**a**) anodic and (**b**) cathodic stimulation.

MEDUSA can easily achieve high-frequency stimulation (>1 kHz) without issue. The analog bandwidth was more than 2 MHz, so the stimulation frequency in arbitrary waveform mode was only limited by the DAC update speed. Figure 7a,b shows two biphasic stimulation waveforms at 1 kHz and 10 kHz using two types of stimulation methods discussed above. In Figure 7a, the 1 kHz biphasic stimulation was operating under arbitrary waveform mode using a lookup table update, while in Figure 7b, the 10 kHz stimulation used conventional MUX switch mode with DAC output preset at a certain voltage level.

**Figure 6.** (**a**) Pulse width, interphase gap, and amplitude for both positive and negative pulse are customizable and (**b**) arbitrary waveform done using lookup table update.

**Figure 7.** Biphasic stim waveform measured across a 1 kΩ resistive load at (**a**) 1 kHz with 1 mA pulse amplitude and (**b**) 10 kHz with amplitude 0.6 mA.

#### *3.4. Charge-Balancing In Vitro*

To demonstrate charge-balancing using MEDUSA in vitro, we immersed a custom microelectrode array in a saline bath and measured the voltage profile in response to biphasic stimulation. The electrode array was a rigid PCB with 0.5 mm diameter square immersion gold (ENIG) electrodes. A 3D-printed ring defined a well around the electrodes. While these electrodes had poor charge storage capacity relative to conventional stimulation electrodes, such as platinum-iridium, they were an apt test bench for charge-balance due to their nonlinearity during stimulation. As shown in Figure 8a, a balanced biphasic pulse (blue trace, *IDAC* = 275 μA, *P*1 = *P*2 = 26 μs) generated a significant offset voltage mostly due to appreciable charge leakage during the interphase gap (*GP* = 26 μs). Note that the offset voltage would eventually return to zero since one electrode was always at ground. To compensate for charge leakage during the interphase gap, less charge could be injected in the second phase by lowering its amplitude (red trace) or decreasing its duration. However, a practical implementation requires monitoring the offset after each stimulation sequence. For this reason, we implemented a grounding phase (ST) when electrodes could be shorted to ground, clearing any residual charge on the electrodes. To demonstrate the effect of the shorting switch, we added a 10 μs wait time (W2) after the second pulse before enabling the shorting switch (yellow trace).

To confirm that leakage during the interphase gap was the source of the residual voltage offset, we created a Randles circuit model of the electrodes and simulated it with an ideal stimulator (purple trace, Figure 8a). Figure 8b is the Randles circuit model of the electrode-saline interface, and the

biphasic current was injected from the top, illustrated by a current source *IDAC*. The values were determined empirically. During P1, positive current flowed through the electrode-saline interface, and the voltage jumped to *IDAC* · *Rs* (*Rs* is the spread resistance) and started to charge *CI*. During GP, the stimulation current was zero, and the electrode capacitor discharged. During P2, negative current (reverse polarity) flowed through network and discharged the electrode. If zero charge had been lost during GP, the electrode voltage would return to zero as the stimulation phases were perfectly matched. In this case, the lost charge during GP meant a negative offset voltage remained on the electrode. During ST, a shorting switch was enabled to eliminate the voltage offset.

**Figure 8.** (**a**) In vitro measurement results with biphasic simulation pulses and (**b**) Randles circuit model of two series electrodes where *IDAC* = 275 μA, *CI* = 10.4 nF, *RS* = 1.2 kΩ, and *RCT* = 11.2 kΩ.

#### *3.5. Selective Stimulation Protocols*

#### 3.5.1. Temporal Interference

To demonstrate temporal interference [7], we injected two sine-wave currents (Figure 9a,c) at frequencies of 1 kHz and 1.02 kHz into a resistor mesh in Figure 9, which was used as a simplified electrical model for tissue. The sine-wave current was realized by updating DAC alternately with data from two different lookup tables and then sending currents to two channels simultaneously. This 2% difference of the number of points in these two lookup tables was able to create a 20 Hz frequency offset when one of the fast (100-point) sine-waves was operating at 1 kHz. Furthermore, the frequency and amplitude of sine-wave current could be independently configured to meet certain conditions. The current measured in the center resistor was modulated with an envelope frequency of around 20 Hz (Figure 9b), equal to the offset frequency of source currents.

**Figure 9.** (**a**) Modulated current is 20 Hz and (**b**) 1 kHz sine current source and (**c**) 1.02 kHz sine current source.

#### 3.5.2. Intersectional Short Pulse

To demonstrate an intersectional short pulse (ISP) [8] stimulation protocol, we measured the voltages across eight resistive loads with 1 kΩ resistance, and they were connected to the corresponding output channels of the stimulation system. The pulse current amplitude was set to be 1 mA and the pulse width to be 10 μs in Figure 10a. The overall charge accumulated at the theoretical focal point showed a linear increase over time (Figure 10b). The ISP function was implemented by updating the DAC via a single lookup table and switching the MUX address incrementally from Address 0 to 7, so the stimulation current pulses were directed to preassigned output channels.

#### *3.6. Comparison with State-of-the-Art*

To demonstrate MEDUSA's capability for high-frequency neuromodulation, we compared its rise time with a high-end commercial voltage-controlled precision current source (Stanford Research System CS580). For a conventional pulse stimulation, the 10–90% rise times 120 ns and 2.8 μs, respectively, were measured across a 1 kΩ resistive load with a 600 μA current amplitude as shown in Figure 11a. This corresponded to analog bandwidths of 2.9 MHz and 125 kHz. MEDUSA achieved a rapid rise time by switching the multiplexer, allowing for the DAC and current source to settle during the first wait period (W1).

Table 2 shows a comparison of MEDUSA and other commercial or open source neuromodulators. MEDUSA had several key advantages: higher channel count, higher analog bandwidth, and seamless integration with an FPGA for complex waveform generation. Many other current sources required a function generator and a means to input an arbitrary waveform into the function generator, which made scaling to multiple stimulation channels impractical. MEDUSA also had the ability to short the electrodes to ground on command for charge balance to prototype novel in vivo stimulation protocols.

**Figure 10.** (**a**) Intersectional short pulse through eight channels terminated with 1 kΩ load and (**b**) total charge accumulated.

**Figure 11.** The rise time for the MEDUS system and SRS CS580 is 120 ns and 2.8 μs, respectively (**a**), measured acrossa1kΩ resistive load from 10% to 90% of voltage, (**b**) and the 10 kHz stimulation.


 **2.** Overview of neural current stimulators.

**Table**

*Electronics* **2020** , *9*, 812

#### *3.7. In Vivo Results*

To demonstrate MEDUSA as a research platform, we performed a series of in vivo experiments using a common earthworm (Lumbricus terrestris). While no IACUC protocols were required, we ensured humane treatment by anesthetizing the earthworm using a 10% ethanol solution. An overview of the experimental setup is shown in Figure 12. The earthworm was placed dorsal side up, and electrode pins were inserted through the worm, fixing it in place. The stimulation anode was placed 2 cm caudally of clitellum and separated from the cathode by 1 cm. Recording channel R1 was placed 4 cm below the stimulation cathode. The recording reference (REF) was placed in the center between the stimulus cathode and R1 [19,20].

To build a strength-duration curve (Figure 13), we used monophasic current stimulation and swept pulse width and amplitude to determine the action potential threshold for the median giant nerve (MGN). Stimulation frequency was below 0.5 Hz to ensure that the nerve was not fatigued. The MGN showed a rheobase current of 50 μA and a chronaxy of about 400 μs [21].

To verify a response from the lateral giant nerve (LGN), we used a fixed 100 μs monophasic current pulse and increased amplitude starting at 200 μA. Due to its smaller diameter, the LGN had a higher threshold and slower conduction velocity relative to the MGN. Figure 14a shows stimulus amplitudes below the LGN's response threshold, while Figure 14b shows the response for stimulus amplitudes above the threshold. By comparing the delay between recording channels (R1 to R2), we estimated the conduction velocity of the MGN and LGN to be 20.0 m/s and 7.7 m/s, respectively.

**Figure 12.** Earthworm stimulation experiment setup.

**Figure 13.** Strength-duration curve of earthworm median giant nerve (MGN).

**Figure 14.** Nerve spikes in response to monophasic current stimulation of a 100 μs duration recorded from R1 and R2 with amplitude swept from (**a**) 200 to 650 μA and (**b**) 700 μA to 2 mA. Recordings were made using a commercial recording unit Neuron SpikerBox Pro (Backyard Brains, Ann Arbor, MI, USA).

#### **4. Conclusions**

We presented MEDUSA, a low-cost and high-performance 16-channel neural stimulation system built from off-the-shelf components. MEDUSA was intended to be a general purpose neuroscience research tool to explore novel, high-frequency, multi-channel stimulation paradigms. Our future work will migrate MEDUSA's core functionality to a wireless system. However, wireless systems are far more constrained in terms of area and power and require more application-specific design implementations compared to general purpose platforms [12,22–26].

MEDUSA achieved a high dynamic range by combing a 16-bit voltage DAC and three orders of magnitude of gain selection in the current source. The system was capable of delivering monophasic and biphasic stimulation pulses with 1 μs temporal resolution, DC currents, and arbitrary waveforms with a temporal resolution of 2 μs. MEDUSA provides researchers with a low-cost, multi-functional neuroscience research tool for electroplating microelectrodes, performing electrical impedance spectroscopy, and examining novel neural stimulation protocols.

**Author Contributions:** Conceptualization, B.C.J.; circuit board design and assembly, F.T.; python software and FPGA firmware, F.T.; manuscript preparation, B.C.J. and F.T. All authors have read and agreed to the published version of the manuscript.

**Funding:** This work was made possible by an Institutional Development Award (IDeA) from the National Institute of General Medical Sciences of the National Institutes of Health under Grant #P20GM103408.

**Conflicts of Interest:** The authors declare no conflicts of interest.

#### **References**


© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
