A Novel Low-Cost Synchronous / Asynchronous Microcontroller-Based Pulsed Laser

: The development and implementation of continuous-wave (CW) or pulsed lasers has become essential in all areas of science and engineering. In the case of pulsed lasers, their emission period is commonly set up by the length of the laser cavity, which implies that it is necessary to replace the whole laser or modify the cavity to change the repetition rate. On the other hand, microcontrollers, capable of performing speciﬁc tasks saving size, cost and power consumption, have proven to be a powerful tool for various applications. To the best of our knowledge, we present a novel pulsed laser based on a very low-cost commercial microcontroller and a continuous-wave laser diode, where the pulse width and period are adjustable through a graphical user interface (GUI); besides, a new temporal asynchronous regime consisting of periodic packets of multiple pulses is produced. Pulses from 8 to 60 ms duration and with periods from 0.25 to 5 s are presented. These long optical pulses can be useful in certain applications where conventional pulses cannot be used due to their inadequate pulse width or period or intensity, such as simulating the neuronal activity of the brain or the development of neuromorphic hardware, where the response times are in the order of ms.


Introduction
Since its creation in 1960, the laser has become a watershed due to its wide range of applications in industry, science and medicine, among others [1,2]. Lasers can emit an uninterrupted flow of light (continuous-wave, CW) or light in the form of well-defined flashes (pulses). To achieve pulses, several techniques have been developed. One of the oldest still used is employing a perforated metal disc (chopper wheel) rotating at high revolutions per minute (RPM) [3,4]; here, the period is defined by the chopper and the rotation speed. One more modern technique is Q-switching, which generates pulses through the modulation of losses in the cavity [5,6]. Another technique, mode locking, the most important technique for obtaining short and ultrashort pulses, produces pulsing when the phases of the cavity modes are locked together, summing their amplitudes [7][8][9][10] so as to generate one pulse per round trip in the cavity; hence, the period (T) corresponds to the laser cavity length [9,11]. Although in general terms pulsed lasers produce a regular train of pulses (equally spaced, identical or quasi-identical releases of energy), some pulsed lasers have the capability to generate multiple pulses during each round trip, which in some circumstances are uniformly distributed along the whole laser cavity (harmonic mode locking) [12][13][14][15]; in this case, the pulse train period is an integer submultiple of the cavity round-trip time (and the pulse repetition rate, an integer multiple of the cavity fundamental frequency). This behavior is very useful for some applications (telecommunications [16], supercontinuum generation [17], metrology [18], etc.). However, typical values of pulse duration (fs-ps) and periods (ns-µs) of trains generated by mode-lock lasers (such as fiber lasers) are not suitable for generating pulses as long as ms. For instance, to obtain a period of only 1 ms, a mode-lock laser should have a length of 200 km.
The type of laser emission required for applications (CW or pulsed) depends on the situation: CW lasers are commonly employed in holography [19], spectroscopy [20], surface cleaning [21], orthodontics [22], ophthalmology [11], material processing [23] and so on, whereas pulsed lasers are used in metrology [2,18], micromachining [24], ophthalmology [11,25], supercontinuum generation [9,14], telecommunications [26] and more. In general terms, lasers can be classified considering the kind of lasing medium they employ, such as solid state, gas, dye, fiber optics and semiconductor lasers. In the latter category, we can find laser diodes-devices that, although similar to LEDs, can emit coherent light under the right conditions [27,28]. It is well known that laser diodes are essential for the operation of fiber lasers as their source of pumping; hence, sometimes a laser is necessary for another laser to work, the latter presenting different advantages and characteristics with respect to the original one.
In the frame of electronics, microcontrollers, which play crucial roles in almost all control systems and instrumentation, are extensively used to facilitate the digital control of processes and devices, reducing the power consumption, size and cost in dedicated tasks [29]. Microcontrollers are usually implemented for specific purposes, and provide high flexibility and configurability, which makes them quite useful in integrated applications. Since its appearance in the 1970s [30], the microcontroller has evolved rapidly under different architectures, keeping its basic components and adding support for new peripherals. Therefore, its implementation has received a lot of attention. Today there is an accelerated trend towards intelligent control units, in particular towards those based on ARM processors [31,32]. Microcontrollers have proven to be an excellent host for diverse applications such as robotic locomotion [33][34][35], power point tracking control systems [36], chaotic systems [37], predictive control schemes [38] and monitoring [39,40]. Likewise, microcontrollers have been used to control some optical devices, for instance luminaires [41] and lighting control systems [42]. However, there are no reports on the use of such devices for changing the synchrony of optical systems; to the best of our knowledge, aperiodic pulses (asynchronous pulses) have not yet been studied in this context, not even using some commercial control modules, because they generate only synchronous switching (periodic pulses), such as electro-optic modulator drivers (Thorlabs LD2000R or EK2000) working in the order of kHz or (Thorlabs MX10A) GHz.
In this work, we present a novel synchronous/asynchronous pulsed laser based on a low-cost commercial microcontroller, starting from a CW laser diode. This device can emit periodic pulses like conventional pulsed lasers or asynchronous releases (aperiodic emissions) in the form of packets of multiple pulses whose temporal parameters are defined digitally through a graphical user interface (GUI). Our light pulses (with a peak power of 1 W, the only power handled) can be used in applications where conventional pulsed lasers cannot, because the duration and period of standard pulses are too short to simulate some biological responses or be processed by some morphological hardware devices, aside from usually having very high peak powers (kWs).

Experimental Setup
The block diagram of the pulsed laser based on a low-cost commercial microcontroller is depicted in Figure 1. The system consists of a CW diode laser at 532 nm (green light), a regulated power supply, an amplifier and an optocoupler. Green light is used because it is the most sensitive wavelength in the visible region, which allows it to achieve a better signal-to-noise ratio. The amplification-switching stage is carried out by means of a metal oxide semiconductor field effect transistor (MOSFET) to control high currents. Using a MOSFET as a switch allows cut-off or saturation mode to control the obtained current by applying a voltage on the gate terminal with respect to the source terminal; the amplification-switching stage increases the current and voltage modulating the pulse width that initially works as a continuous wave. The optocoupler is employed to protect the computer (GUI) and the microcontroller against high voltage peaks. This device uses light to connect two electrical circuits maintaining a galvanic isolation between them, so that an electric charge does not pass; besides, an additional series resistance limits the current. Through a GUI developed as a control stage (with a digital control panel), the type of pulses can be chosen (conventional pulsing or packets of pulses (non-conventional pulsing)). The GUI allows the serial communication with the microcontroller to turn the CW laser off and on (0 and 1), forming squared pulses (from 250 µs to seconds). When standard pulsing is selected, the period and pulse width can be tuned; in the pulse-packets case, in addition to the mentioned temporal parameters, the number of pulses per packet and the separation between individual pulses can also be defined with some restrictions (for example, with no overlap between packets). All these digital instructions are received by the microcontroller, which finally drives the CW laser according to the modulation of the indicated temporal responses. The control circuit developed to generate the signal for the conversion of a CW laser to a pulsed laser is formed by a digital control, as shown in Figure 2. The circuit operates through the GUI to control and modulate the pulses, while the optocoupler (4N25) isolates the feeding stage of the pulse control with the power supply of the laser, since it operates at different voltages (5 V of the commercial microcontroller (Arduino Uno, Arduino, Ivrea, Italy) and 3.7 V of the laser for CW operation, according to the specifications of their respective technical sheets). To have an accurate and independent control of the laser current, the MOSFET (IRF640, Vishay Siliconix, San Jose, CA, USA) is used as a switch controlled by the signal generated from the microcontroller applied in the gate terminal, and it operates in the cut-off region (the OFF switch, which behaves as an open circuit between its source and drain terminals) and the saturation region (the ON switch, which behaves as a short circuit between the source and drain terminals with a very small resistance value). Therefore, the transistor MOSFETs are devices controlled using a voltage applied to the gate terminal (the MOSFET has a voltage in the gate terminal of 5 V, and a maximum current of 4 A in the drain terminal). In addition, its switching time is in the order of µs faster than bipolar junction transistors (BJTs). The minimum time response of our configuration is 250 µs (pulse width, period and so on). The factors that determine these limitations are the frequency of the microcontroller (16 MHz) and the pre-scaling factor (64 by default).

Results
The microcontroller-based pulsed laser reproduces the behavior of a mode-locked laser as a first outcome: periodic pulses, which is a synchronous emission of well-defined, identical and equidistant pulses. A variety of trains were produced, varying the temporal parameters. Figure 3a presents a train of pulses with a 60 ms duration and a period of T = 5 s (frequency of f = 0.2 Hz); this demonstrates the production of pulsed light (which is stable for hours) starting from a CW laser. Because the GUI allows the digital defining of both temporal parameters, pulses with arbitrary periods can be produced. In particular, they can have a period of a fraction of some base value, getting the behavior of those "multiple pulses" in mode-locked lasers [12][13][14][15]. As an example, a train of pulses (T = 2.5 s; f = 0.4 Hz) with half the period of Figure 3a is depicted in Figure 3b. Figure 3c shows a train of 10-ms-long pulses with a period of T = 0.25 s. Finally, a train of very long pulses (0.5 s) with T = 1.75 s is presented in Figure 3d. In this subfigure, the squared temporal profiles of the pulses can be appreciated; the low quality of the laser diode is responsible for the appearance of fluctuations in the peaks.
It is important to mention that the pulse peak power of this laser is equal to the average power of the original CW laser (1 W) because in this particular case the laser diode is completely turned off during the intervals between pulses, unlike mode-locked lasers; that is, there is no redistribution of energy. The background noise in the figures is due to experimental measurements carried out through the visible photodetector employed to send the optical signal to the oscilloscope (1-GHz real-time, Keysight MSOX6004A, Keysight Technologies, Santa Rosa, CA, USA). On the other hand, the spectrum corresponding to the pulsed operation is the same as in CW (a typical fine spectral peak, centered at 532 nm), since no nonlinear phenomena are involved, as in the case of mode-locked or Q-switch lasers. Beyond the synchronous optical pulsing, a non-conventional train of pulses was generated. Several asynchronous trains (aperiodic pulses) of periodic packets were produced; Figure 4 shows some of them. Figure 4a presents an emission of five periodic packets of three pulses with a duration of 8 ms individually. This train has a spacing between individual pulses of 0.5 s, and a period per packet (T p , interval between packets) of T p = 3.5 s. A second train of asynchronous pulses is presented in Figure 4b. These are packets of five pulses with a smaller spacing than in Figure 4a that have an individual pulse width of 10 ms, a spacing of 0.25 s and a period per packet of T p = 3.3 s (between packets). An eight-pulse packet with 50 ms individual duration is depicted in Figure 4c, in which the individual pulses are spaced by 6 ms with a period per packet of T p = 3 s. Finally, a packet of three very long pulses separated by 1.0 s, with T p = 6.5 s and with a pulse width of 0.5 s, is shown in Figure 4d.
These unusual asynchronous structures can be very useful for some applications like reproducing certain patterns such as biological responses (spiking activity) in the brain [43,44] or in the development of faster and more-efficient communication systems in neuromorphic hardware [45,46]. On the other hand, it is well known that optical pulses have some advantages over electric pulses, such as data transmission over long distances. In addition to transfer speed, light can propagate through vacuum, air and dielectric materials such as the silica of telecommunication optical fiber, whereas electricity needs a conductive medium (a metal). Optical fiber is widely used because, among other things, it is immune to electromagnetic interference. To confine optical pulses within a fiber, pigtailed laser diodes or an aligning system with a lens can be used. In addition to the types of pulsing presented here, future work will consider the generation of completely non-periodic pulses with the purpose of directly producing binary chains, post-synaptic structures or instructions to control robotic locomotion.

Conclusions
To the best of our knowledge, we present the first synchronous/asynchronous microcontroller-based pulsed laser: a very low-cost system capable of generating long square optical pulses (from 250 µs to s) displaying as the first stage a standard pulsed laser behavior. By defining the width and period of the pulse digitally in a developed GUI, tunable typical pulse trains were obtained without modifying the experimental scheme (cavity length), which is usually necessary in lasers such as those that are mode-locked. Beyond conventional pulsing, an asynchronous emission (aperiodic pulses) consisting of optical packets of several pulses was also produced, where the period per packet, duration, separation between individual pulses and the number of pulses per packet were controlled. Due to their temporal characteristics, the produced pulses starting from a CW laser diode may be suitable for certain applications where conventional pulsed lasers have no place, such as simulated spiking neurons, or the time response to control robotic locomotion. One of the major challenges in studying the brain is the computational capacity for the simulation of neural information processing. In this regard, given that Moore's law has reached its physical limits, a new architecture known as neuromorphic hardware has recently been recently proposed that attempts to model the complexity of the brain. Although this hardware has demonstrated a similar performance of different tasks when compared with conventional computers, its main advantage is low power consumption. Thus, the work proposed in this paper can contribute to the development of faster communication systems for the newer versions of such neuromorphic systems. Funding: This work was funded by the CONACYT project FC2016-1961 "Neurociencia Computacional: de la teoría al desarrollo de sistemas neuromórficos"; CONACYT CB 257691 and Cátedra 3155; Universidad de Guanajuato CIIC 110/2019.

Conflicts of Interest:
The authors declare no conflict of interest.