<<

Modular Device for Wireless Optically Controlled Neuromodulation in Free Behaving Models by Joanna Sands B.S., Massachusetts Institute of Technology (2019) Submitted to the Department of Electrical Engineering and Computer Science in partial fulfillment of the requirements for the degree of Master of Engineering in Electrical Engineering and Computer Science at the MASSACHUSETTS INSTITUTE OF TECHNOLOGY September 2020 ○c Massachusetts Institute of Technology 2020. All rights reserved.

Author...... Department of Electrical Engineering and Computer Science August 14,2020

Certified by...... Anantha Chandrakasan Professor Thesis Supervisor

Accepted by ...... Katrina LaCurts Chair, Master of Engineering Thesis Committee 2 Modular Device for Wireless Optically Controlled Neuromodulation in Free Behaving Models by Joanna Sands

Submitted to the Department of Electrical Engineering and Computer Science on August 14,2020, in partial fulfillment of the requirements for the degree of Master of Engineering in Electrical Engineering and Computer Science

Abstract This work presents a modular, -weight head- borne neuromodulation platform that achieves low-power wireless neuromodulation and allows real-time programma- bility of the stimulation parameters such as the frequency, duty cycle, and intensity. This platform is comprised of two parts: the main device and the optional inten- sity module. The main device is functional independently, however, the intensity control module can be introduced on demand. The stimulation is achieved through the use of energy-efficient 휇LEDs directly integrated in the custom-drawn fiber-based probes. Our platform can control up to 4 devices simultaneously and each device can control multiple LEDs in a given subject. Using the multiple LED channels, the platform can also be used to recording in-vivo temperatures to prevent damage to the couple neuron. Our hardware uses off-the-shelf components and has a plug and play structure, which allows for fast turn-over time and eliminates the need for com- plex . The rechargeable, battery-powered wireless platform uses Bluetooth Low Energy (BLE) and is capable of providing stable power and communication re- gardless of orientation. This presents a potential advantage over the battery-free, fully implantable systems that rely on , which is typically direction-dependent, requires sophisticated implantation surgeries, and demands com- plex custom-built experimental apparatuses. Although the battery life is limited to several hours, this is sufficient to complete the majority of behavioral neuroscience experiments. Our platform consumes an average power of 0.5 mW, has a battery life of 12 hours.

Thesis Supervisor: Anantha Chandrakasan Title: Professor

3 4 Acknowledgments

As this chapter of my life comes to an end, I am so thankful for everyone I met who helped me through these 5 years of MIT. I give all of my thanks to my advisor, Anantha Chandrakasan, for all of his ideas, guidance, and feedback for this project and all other pursuits I’ve attempted during my 18 months in the lab. I’m also so thankful to Sirma Orguc. She was a great research mentor and partner who put countless hours into working with me and others to see these projects through. I’m so happy that we were able to meet and work together, without her I have no idea what I’d have done this year. I also want to thank Anantha Group as a whole for all of their help with circuits, equipment, and staying sane during the late nights in lab, especially Preet, Mohamed, and Vipasha. I really appreciate the coffee breaks we’ve had both pre-COVID and post-COVID and hope we can continue them long into the future! I’m thankful for Polina Anikeeva and Atharva Sahasrabudhe who helped ground this project with in-vivo tests and experimental goals. I want to thank the staff and students of 6.002 (both Fall and Spring) for makingmy teaching experience feel so meaningful and fun. I also want to thank my housemates who put up with my late-night tests on the equipment I brought home during the ramp down as well as my other friends would happily listen to all of my design issues despite not knowing anything about either circuits or . Finally, I want to thank my family for all of the support I’ve received. I’m so grateful for my parents’ willingness to listen and give support despite being hundreds of miles away and for my sister’s constant presence through our time together at MIT.

5 6 Contents

1 Introduction 13 1.1 Contributions ...... 14 1.2 Outline ...... 14

2 Literature Review 17 2.1 Methods of Optical Stimulation ...... 17 2.1.1 -Sourced Stimulation ...... 18 2.1.2 LED-Sourced Stimulation ...... 18 2.2 Methods of Powering Non-tethered Implantable Devices ...... 19 2.3 Wireless Communication with Implanted Devices ...... 19 2.4 In-Vivo Temperature Sensing ...... 20

3 System Overview 23 3.1 The Physical System ...... 23 3.2 The Software System ...... 24

4 Hardware Implementation 27 4.1 Experimental Considerations ...... 27 4.2 Base Module Implementation ...... 29 4.3 Optional Intensity Control ...... 30 4.4 In-Vivo Temperature Sensing ...... 31 4.4.1 Gain Constraints ...... 33 4.4.2 Gain Calculations ...... 34

7 5 Software Implementation 35 5.1 Stimulation Control ...... 35 5.2 Communication Protocol ...... 36 5.2.1 Data Rate, Power and Latency Considerations ...... 37 5.3 User Interface Design ...... 37

6 Results and Evaluation 39 6.1 Waveforms and Stimulation ...... 39 6.2 Temperature Sensing ...... 41 6.3 Power Consumption and Battery Performance ...... 43

7 Conclusion and Future Work 49 7.1 Future Work ...... 50

A Tables 51

B Figures 53

8 List of Figures

2-1 Example Temperature Sensing System ...... 21

3-1 System Components ...... 24 3-2 System Block Diagram ...... 25

4-1 Module Hardware ...... 28 4-2 Temperature Circuit Block Diagram ...... 31 4-3 Probe Current based on Temperature ...... 32

5-1 Example User Interface ...... 38

6-1 Example Stimulation Waveforms ...... 40 6-2 Intensity Control Diagram ...... 40 6-3 Stimulation Results ...... 41 6-4 Real Time Temperature Recordings ...... 42 6-5 Temperature Recordings ...... 42 6-6 Input Current ...... 44 6-7 Battery Behavior ...... 44 6-8 Input Current ...... 46

B-1 Additional Input Current Waveforms ...... 53

9 10 List of Tables

A.1 Explanation for each parameter in the stimulation control message . . 51 A.2 Average Current for Available Cofigurations ...... 52

11 12 Chapter 1

Introduction

In modern research, studies of the brain and the nervous system often rely on the controlled perturbation of neural behavior in order to better understand the function of individual components [21]. Optogenetics is a technique in which light-sensitive proteins, produced in genetically modified neurons, are exposed to light in order to either promote or inhibit certain neural responses [21]. For the previously mentioned studies, this technique has advantages over classical neuromodulation techniques, such as electrical stimulation, due to the cell type specificity, low electrical disturbance and high temporal resolution [11].

For some types of stimulation, like laser-based systems, the model must be teth- ered to an external system, which can affect the behavior of the model and limit the freedom of movement [11]. The use of energy-efficient 휇LEDs can allow for use of optogenetics alongside wireless devices for tether free behavioral monitoring.

The system presented in this work is a head-borne device for optical neuromod- ulation in free behaving mice models. It is made with the goal of being modified to account for variation in the stimulation scenario and to support the additional func- tionalities without requiring changes to the entire system. With this focus in mind, the resulting device requires only one external component, has a simple fabrication scheme, weighs less than 2 grams, and is 14mm in diameter. It can also support intensity control, multiple LED control, and real-time in-vivo temperature recording.

13 1.1 Contributions

For this work, a platform for performing wireless optically stimulated neuromodu- lation was developed and tested in full collaboration with Sirma Orguc as well as Atharva Sahasrabudhe, a member of the Bioelectronics Group at MIT. Probe de- sign, creation and implantation as well as all in-vivo measurements were handled by Atharva. All hardware work was done in close collaboration with Sirma. This platform required the creation of four distinct components. The soft, flexible probes containing 휇LEDs were desgined by Atharba Sahasrabudhe. Three stack- able custom PCBs were designed in partnership with Sirma Orguc, one prototype for basic operation, one prototype for temperature sensing operation and an addi- tional intensity module. Additionally, firmware code was developed to run onthe PCB’s embedded microcontroller to handle the creation of stimulation waveforms and communication with other devices. Another file of code was written for the re- ceiving device to act as a BLE-UART adapter. Finally, a MATLAB user interface was designed to allow users to easily send and receive data. This thesis contributes:

∙ A BLE-enabled battery-powered device capable of connecting to pre-implanted probes containing 휇LEDs for both stimulation and temperature recording.

∙ An optional module for the aforementioned device for intensity control

∙ A MATLAB User Interface for sending and receiving data over UART

1.2 Outline

Chapter 1 outlines the motivation and contributions made in this work. Chapter 2 contains a review of relevant literature and an exploration of various tech- niques used in creating devices for neuromodulation. Chapter 3 is an overview of the goals of the system and a discussion of the interaction of the different components.

14 Chapter 4 details the implementation of the hardware components of the system, starting with the needs of the initial prototype and moving into the additional func- tionalities. Chapter 5 describes the implementation of the software components including the microcontroller firmware and the user interface. Chapter 6 presents the results characterizing the performance of the prototypes and evaluates them. Chapter 7 reviews what was presented in this work and suggests future extensions of the platform.

15 16 Chapter 2

Literature Review

Neuromodulation is the practice of altering neural behavior through the introduction of a stimulus. Devices using neuromodulation have had success in treating diseases affecting numerous parts of the body by stimulating cells within the affected regions [10]. Traditionally, these stimuli have been electrical, chemical or magnetic in nature, with the level of invasiveness and overall effect of the stimulation varying by procedure. As such, various devices and commercial products exist for delivering stimulation in these forms. For the purpose of differentiating this work from previous devices in the field,we will be focusing on the state of the art devices focusing on optogenetic stimulation. Compared to the previously mentioned methods of stimulation, optogenetics is a relatively more recent practice of genetically modifying cells to express proteins that cause sensitivity to light. By exposing these cells to bright visible light, researchers can activate or inhibit processes within these cells [21]. Compared to the previously mentioned methods, optogenetics offers the advantages of targeting specific cell types as well as allowing more precision in the triggering and duration of the stimulation[11].

2.1 Methods of Optical Stimulation

Visible light for optogenetic experiments is often sourced from two types of light sources, , and LED. Laser coupled sources function by coupling strongly directed

17 light from the laser into shanks that redirect it to the target cells. These shanks can be made of optical fibers or can be developed as a dielectric wave guide[6]. For sources involving LEDs, they can either lie in flexible probes in the body, adjacent to the area of interest or make use of waveguides similar to the laser sources.

2.1.1 Laser-Sourced Stimulation

Because the light coming from lasers has high intensity and low divergence, devices incorporating laser waveguides can reach high levels of specificity and can compar- atively decrease in the loss of the emitted light. However, these devices can not be integrated for free moving behavior experiments in small models because the weight and size of the laser require that the subject be tethered[6]. Free moving behavior is viewed as important because these wired setups can affect the behavior observed in the animals when the wires get tangled or otherwise restrict the animals’ movement. This can limit the range of studies due to physical limitations. For example, two animals can not be studied together in a tethered set up [17].

2.1.2 LED-Sourced Stimulation

LED-based sources allow for greater flexibility in the implantation. Both waveguide coupled and directly coupled LEDs require less power and allow for light-weight so- lutions that can run without a tethering connection. However, because LED light is generally less coherent than that emitted from a laser, less light from the LED will enter the waveguide. This makes LED-based waveguide coupled sources have much more loss than other alternatives. As said in the review by Fan and Li, LEDs directly coupled to the neurons are more competitive in terms of power efficiency, coupling efficiency and fabrication simplicity. However, the heat generated bythe 휇LEDs can cause damage to the neurons if not properly controlled [6, 11]. The system discussed in this work is made with the use of 휇LEDs, as free behavior experiments and power efficiency were important considerations in all design decisions.

18 2.2 Methods of Powering Non-tethered Implantable Devices

Individual 휇LEDs require 1-8mAs of current depending on the light intensity re- quired to properly stimulate the neuron [5]. Among non-tethered devices for use in optogenetic stimulation, many methods of providing power for the device have been identified, however, all methods present their own drawbacks. Battery-powered devices do not require external parts or configurations, as such integrating them into different experiments does not require additional design. How- ever, because batteries represent a fixed capacity, battery-powered systems must make trade-offs between stimulation intensity and operation duration [6]. Additionally, in- creasing the capacity often requires a larger battery, which increases the weight placed on the animal. Methods such as ultrasonic power, RF scavenging, and magnetic resonance cou- pling have been used to wirelessly power devices for stimulation [20, 9, 12]. These solve the problem of limited capacity and can provide power in excess of what is required to run the device. They make a trade-off by allowing for variation in power transfer based on location and direction. In a case where the power transfer is omni- directional, the system requires precise alignment of a complex antenna array, making frequent use seem impractical[9].

2.3 Wireless Communication with Implanted Devices

Regardless of the experimental design, wireless neuromodulation devices require some communication with an external device to control the behavior of the stimulation. For devices using ultrasonic power, the system can be designed such that the ultrasonic waves provide both power and data [12]. For other devices, Gaussian frequency-shift keying transceivers in the 2.4GHz band are often used, either on a custom PCB or from a commercial Bluetooth or Bluetooth Low Energy (BLE) enabled chip [11, 17]. For these applications, Bluetooth Low Energy seems to be the preferred method as the

19 required sleep period helps to decrease the overall power consumption of the device [19, 1].

2.4 In-Vivo Temperature Sensing

As stated in section 2.1, one concern in regards to 휇LEDs that are directly coupled to the neuron is the possible damage to the neuron from the heat generated by the LED. Increases in temperature of more than 1 to 2 degrees can lead to abnormalities in neural activity [3]. The exact temperature at which lasting damage occurs is not entirely known but papers report maximum recoverable temperatures ranging from 38.7 to 43 degrees[16, 15, 7]. Temperature changes resulting from the heat generated by the LED vary based on the current supplied to the LED and the duration and frequency of the LED pulses [5]. Dong et al. demonstrated that for a single pulse of 3.5 seconds, the temperature can increase by more than 2 degrees, even at currents of less than 3mA [5]. To mitigate this, researchers can test their selected stimulation waveform by measuring the temperature change in a brain phantom or by inserting a temperature sensor alongside the LED for a set of wired experiments. Sample data from these trials can then be used to model how the temperature change will work during the actual experiment. Some probes have been developed to include the temperature sensor as part of the shank design. Kim et al. created a 4 layer probe with an integrated temperature sensor placed on top of the 휇LEDs, with an accuracy of .001 degrees [13]. A paper by Goncalves et. al demonstrated the use of a double-sided shank, with the 휇LEDs for stimulation on one side and a Resistance Temperature Detector (RTD) on the other side. This positioning allows the RTD to lie close to the stimulation site of the neighboring shank while conserving shaft area for 휇LED use. Using this method they were able to report temperature with an accuracy of up to .2 degrees Celsius which can detect the 1 degree change before neurological behavior is affected. The authors also state they may face future limitations in response time for such measurements [8].

20 Figure 2-1: a) The block diagram of a probe that measures temperature using the reverse current of the LED when it is not lit. In this design, Dehkhoda et al. employed an H-Bridge and a CCII in order to change polarity across the LED and measure the resulting current. b) The model of the CCII used in this design. This figure is reprinted from [4].

Instead of increasing the complexity of probe fabrication by integrating another sensor, Dehkhoda et al. aimed to use the 휇LED as both a light source and a tem- perature sensor. This was done using the reverse-bias current of the LED during a period when the LED is not illuminated [4]. The design for this can be seen in Figure 2-1. This method was also able to achieve an accuracy of .2 degree Celsius, however, their output requires calibration as the measurement is of junction temperature, not surface temperature.

21 22 Chapter 3

System Overview

We developed a modular system capable of performing multichannel neuromodulation in mice models. Through the use of battery power and BLE technology, we were able to remove the need for tethered connections and external setups for most experimental designs. Beyond basic control of the beginning and end of stimulation, the system optionally allows for real-time control of parameters such as frequency, duty cycle, intensity, and wave shape. The key components of the system can be seen in Figure 3-1. The experimental design and results for the performance of this platform will be discussed further in Chapter 6.

3.1 The Physical System

As seen in Figure 3-2, the system has four types of physical components: probes, stimulation modules, a central device and a user device. The brain-implanted probe, developed by Atharva, is a soft fiber containing up to two parallel chains of 휇LEDs. The probe has an external pin connector for the stimulation module to plug into. The stimulation module itself is composed of two custom PCBs. The first is the main device containing all the circuitry for multi-channel stimulation and Bluetooth communication. The second is an optional board that can be used to control the intensity of the stimulation pulses as well as adjust the rise and fall time of each pulse. In our testing, we used an NRF52840 development board as the central device,

23 Figure 3-1: The overview of the system showing the neuromodulation platform, a di- agram of the the fiber-based probe that carries the 휇LEDs and the system setup. The Bluetooth connection between the headborne system and the central device can allow for achieve real-time stimulation updates, multiple LED and multi-device control.This figure is reproduced from [2] Copyright IEEE 2020. sending data received over UART via BLE and vice-versa, while allowing for multiple stimulation modules to connect and receive instructions. Finally, the user device is a computer with a user interface that can pass data over a USB serial connection to the central device. The bulk of the design work for this thesis was in the design of the hardware of the wireless stimulation board which will be further discussed in Chapter 4.

3.2 The Software System

Beyond the physical components, the system also relies on the support of two pieces of custom software. The first is the firmware on the stimulation board that receives stimulation parameters, converts them to their desired behaviors and returns any necessary information back to the user. The second is a user interface designed in MATLAB to allow users to easily make changes to parameters and send updates in real-time.

24 Figure 3-2: For basic operation, information flows in one direction. A user can update parameters for stimulation, and send these updates on to the BLE central device. The central device will then forward them to each of the modules that have been placed on the mice. The modules will use these parameters to generate the stimulation waveform that will excite the implanted probe. If the user chooses to use on-module recording, the recording information will be passed back through the chain.

The details of the creation of the firmware and the graphical user interface ona user’s device will be further discussed in Chapter 5.

25 26 Chapter 4

Hardware Implementation

As stated in Chapter 1, the goal of this platform was to employ a modular approach in creating a system to wirelessly control the stimulation of genetically modified neurons using light. On the hardware side of this platform, the goal of modularity became a focus on creating parts that can easily be made to work with or without one another. Thus we started by creating only the base module to handle the wireless communica- tion and light control, which will be described in section 4.2. From there we worked to create additional features and components that were modular and thus would not require changes to the main system. The creation of an intensity control module and a system for sensing in-vivo temperature changes will be further discussed in sections 4.3 and 4.4 respectively. Figure 4-1.a shows the design and prototype for the main device and the inten- sity control module while highlighting key areas and components on the PCB. 4-1.b contains a block diagram of the system with the intensity module attached.

4.1 Experimental Considerations

This work was done in collaboration with a planned in-vivo neuromodulation study. Thus, there was a strong emphasis on making sure the system was suitable for the ex- perimental procedures and stressing the importance of applicability to other possible studies and uses. This emphasis affected the design decisions across all modules.

27 Figure 4-1: a) PCB Layout of the main device and intensity module. b) Block diagram of the main components when the intensity module is plugged in. This figure is reproduced from [2] Copyright IEEE 2020.

28 While many researchers and designers have had great success using various forms of wireless power such as ultrasound, magnetic resonance and RF scavenging [20, 9, 12], we wanted to keep the required external fixtures and set up time to a minimum. As a result, we decided on using battery power. However, this decision came at the cost of additional design constraints based on our experimental conditions. Device weight is important in free behavior experiments because too much weight can affect the behavior of the mice. The mice chosen for these experiments are expected to move around actively as if there is no device on them at all. This means that the total weight of the device must be small enough to not tire them over the course of the experiment. As a result, we had to minimize weight in both the main board and the additional features. For the main board, we focused on ways to optimize the overall board design, such as reducing board size, board thickness, and the number of components. Because the battery was likely to make up a large portion of the weight, we also had to be conscious of using low power components in all possible situations in order to reduce the battery size required for various experiment durations. For the additional features, we took advantage of the modular design. We were able to allow the user to disable the additional components and sometimes physically remove them, allowing us to reduce both the power consumption and directly decrease the weight when they were not in use.

4.2 Base Module Implementation

As previously stated, the base module has two external functions, to communicate with the central device and create and source the waveforms for stimulation. For communication, we agreed using BLE was the most viable choice because of the low power capabilities and availability of components. The component used in this prototype was an NRF52840 packaged by Raytac to include an on-chip antenna. To enable flexibility in firmware on the NRF module, we chose to include aJ-Link programming connector area on the board as well.

29 The base module sources current through the GPIO pins of the NRF device for stimulation. By providing an array of pins to the header connector, the module can support driving multiple channels of 휇LEDs independently. In the prototype shown in 4-1.a, the three-pin header allows the device to control two independent LED channels with a shared ground connection. The module has an onboard series resistor for channel to limit the power consumption and intensity of the 휇LEDs. As previously mentioned, we chose to use batteries to power this system. The battery shown in Figure 4-1.a is a rechargeable lithium-ion battery(MS621FE) that offers 5.5mAh of capacity at full charge. An evaluation of the effective battery lifeof the device will be discussed in Chapter 6. Overall, when fabricated with 0.6 mm, the base module weighs approximately 1 gram included the battery.

4.3 Optional Intensity Control

In some experiments, researchers may need the ability to adjust the intensity of the light used or create a waveform of a particular shape. To implement this functionality, we decided to use a digital to analog converter (DAC) due to the flexibility given by the firmware control. The prototype in Figure 4-1, includes a MAX5510, whichwas chosen for its low power functionality and it’s minimized footprint. Despite the small footprint and minimal increase in components, the addition of the DAC and all required traces and components requires a large increase in the size and weight of the module. Additionally, even in sleep mode, the DAC can waste battery power. To make sure these drawbacks only apply when the experiment calls for intensity control, we designed the module to be easily removable when it is not needed. To allow for removal, we made use of small, lightweight header connectors that could provide all necessary connections when the intensity module is stacked on top of the base. When the module is not present, all connections function as they would in the original base module. This DAC add on adds .3g to the device when attached.

30 Figure 4-2: Block device of the main module adjusted to allow for temperature sens- ing. The LED current creates a voltage across 푅1 which is then amplified before being fed into the ADC.

The DAC is controlled via SPI by the micro-controller and its output is con- nected via a series resistor to one of the output channels. The system relies on the micro-controller to disable the DAC output or the GPIO pin depending on the situ- ation. Further implementation of the control logic for the DAC will be discussed in Chapter 5.

4.4 In-Vivo Temperature Sensing

A common drawback of the use of 휇LEDs in neural stimulation is the amount of heat generated in the process of lighting the 휇LED [6]. Because the 휇LEDs are generally located very close to the tissue they are trying to stimulate, this heat can cause damage to the tissue if the fiber reaches certain temperatures. To track this heat dissipation and make sure temperatures stayed within allowable levels, we aimed to create a temperature sensing module as an add-on to the base system. Similar to the work in [4], we wanted to use the existing probe components as the temperature sensor. As shown in Figure 4-3, for a given voltage, the relationship

31 Figure 4-3: The graph shows the effect of temperature on the current through three probes when a bias of 2.2V is directly applied. While there is variation from probe to probe, the slope of each line can be linearized for our region of interest.

32 between the current through a 휇LED and temperature can be approximated to linear for our temperature ranges of interest. This remains true even when the LED is not lit. Thus to monitor the heat generated by the pulsing 휇LED, the module makes use of the fiber’s two adjacent 휇LEDs. While one is pulsing, a constant voltage below the turn-on voltage is applied to the other. This keeps the power consumption of the temperature sensing circuit low and makes sure that we do not unintentionally affect the stimulation procedure. If the pulsing of the first LED generates heat as expected, it will cause a variation in the current through the second LED. To measure this variation in current, we used a one-stage inverting differential amplifier to multiply the voltage across the series resistor and fed the output into the microcontroller’s internal ADC. The block diagram for this circuit can be seen in Figure 4-2. Because the measurements are calibrated based on the current through the Blue LED, the

LDO and temperature sensing circuit are only connected to 푅1 of one of the two LEDs. The inverting amplifier takes the voltage across this resistor and amplifies it, subtracting it from the LED voltage. This is the voltage read by the ADC.

4.4.1 Gain Constraints

We identified our temperatures of interest as between 30-45 degrees Celsius andour desired precision to be greater .25 degrees. The blue LED turn-on voltage is approx- imately 2.3V, so the LDO was chosen to provide 2.2V. Given these chosen values and the measured quantities in Figure 4-3, we then identified 3 constraints on the selection of other components in the system.

∙ Based on the preliminary measurements in Figure 4-3, the maximum current through the LED will be .60uA at 45 degrees. Since the op-amp is subtracting the amplified signal from the 2.2V source, the total gain must be lessthan 3.6 * 106, or else the output will saturate at 0 before we reach the peak temperature.

∙ When 2.2V is applied, the slope of the line in the area of interest can be esti- mated to be 25nA per degree Celcius which is smaller much smaller than the

33 amplifier noise. To make sure our signal is larger than the amplifier inputnoise,

we must properly size 푅1. However, because 푅1 is in series with LED during normal operation, it must remain small enough to not have an effect on the voltage across the LED (such that it would change the current by a significant amount).

∙ The ADC is expected to have noise based on the number of bits per sample. Since each sample contains 14-bits, the noise from the ADC is expected to have a standard deviation of around .06mV. Thus the gain of the system must be large enough such that all signals of interest are above this noise level.

4.4.2 Gain Calculations

Based on the inverting design of the amplifier, the voltage output at the ADCpin can be defined as

푉표푢푡 = 2.2 − (퐼푇 푒푚푝 * 푅1) * (1 + 푅3/푅2)

Because we will want 푅3/푅2 >> 1, we can simplify this to be

푉표푢푡 = 2.2 − 퐼퐿퐸퐷 * (푅1 * 푅3/푅2)

This makes the magnitude of the gain equal to

푅 * 푅 퐺 = 1 3 푅2

With this and the previously mentioned constraints in mind, we selected 푅1 to be 1000Ω and 푅2 and 푅3 such that we obtained a gain of 2.5 million. With these parameters, we confirmed that the system could satisfy the three previously listed constraints.

34 Chapter 5

Software Implementation

While the novelty of the system largely lies in the design motivation of the hardware and the overall system integration, the software implementation supports the usability of the system as a whole and improves the flexibility of the system’s features. The goal of the software is to take advantage of familiar technologies and use them to make our hardware stack more accessible to researchers who will use it in experiments and others who may want to add more functionalities. As mentioned in Chapter 4, our chosen controller was the NRF52832, a low power SoC that supports BLE communication. At the beginning of development, we greatly benefited from the use of the Nordic SDK and SEGGER tools 1. However, to make it easier to use for beginners, we migrated to an Arduino-based firmware approach. For this we used the Adafruit Library 2 which we adapted to fit the Raytac package we used in the design. We then loaded the compiled code using the Adalink tool kit.

5.1 Stimulation Control

The module supports the creation of wave-forms consisting of a pulsing period fol- lowed by a rest period for stimulation. To do this, the module uses software timers. One changes the system from the rest state to the pulsing state and vice-versa. An-

1https://www.segger.com/downloads/embedded-studio 2https://github.com/adafruit/Adafruit_nRF52_Arduino

35 other switches the LED on and off while in the pulsing state.

For the case of intensity control, the control set up is the same. However, instead of turning on the LED with a GPIO pin, the output is controlled by a DAC so the values are written to the DAC through a software SPI. In the case where the pulse shape is to be trapezoidal, the DAC output is incremented in steps until the desired output intensity is reached and then decremented after the pulse width has passed. These step sizes will be calculated based on the rise and fall times specified in the user input.

5.2 Communication Protocol

BLE allows for the creation of multiple bidirectional channels, connecting the central device to the stimulation modules that are configured as Bluetooth peripherals. After connection, the devices wait for a message containing the stimulation parameters to be sent. The parameters in the message are described in Appendix A.1.

Instead of using a fixed-length communication, the message is a list of comma- separated values, with the optional values being located at the end. In the case that the user’s purpose only requires basic functionality, they can send only the first six parameters. These strings are tokenized and parsed into their respective variables. Stimulation begins immediately after parsing. This behavior continues until a new message is received. If this message is a valid list of parameters, stimulation will begin again with the new parameters. Otherwise, stimulation will be paused until a new list of parameters is received.

To save power, the amount of time spent sending data from the device is mini- mized. As a result, in the base implementation and when using the intensity control add-on, each module only sends advertising packets and purposefully does not send any data or status information back to the central device. However, for times when the module is collecting data onboard, it is possible to keep the connection two way and send updates in real-time.

36 5.2.1 Data Rate, Power and Latency Considerations

To increase the overall data rate available, we decided to increase the MTU of the BLE packets to the new BLE maximum of 247 Bytes. This also increases the ratio between useful data and header overhead in each packet transfer, making the system more efficient in terms of energy per data bit sent. This works well for data with high sample rates, as it allows us to batch points to allow for more data bits per the 7.5ms minimum connection interval. To take advantage of this larger packet size, we also batched our lower frequency data and increased the connection interval. This allowed us to decrease the effect of the temperature sensing on the overall power consumption because both connection interval and message rate have a large effect on the power consumption of the device as discussed in [19]. The drawback of all of these changes is the increase in latency. By batching the data in sets of X, we make it such that the maximum latency can equal X * sample period + connection interval. For example, if we tested sampling at 50Hz with batches of 100 data points, there would be a 2-second delay between the beginning of data collection on the peripheral and the reception of the first point.

5.3 User Interface Design

The system relies on user input to determine the stimulation parameters like fre- quency, intensity, rise time, and fall time. It also relies on user input to determine the mode of operation and communication. A preview of the current user interface can be seen in Figure 5-1. The interface is organized into sections by function. The top half is composed of visual aids for the user, including an example diagram of the waveform and a real-time plot of the incoming temperature data if temperature sensing is enabled. The bottom left two panels are the location of all configuration choices. The left most of the two is composed of parameters available on the base module. Based on

37 Figure 5-1: A preview of the user interface made in MATLAB. Users can adjust parameters as necessary and us the buttons in the bottom right corner to start and stop the stimulation based on the experimental needs. the predicted use cases of the device, the user can input two parameters settings to toggle between different waveforms more easily. The middle panel on the bottom is for the optional parameters, intensity control, and temperature sensing. The use of LED 1 is required for both optional behaviors due to hardware design requirements. To prevent user error, the middle panel ’Enable’ checkboxes are disabled whenever LED 2 or both LEDs are selected. The bottom right corner is split into two panels. The top is the status panel which shows whether or not a peripheral is connected to the central device and which stimulation waveform is running. The bottom panel contains buttons to start and stop stimulation.

38 Chapter 6

Results and Evaluation

The electrical and optical characterization experiments were performed using the following pulse parameters: pulse: 10ms, valley: 40ms, on: 1s, off: 4s, rise/fall time: 1ms, intensity: 100. This excludes experiments conducted to show the range of input controls. Current and voltage measurements were taken using the Keithley 2602 Sourcemeter.

6.1 Waveforms and Stimulation

The final waveform implementation allows users to set pulse duration with anaccu- racy of 1ms. This allows for frequencies of up to 500Hz. Figure 6-1.a shows a 20Hz wave with duty cycles of 20%, 50% and 80%. Figure 6-1.b shows a variation in pulse frequency as the pulses occur every 20ms, 50ms and 100ms resulting in frequencies of 50Hz, 20Hz and 10Hz respectively. Unevenness in the rise and fall patterns of both graphs can be attributed to the sampling frequency of the measurement device. Figure 6-2 shows the intensity control functionality. The DAC can be programmed to the .01V with very little output noise. This allows us to create a smooth rise and fall pattern for each pulse as well as accurate control over the LED voltage. These rise and fall patterns can be controlled in steps of approximately 30휇s starting at 1ms. For the figure, we defined the minimum voltage to be 2.3V because that isthe voltage the Blue LED turns off. We then demonstrated steps of .1V and 1msfor

39 Figure 6-1: a) A graph of three stimulation patterns with a frequency of 20Hz and different duty cycles. b) A graph of pulses of length 10ms and varying frequencies.

Figure 6-2: Compilation of intensity module operation. Rise time, fall time and voltage are indicated in the key in the top right corner. This figure is reproduced from [2] Copyright IEEE 2020. intensity and rise time respectively for each waveform. To ensure that the device was correctly performing stimulation, the probes and device were implanted with a wired recording electrode. Transgenic Thy1-ChR2 mice broadly expressing ChR2 in excitatory neurons throughout the brain were used as the test group and wild type mice were used as the controls. The wild type mice were not injected with any virus, unlike the transgenic ones. Hence, no optically evoked activity was expected in the wild type mice lacking opsin expression. As shown from Figures 6-3.b and 6-3.c, after the stimulation pulse is applied, optically evoked spikes

40 Figure 6-3: Evaluation of in vivo stimulation: a) Stimulation waveform used. b) The voltage output from the transgenic mouse after stimulation. Optically invoked activity is visible. c) The voltage output from the wild type mouse. No spikes observed, only artifacts are visible. This figure is reproduced from [2] Copyright IEEE 2020. can be detected in Thy1-ChR2 mice, whereas only artifacts are observed in the wild type mice. 1

6.2 Temperature Sensing

The resulting temperature circuit has an output noise of 10mV and a temperature sensitivity of 35mV/∘C. As a result, the temperature resolution is approximately .28 of a degree. Due to oversampling delay, the system can sample at a rate of up to

1Parts of this paragraph were taken from the section of [2] describing the same figure and exper- iment.

41 Figure 6-4: a) A graph of the reported LED current as the neighboring LED is turned on after being submerged in brain phantom. b) A moving average of reported LED current as the neighboring LED produces a stimulation wave form with 86.6% duty cycle and a 1 second rest period.

Figure 6-5: a) A graph of the steady-state temperature against the real-time data from the device. Because the data is received as a voltage, the left axis shows the corresponding current through the LED. b) A plot of the data collected from the device alongside the data previously used to calibrate the gain for the amplifier.

42 500Hz. However, increased sample rates result in much higher power consumption. Figure 6-4.a shows the temperature readings from the probe when both LEDs are submerged in a brain phantom. At 23 seconds, the LED used for stimulation turns on and the current in the sensing LED spikes as a result. This increase slows until the system reaches an equilibrium temperature. Figure 6-4.b shows the response of the system to a pulse waveform with a frequency of 60Hz, and a 86% duty cycle, performed in open air instead of in the brain phantom. The dips in measured current correspond to the 1 second rests between pulsing periods where the probe has time to cool. Figure 6-5.a shows the measurements taken from the device at different steady- state temperatures. To compare against the known behavior of the probes, the voltage output is converted back to current using the formula from Section 4.4. Figure 6-5.b plots the converted current against the data from Figure 4-3. The variation between the newly measured data and the previous data is well within the expected variation between probes and can be adjusted in calibration to convert these current values into temperatures.

6.3 Power Consumption and Battery Performance

Figure 6-6.a shows the input current of the device as the device receives a command, turns off BLE, and begins pulsing in the specified format. By disabling theBLE connection it is easy to see the difference in current between the LED:ON mode, when the LED is pulsing, and the LED:OFF mode, when the system is in sleep mode. In the figure, we can see the system draws 193휇A when stimulating with 10ms pulses. When both the LED and the BLE are off, the device draws 133휇A. From this, we can make the observation that when the device is communicating with the central device, the periodic advertising packets account for 117휇A of additional current beyond the normal function of the microcontroller. Figure 6-6.b shows the current consumption of the base mode module as the supply voltage decreases. Because the maximum voltage supplied to the LED decreases as

43 Figure 6-6: a) The input current of the device when 2.8V is applied to 푉퐷퐷. Different phases of operation are identified and the average current of each region is labeled. Advertising is when the device is actively communicating with the central device. LED:ON is the period in which the LED is pulsing at a 20Hz frequency. LED:OFF is the rest period between pulse cycles. b) The device input current as a function of the voltage applied. This figure is reproduced from [2] Copyright IEEE 2020.

Figure 6-7: a) A graph of the battery voltage during basic operation over 12 hours. b) A plot of light intensity based on voltage applied for 6 probes containing the blue 휇LED. This figure is reproduced from [2] Copyright IEEE 2020.

44 the battery loses charge, the current drawn by the LED will decrease as a result. Figure 6-7.a shows the battery voltage over time as the device goes through basic stimulation operation with BLE disabled. As shown in the graph, despite its small size, the battery has enough power to support lighting the LED for up to 12 hours. Figure 6-7.b shows the brightness of the Blue 휇LED as a function of the applied voltage. At peak voltages, the LED can emit 4.97푚푊/푚푚2 while even the lowest voltage setting is still above 2푚푊/푚푚2. When combining the two graphs in Figure 6-7, we can see that even after 7 hours of operation, the battery is far above the necessary intensity for stimulation, which is reported by Stark et al. as 1푚푊/푚푚2 [18]. We tested three variations in the enabled functionalities of the device. Figure 6-8 shows the average input current of the device during the LED:ON and LED:OFF phase of operation previously identified in Figure 6-6.a. For each phase, a bar shows the average current of the device for each variation. To demonstrate the proportion of consumption resulting from each choice of additional functionality, we colored sections of the bar to represent the average current required to incrementally add that functionality. The lowest bar of the stack, the baseline, represents the average current required for the minimal operation of the board after instructions have been received and the system goes into sleep mode. It is equivalent to the LED:OFF current when all live communication functionalities are disabled and is calculated to be approximately 172휇A. In all three variations in the figure, live updates over BLE are enabled during stimulation which resulted in the average current increasing by 117휇A in both the LED:OFF phase and the LED:ON phase. This is due to power consumption in the RF components as a result of sending and receiving packets during BLE connection events. During the LED:ON phase for the three variations, the LED is pulsed for 10ms on 40ms off. This requires not only power for the LED but also requires current for additional computational cycles. The sum of these increases is represented by the bar sections labeled MicroLED. This value ranges from 55휇A to 60휇A.

45 Figure 6-8: a) A graph of the device’s average input current for the two phases of operation with different operation parameters enabled. The left most column of each group represents basic operation, stimulation with live updates enabled. The middle column represents operation with both intensity controlled stimulation and live updates enabled. The right most column represents stimulation with temperature sensing and live updates enabled.

46 To ensure comparability, the intensity control settings in the graph mimicked the behavior of the uncontrolled stimulation. 2.8V was applied to the LED at a frequency of 20Hz with a 20% duty cycle. Additionally, rise and fall times were set to the minimal amount 1휇s. As seen in the figure, enabling intensity control results in an increase of 198휇A during the LED:ON phase of operation. This is largely due to the use of software SPI in controlling the DAC. During the LED:OFF phase, when the DAC is enabled but not being updated, the Intensity Control setting results in a current increase of 17휇A. For temperature sensing, the power consumption and the resulting input current is largely dependent on the chosen sampling rate. For the data displayed above in 6-8, we sampled at a rate of 100Hz, with an oversampling rate of 128x. This resulted in an increased current of 205휇A in the LED:ON phase and 219휇A in the LED:OFF phase. This increase accounts for the current to the LDO and the amplifier circuit as well as the additional CPU and RF power required in order to sample the data and send the packets over BLE. Sample waveforms similar to those used to calculate Figure 6-8 can be found in Appendix B-1. A table containing the average value of the waveforms for each phase can be found in Appendix A.2.

47 48 Chapter 7

Conclusion and Future Work

This work has presented a platform for battery-powered wireless control of neuromod- ulation through the use of 휇LEDs. The platform not only offers fine-tuned control of the stimulation parameters but is also modular in nature such that it can be extended to allow for intensity control by attaching an additional DAC circuit. A temperature recording circuit which makes use of the temperature-dependent nature of the forward current can optionally be added to the platform. This allows for further flexibility in the usage of the platform and opens the door for further additions and adaptations.

When compared to the state of the art, the device uses much less stimulation power in order to maintain sufficient stimulation intensity. Allowing it to either weigh less than or have a comparably longer battery life beyond similar battery-powered devices [11, 14]. For experimental design, it has the advantage over wirelessly powered devices of not requiring any external electronics or set up, however, the experimental duration can be limited due to the battery’s limited capacity [17, 9, 12]. In future iterations of the device, there are some weaknesses that could be addressed. For instance, without intensity control, the voltage applied to the LED decreases as the battery loses charge, this could be addressed through the addition of a DC-DC converter with feedback.

49 7.1 Future Work

Through the implementation of the temperature sensing mode, many of the system functionalities required for neural recording, such as data collection, communication, and visualization have already been proven to work. Using this and leveraging the low-power, miniaturized properties of our system, we can envision the integration of electrical or optical low-frequency recording modules in the future, which would pave the way for fully wireless, closed-loop neuroscience experiments. In the short term, however, due to the flexibility of the device, there are many functionalities that would require small software changes, but would greatly increase the range of possible experiments. Assigning unique identifiers to each device would allow for specific commands to be sent to each device rather than all devices receiving the same command. This would also allow recording to be expanded to multiple devices at once, depending on the data rate. While it was not necessary for this experiment because the LEDs were coupled to the same neuron, there could be an instance where expanding the firmware to allow for simultaneous independent control of both LEDs would be an interesting extension of the existing code.

50 Appendix A

Tables

Table A.1: Explanation for each parameter in the stimulation control message

Parameter Explanation Pulse on time Period of time, in ms, for which each pulse is at max intensity Pulse off time Period of time, in ms, waited before beginning the next pulse Stimulation Period Period of time, in s, that stimulation pulses occur Rest Period Period of time, in s, between stimulation periods LED Mode MODE 1 = Use LED 1 MODE 2 = Use LED 2 MODE 3 = Use Intensity Control Module MODE 4 = Use both LED 1 and LED 2 Enable Live Disconnect upon start of stimulation to decrease current Communication intake; Used for when no feedback or updates will be necessary Enable Temperature Enable temperature recording; Can not be used in Power Sensing Saving Mode; Can not be used in LED MODE 2 Temperature Sensing Wait period between each temperature sample Sample Period/Frequency

51 Table A.2: Average Current for Available Cofigurations LED:ON(휇A) LED:OFF(휇A) Stimulation, BLE-disabled 232 172 Stimulation, BLE-enabled 349 290 Intensity Controlled 548 307 Stimulation, BLE-enabled Stimulation with 555 509 Temperature Recording, BLE-enabled

52 Appendix B

Figures

Figure B-1: A 1s period of LED ON followed by a 3s period of LED OFF for different configurations of the device.

53 54 Bibliography

[1] Bluetooth Core Specification 2020. Bluetooth SIG Proprietary, 2020. [2] S. Orguc; J. Sands; A. Sahasrabudhe; P. Anikeeva; A. P. Chandrakasan. Modular optoelectronic system for wireless, programmable neuromodulation during free behavior. In IEEE 42th Annual Conference of the Engineering in and Biology Conference. IEEE, 2020. [3] Charmaine Childs. Human brain temperature: regulation, measurement and relationship with cerebral trauma: part 1. British journal of neurosurgery, 22(4):486–496, 2008. [4] Fahimeh Dehkhoda, Ahmed Soltan, Nikhil Ponon, Anthony O’Neill, Andrew Jackson, and Patrick Degenaar. A current-mode system to self-measure temper- ature on implantable . BioMedical Engineering OnLine, 18(1), 2019. [5] Na Dong, Rolando Berlinguer-Palmini, Ahmed Soltan, Nikhil Ponon, Anthony O’Neil, Andrew Travelyan, Pleun Maaskant, Patrick Degenaar, and Xiaohan Sun. Opto-electro-thermal optimization of photonic probes for optogenetic neural stimulation. Journal of biophotonics, 11(10):e201700358, 2018. [6] B. Fan and W. Li. Miniaturized optogenetic neural implants: a review. Lab Chip, 15:3838–3855, 2015. [7] Takanori Fujii and Yasuhiko Ibata. Effects of heating on electrical activities of guinea pig olfactory cortical slices. Pflügers Archiv, 392(3):257–260, 1982. [8] J.M.; Fernandes H.C.; Souto M.R.; Pimenta S.; Dong T.; Yang Z.; Ribeiro J.F.; Correia J.H. Goncalves, S.B.; Palha. Led optrode with integrated temperature sensing for optogenetics. Micromachines, 2018. [9] Philipp Gutruf, Vaishnavi Krishnamurthi, Abraham Vázquez-Guardado, Zhao- qian Xie, Anthony Banks, Chun-Ju Su, Yeshou Xu, Chad R Haney, Emily A Waters, Irawati Kandela, et al. Fully implantable optoelectronic systems for battery-free, multimodal operation in neuroscience research. Nature Electronics, 1(12):652–660, 2018. [10] Marwan Hariz, Patric Blomstedt, and Ludvic Zrinzo. Deep brain stimulation between 1947 and 1987: The untold story. Neurosurgical focus, 29:E1, 08 2010.

55 [11] Yaoyao Jia, Wasif Khan, Byunghun Lee, Bin Fan, Fatma Madi, Arthur Weber, Wen Li, and Maysam Ghovanloo. Wireless opto-electro neural interface for ex- periments with small freely behaving animals. Journal of neural engineering, 15(4):046032, 2018.

[12] Benjamin C Johnson, Konlin Shen, David Piech, M Meraj Ghanbari, Ka Yiu Li, Ryan Neely, Jose M Carmena, Michel M Maharbiz, and Rikky Muller. Stimdust: A 6.5 mm 3, wireless ultrasonic peripheral nerve stimulator with 82% peak chip efficiency. In 2018 IEEE Custom Integrated Circuits Conference (CICC), pages 1–4. IEEE, 2018.

[13] Tae-il Kim, Jordan G. McCall, Yei Hwan Jung, Xian Huang, Edward R. Siuda, Yuhang Li, Jizhou Song, Young Min Song, Hsuan An Pao, Rak-Hwan Kim, Chaofeng Lu, Sung Dan Lee, Il-Sun Song, GunChul Shin, Ream Al-Hasani, Stanley Kim, Meng Peun Tan, Yonggang Huang, Fiorenzo G. Omenetto, John A. Rogers, and Michael R. Bruchas. Injectable, cellular-scale optoelectronics with applications for wireless optogenetics. Science, 340(6129):211–216, 2013.

[14] Steven T Lee, Pete A Williams, Catherine E Braine, Da-Ting Lin, Simon WM John, and Pedro P Irazoqui. A miniature, fiber-coupled, wireless, deep-brain optogenetic stimulator. IEEE Transactions on Neural Systems and Rehabilitation Engineering, 23(4):655–664, 2015.

[15] Nobuhiko Matsumi, Kengo MATSUMOTO, Nobuya MISHIMA, Eiji MORIYAMA, Tomohisa FURUTA, Akira NISHIMOTO, and Kohji TAGUCHI. Thermal damage threshold of brain tissue—histological study of heated normal monkey brains—. Neurologia medico-chirurgica, 34(4):209–215, 1994.

[16] Nicholas L Opie, Ursula Greferath, Kirstan A Vessey, Anthony N Burkitt, Hamish Meffin, David B Grayden, and Erica L Fletcher. Retinal prosthesis safety: alterations in microglia morphology due to thermal damage and retinal implant contact. Investigative Ophthalmology & Visual Science, 53(12):7802– 7812, 2012.

[17] Mark A. Rossi, Vinson Go, Tracy Murphy, Quanhai Fu, James Morizio, and Henry H. Yin. A wirelessly controlled implantable led system for deep brain optogenetic stimulation. Frontiers in Integrative Neuroscience, 9:8, 2015.

[18] Eran Stark, Tibor Koos, and György Buzsáki. Diode probes for spatiotemporal optical control of multiple neurons in freely moving animals. Journal of neuro- physiology, 108(1):349–363, 2012.

[19] Jacopo Tosi, Fabrizio Taffoni, Marco Santacatterina, Roberto Sannino, and Domenico Formica. Performance evaluation of bluetooth low energy: A sys- tematic review. Sensors, 17(12):2898, 2017.

[20] Christian T Wentz, Jacob G Bernstein, Patrick Monahan, Alexander Guerra, Alex Rodriguez, and Edward S Boyden. A wirelessly powered and controlled

56 device for optical neural control of freely-behaving animals. Journal of neural engineering, 8(4):046021, 2011.

[21] Ofer Yizhar, Lief E Fenno, Thomas J Davidson, Murtaza Mogri, and Karl Deis- seroth. Optogenetics in neural systems. Neuron, 71(1):9–34, 2011.

57