Design of Programmable LED Based Phototherapy System

Light based systems are frequently used in the field of medicine for diagnostic and surgical procedures, medical photography, phototherapy, etc. Phototherapy involves the use of light energy for the treatment of physical or mental illnesses. Illumination parameters such as wavelength and dose of therapy can be varied to have distinct effects on cells and tissues. This has necessitated the need to design a system which is programmable for various parameters related to therapy and can also be used by people at large for biomedical applications. The paper presents the design and implementation of a portable, hand-held and programmable Light Emitting Diode (LED) based phototherapy system using embedded technology. The system is designed around the ARM based TM4C123GH6PM microcontroller processor. The microcontroller has been programmed to allow for selection of various parameters such as frequency, duty cycle, and time of exposure. The matrix keypad interface and liquid crystal display (LCD) offer the ease of human interface. An LED driver circuit has been efficiently designed to modulate the output power of LED. Further, Super Bright LED (SLED) of wavelength ∼633 nm has been successfully tested and results of optical characterization including spectral and spatial response have been presented in the results section. The designed system successfully achieves the programmable parameters required for dose optimisation required for enhancing the therapeutic effects of a phototherapy system.


Introduction
Low Level Light Therapy (LLLT) or phototherapy is a noninvasive technique of exposing an injured tissue to light (continuous or pulsed monochromatic light) of wavelength ranging from 600 to 1000 nm in order to relieve pain, reduce inflammation, and enhance wound healing [1]. The source of light used in this technique could be the LASER or the small, cost effective SLED, or LED [2]. The main components of phototherapy include source wavelength, pulse frequency, power density, and irradiation time. The power density required for the treatment of various kinds of injuries can vary from 1 mW/cm 2 to 100 mW/cm 2 [3]. The irradiation time of this novel therapy can range from a few minutes to several hours. The treatment span could vary from a few days to several weeks depending upon the type of injury or wound. Laser based therapy is thermal in nature whereas there is no such reported effects due to LED. Therapeutic effects of LLLT that have been reported are increased cellular proliferation, migration and adhesion, enhanced neovascularization, promotion of angiogenesis, and increased collagen synthesis [4][5][6][7][8]. Cell proliferation has been reported in vitro in several types of cells: fibroblasts, keratinocytes, endothelial cells, and even lymphocytes [9][10][11]. Phototherapy is also known as photo biomodulation because of the biological effects caused by the photon on exposure to the treated tissues. The primary mechanism behind phototherapy is energy absorption from a light source. Consequently, a photochemical reaction is initiated when the chromophore react with the light entering a tissue. The major factors affecting light absorption are wavelength of the light source and tissue chromophore (haemoglobin and melanin). Chromophore absorb wavelength below 600 nm while water molecules do the same for infrared light wavelength greater than 1100 nm. Thus, 600-1100nm is optical window for effective tissue penetration. Considering the biological window, LED of wavelength ranging between 600 and 650nm has been selected for biomedical applications such as wound healing. Till date, many research studies have been conducted to evaluate the effects of LLLT but none have been able to determine the parameters effective for wound healing applications. The major drawback is the nonavailability of a standard instrument which can be programmed for variable parameters such as frequency, duty cycle, and exposure time. Thus, one needs to develop a programmable and tunable instrument which can be used for laboratory experiments leading to a detailed investigation and analysis of the parameters required for the therapeutic treatment.
In this paper we have presented the design and analysis of programmable LED based system using embedded technology. In this design it is possible to vary the mode of operation such as continuous or pulsed. Also, it is possible to control the frequency of operation and duty ratio for optimal use in healing applications.

Design and Development of LED Based Phototherapy System
The design and development of the portable, programmable LED based phototherapy system are now discussed in detail.
. . System Overview. The portable LED based phototherapy system comprises of three distinct units as illustrated in Figure 1. The units are: Pulse generator (processor module and user interface module), current driver circuit and the LED module. Processor is the core of pulse generator that instructs the system to operate in either continuous or pulsed mode. The keypad is used to accept user defined variables, i.e., frequency, duty cycle, and time of exposure.
These illumination parameters are displayed on the LCD for user feedback and transmitted to microcontroller unit for pulse generation. The portable battery is used to power the designed system.
The time duration for the operation of the device is also programmable. Finally, the output of the control system is routed to LED driver circuit which generates sufficient power to drive the LED module.
. . . Pulse Generator. The pulse generator module is designed around the Texas Instruments TM4C123GH6PM microcontroller as its core controller and an interface module comprising of matrix keypad and LCD display which meets the design requirements of the system.
A microcontroller is a complete computer integrated onto a single silicon chip. This means that microcontroller has on-chip memories (RAM and ROM), a central processing unit (CPU), an arithmetic and logic unit (ALU), timers, watchdog timers, pulse width modulation modules, analogto-digital converters, general purpose input/output ports, etc. The TM4C123GH6PM [12] is a low power, high performance 32-bit microcontroller manufactured by Texas Instruments using high-density, nonvolatile memory technology and is compatible with the industry standards. The on-chip flash allows in-system programming along with the conventional nonvolatile memory programmer. The system is designed to operate in continuous as well as pulsed mode. It allows the frequency selection ranging from 1 Hz to 1 KHz. While operating in pulse mode, the duty cycle can be varied from 1% to 99%. The duration of exposure can be set from 1 to 99 minutes.
x Matrix Keypad. Matrix keypad consists of an interconnected set of push buttons. The fundamental advantage of the 4x4 matrix keypad is that the sixteen keys require only eight general purpose input/ output (GPIO) pins to interface effectively, four GPIO pins for the rows and four GPIO pins for the columns. Keypad pins 1, 2, 3, and 4 are the column pins and keypad pins 5, 6, 7, and 8 are the row pins. The column pins are initialized as output pins and are successively set to logic high while the rest are set to logic low. Alternately, the row pins are initialized as input pins and are used to detect the press of a key. This process returns a coordinate value for the specific key that has been pressed, which is decoded to return the value which the key indicates (as opposed to the positional coordinate associated with the pressed key). This process relies on the fact that the time requirement to scan for the press of a key is at least an order of magnitude less than the time requirement to physically press a key. The row pins of the 4x4 matrix keypad are interfaced to general purpose input/output (GPIO) port E pins 0 to 3 (PE 0 -3) of the TM4C123GH6PM microcontroller development board whereas the column pins of the keypad are interfaced to GPIO port C pins 4 to 7 (PC 4 -7).
x Liquid Crystal Display Module. The 20x4 liquid crystal display module incorporates a HD4478U liquid crystal display controller and driver along with a 20x4 dot-matrix liquid crystal display capable of displaying four rows of twenty characters each, a Random-Access Memory (RAM) unit and a Read Only Memory (ROM) unit. The RAM unit is divided into two discrete units, namely, Display Data RAM (DDRAM) and Character Graphics RAM (CGRAM). The DDRAM stores the microcontroller generated data to be displayed on the LCD screen. The CGRAM, on the other hand, stores any custom nonstandard characters a user may define. The ROM unit, called Character Graphics ROM (CGROM), stores the standard character data for the 5x7 dot-matrix characters and predefined commands used to control the operation of the LCD controller. The contents of this memory unit cannot be edited by the user interface.
The sixteen pins of the LCD module are connected as follows.
The LCD V SS (Pin 0), R/W (Pin 4), and LED-(Pin 15) pins are connected to ground. The V CC (Pin 1) is connected to the 5V power supply. The V EE (Contrast Adjustment) (Pin 2) is connected to the wiper of a 10 kΩ potentiometer whose other terminals are connected to V CC and ground. The Register Select (RS) (Pin 3) is connected to GPIO Port A pin 2 (PA 2). The Read/Write (R/W) (Pin 4) is connected to ground. The Enable (En) (Pin 5) is connected to GPIO Port A pin 3 (PA 3). Data pins (DB 0 -7) (Pins 6 -13) are interfaced to GPIO Port B pins (PB 0 -7). The LED+ (Brightness Adjustment) (Pin 14) is connected to V CC through a 150 Ω resistor.
The supply from portable battery is connected across V BUS and ground pin of the TM4C123GH6PM microcontroller and an external reset push button is provided across the reset pin and ground. The square pulsed wave is generated at the GPIO Port D pin 6.
. . . So ware Design. The program was written in C using the Advanced RISC Machines (ARM) instruction set developed on the Keil Vision version 4 Integrated Development Environment (IDE) which incorporates a text editor, linker, compiler, and debugger all in one development environment.
The TM4C123GH6PM microcontroller works at a bus frequency of 16 MHz using the on-chip oscillator. Alternatively, a crystal oscillator of 16 MHz may also be utilized which is much more accurate than the on-chip oscillator. By applying the phase locked loop (PLL), the TM4C123GH6PM can be configured to run at 80 MHz. The TM4C123GH6PM also boasts of a number of on-chip hardware timers which is a much more accurate way of generating delays as compared to firmware based delay generation techniques. We have programmed two such hardware timers: one to generate pulsed wave ON time and OFF time delays, and the other to generate the various in-system delays such as 1 s, 10 s, and 10 ms delays used in the LCD operation subroutines.
. . . System Task Design and So ware Flow. The flowchart represents the algorithm of software design of Pulse Generator unit of LED based phototherapy system is outlined in Figure 2. The primary function calls the various subroutines to perform specific tasks. The main function initializes the GPIO gating control (clock), calls the phase locked loop (PLL) function to operate the microcontroller at 80 MHz, initializes the output port for pulsed wave generation, and initializes the LCD module and keypad. Subroutines have been written for the individual functions required for the operation of the LCD as well as for scanning of individual keys and user defined variables by the 4x4 matrix keypad. It also calls the functions to accept user defined variables, i.e., frequency, duty cycle, and time. These variables are stored and used in the generation of the pulsed square wave.
Port A pins 2 and 3 are initialized as output control pins to the LCD, while Port B is initialized as LCD output register port. Port C pins 4 to 7 are initialized as output column pins to the 4x4 matrix keypad, and Port E pins 0 to 3 are initialized as input row pins to the 4x4 matrix keypad. Port D pin 6 is initialized as the output for the pulsed square wave.
. . LED Driver Circuit. LEDs are current controlled devices, such that even the slightest fluctuation in the terminal voltage across the LED causes a steep increase in the current flowing through it. Thereby, it is very easy to exceed the current limit of the LED, if the selected voltage source is not ideally chosen. The LED driver functions as a controlling element to provide the LED with stable potential difference across its terminals, or constant current through it.
An LED driver may be a simple and inexpensive current controlling resistor, an active constant current source, or a tightly controlled voltage regulator. The resistor is by far the simplest and most inexpensive approach for designing a driver circuit. However, it has a few drawbacks; specifically, it is quite inefficient as a current controlling element because it dissipates any excessive current as heat. Also, the resistor is not able to provide protection from voltage spikes from a nonideal power source. Alternately, a voltage regulator may  . . . Description and Working. As illustrated in Figure 3, the LED driver circuit is a modified current limiter circuit and comprises a feedback loop, consisting of a MOSFET Q 1 and a BJT Q 2 , to constantly regulate the current flowing through the load, i.e., the LED. Variable resistor R SET is used to set the current limit of the circuit, while resistor R UP acts as a pull-up resistor to smooth out any oscillations delivered to the load during the off time of the pulsed gate drive to the MOSFET, and resistor R DRIVE provides protection to the output pin of the microcontroller development board to drive the load. Power is delivered to the load, i.e., the LED, by a 5V portable power source while current regulation through the LED is achieved by means of three components, namely, MOSFET Q 1 , BJT Q 2 , and resistor R SET . As gate drive is applied to MOSFET Q 1 , power is delivered to the load through MOSFET Q 1 and resistor R SET , which provides the secondary function of applying current regulation voltage as base drive to the BJT Q 2 . The voltage drop across resistor R SET defines the base drive voltage delivered to the base of the BJT Q 2 .
If the voltage across R SET , i.e., voltage at the base of BJT Q 2 (defined by the constant resistance of the resistor and the current flowing through the LED) exceeds the maximum base-to-emitter off voltage of the BJT Q 2 , it turns on and begins to conduct current through its emitter-to-collector International Journal of Optics The component requirement and selection criteria for the design of current driver circuit are enumerated as follow.
(1) MOSFET Q 1 , IRL3803 is a logic level MOSFET [13]. This means that a Gate-to-Source voltage, V GS , of 3.3V will produce a substantial Drain current, I D , and a negligible Drain-to-Source resistance R DS (on). This is in direct contrast to a regular MOSFET which requires a larger Gate-to-Source voltage, V GS , to produce a negligible Drain-to-Source resistance R DS (on), approximately 5V to 7V. This is also significant because the selected TM4C123GH6PM microcontroller works at a 3.3V high logic level. The choice of MOSFET IRL3803 results in a simplified design in comparison to that with a regular MOSFET as that would have required a separate circuit such as digital logic shifter to shift the 3.3V high logic from the microcontroller to an acceptable gate drive for the MOSFET.
(2) BJT Q 2 , 2N3904, is a regular small signal Bipolar Junction Transistor. Any BJT would be acceptable as long as its Base-to-Emitter voltage, V BE , is acceptably small in magnitude.
(3) Variable resistor R SET has a power rating of at least one-quarter Watt. This is selected such that the circuit will perform optimally for a large range of power settings.
The real time PCB implementation of the LED based phototherapy system is represented in Figure 4(a). In order to perform various in-vivo and in-vitro studies of this phototherapy system with great ease, a compact and light weight prototype has been developed and is illustrated in Figure 4(b). . . LED Characterization. In this section, we present the various measurements carried out to characterize the LED that is being used for the phototherapy application.

Results
(a) Spectral Response. The spectral properties of the LED have been studied in detail using the LMS-6000 spectroradiometer. The plot of the relative spectral power distribution as a function of wavelength is given in Figure 6. It can be observed that the peak wavelength is at p =633.9 nm. The observed Full Width at Half Maximum (FWHM) is 17.6 nm. The measured spectral flux of the LED is 28.708 lm at V=2.2V and I=200mA and efficiency is 66.63 lm/W. The International Commission on Illumination (CIE) chromaticity diagram, which is yet another way to study color, is given in Figure 7. The dominant wavelength, as determined from drawing a line through the color coordinates of the reference illuminant and the measured chromaticity coordinates of the LED is 623.6 nm.
(b) Spatial Response. The radiation pattern is a plot of spatial distribution of LED light intensity in the polar coordinate system [14,15]. Study of this property is particularly important to determine the efficacy of the LED device for biomedical applications. The measurement for spatial radiation pattern of the LED has been carried out using the goniometer. In the experimental setup, the sensor is fixed and the LED has been rotated around it to measure the radiation pattern as depicted in Figure 8. It is observed that the radiation pattern is spread out and nondirectional.    Figure 9 illustrates the relative intensity plot in the 3D Cartesian plane using an optical arrangement of a CCD detector with data acquisition and image processing software and the LED [16]. The corresponding 2D plot for radiant flux has been carried out using NOVA II OPHIR handheld meter and is given in Figure 10. Predictably, there is peak power output at =0 0 which wanes off on either side of the maxima.

Conclusion and Future Work
A programmable LED based phototherapy device comprising of a pulse generator, a LED driver circuit, and a high powered LED has been developed and described in this work. A pulse generator specifically designed to drive the LED system with a design flexibility of varying time and duty cycles at low frequencies (1 Hz -1 KHz) has been developed. The use of microcontroller to actualize the ever needed flexibility in design, eliminating the need of changing the software whenever a variable pulse is needed, has been achieved by this design. A pulse generator system with both keypad and LCD interface makes the device user friendly. The output frequency of the pulses of the microcontroller has been found to be extremely accurate. The driver circuit for the high power LED is low cost and only requires four discrete components. The various measurements have   been carried out to characterize the LED which include spectral and spatial distribution of LED. In future work, the system will be upgraded to model the desired radiation pattern and optimize it for photo-therapy application. The described system provides easy programmability of variable illumination parameters required for phototherapy such as frequency, duty cycle, time of exposure, and power density, thus making this system apt for standardisation of treatment protocol for in vivo and in vitro studies. In the initial phase of our study, the system will be tested for the reduction of the infectious bacteria using microbial culture.

Data Availability
The data used to support the findings of this study are included within the article.

Conflicts of Interest
The authors declare that they have no conflicts of interest.