Design of an Electro-Stimulator Controlled by Bluetooth for the Improvement of Muscular Atrophy

Muscle stimulation consists of a muscle's work when it is in constant exercise or contraction. This article presents an electro-stimulator design that generates electrical pulses in muscle cells through two electrodes positioned in an area of the body, causing the response of said cells to improve muscle atrophy. The steps that were followed were the construction of the block diagram, the design, and development of the circuit, the design and development of the control based on the pic12F683 and pic 16F690 microcontrollers, finally, the development of the software of the mobile application that controls the equipment using Bluetooth signals, based on the standard of IEC 60601-1 for basic safety and essential equipment performance. It was possible to obtain control of the frequency, application time, and amplitude of the duty cycle to have better results when applying therapy in specific areas of the body through the mobile application. Finally, the design is developed to respond to the user's parameters, using the Bluetooth of a mobile device and allowing the generation of electrical pulses in the muscle cells to improve muscle atrophy. The team can be part of therapeutic sessions for people with quadriplegia, improving the physiotherapy sessions performed on patients. Keywords—Design; electro-stimulator; microcontroller; electric pulses; muscular atrophy


I. INTRODUCTION
The World Health Organization (WHO) defines disability as "a generic term that encompasses deficiencies, activity limitations, and participation restrictions," all this in terms of the environment in which the person develops [1].
Within the context of disability, there are different types, of which we can mention cerebral palsy, Down syndrome, depression, so on. In the article "Disability in Peru: An analysis of reality from statistical data" [2], it is mentioned that in Peru, the reality of disability is not indifferent, thus having 10.4% of the general population has some disability, and in this subset, it has that 57% occurs in women and 43% occurs in men, within this population, we take into account those who have a motor or physical disability such as paraplegia, quadriplegia, amputations limbs, so on. Muscular atrophy and motor or physical disability refer to the consequence of having a disability, that is, muscular atrophy is the loss of muscle mass due to the lack of exercise or movement of muscles that are in the affected area [3]. In the field of medicine, specifically in the area of therapeutic treatments, It can find electronic equipment that gives us a facility for the implementation of these treatments, known as electro-stimulators [4], which seeks to replace the natural physiological stimuli of the body with electrical ones, caused from the outside by equipment with a specific potential and a given current form.
In Peru, one of the main problems with electrostimulation is the lack of application in the various forms of disability, being more specific about its use in the development of people's muscles. However, of the articles that have been reviewed to date, there are very few studies related to the design of a muscle electro-stimulator to muscular atrophy, especially in Latin America. That is why this work aims to design an electro-stimulator controlled by Bluetooth to improve muscle atrophy that will develop using electrical pulses in muscle cells through two electrodes positioned in an area of the body.
The rest of this paper is organized as follows: The second section is the background and related work. The third section describes the methodology. The fourth section presents the results and discussion of this research. Finally, this paper is concluded with the future works of this study.
II. THEORETICAL FRAMEWORK The application of engineering in the different fields of society seeks to generate a new way in which well-being and what is offered is in the best way. This research aims to develop a team that achieves favorable results in patients suffering from muscle atrophy by improving muscle function to improve their motor disability.
In this sense, the theoretical framework on the main concepts and related works of the research developed is presented.

A. Disability
Disability is a human condition, which every person can suffer, either temporarily or permanently. In turn, the WHO mentions disability as a generic term that can encompass deficiencies, limitations, and restrictions to perform motor activities.
It must be clear when talking about disability since there are different types, and in turn, within each one, we have the form and the degree with which it occurs. In the article by Jalayondeja et al. [5], it is mentioned that disability, from the medical point of view, can be classified into five categories, 439 | P a g e www.ijacsa.thesai.org and mentions motor or physical disability such as hemiplegia, paraplegia, and quadriplegia, limb amputations, poliomyelitis, arthritis; there is also intellectual disability [6], which are limitations in intellectual functioning and the development of adaptive skills; there is mental disability [7], which refers to biochemical alterations that limit thinking, humor, feelings, as well as behavior with others; when talking about sensory disability [8], it refers to the limitations in the function of perception of external sounds -hearing, objects -sight and finally there is multiple disability [9], as the presence of two or more disabilities.

B. Muscle Atrophies
To refer to muscular atrophies, we will first define what atrophy is; in [10] explains that atrophy refers to the decrease in the size of an organ due to loss of protoplasmic mass, it is necessary to specify that, unlike hypoplasia, where the organ does not develop or there is arrested development, atrophy is the reduction of the organ that reached its normal development.
In [11], they speak of muscle atrophy, referring to the wasting, thinning, or loss of muscle tissue due to lack of activity since it is found in long periods of rest.
Some diseases and disorders cause a decrease in muscle mass, including inactivity, cachexia present in cancer patients or heart failure, chronic obstructive pulmonary disease, extensive burns, liver failure, electrolyte disorders, anemia, so on. Other syndromes can cause muscle atrophy such as malnutrition, denervation of motor neurons, childhood spinal muscular atrophy, and inflammatory myopathies and dystrophies, among others.
There are different types of muscle atrophies [12]: physiological, which is caused by not using your muscles enough, can be reversed with exercise and good nutrition; pathological, which is caused by aging, starvation, and diseases, such as Cushing's syndrome, and the neurogenic that is due to an injury, or a disease, in the nerves that connect to the muscles. This type of muscle atrophy tends to happen more suddenly than disuse atrophy.
However, when it comes to diagnosis, the process comes in carefully reviewing the patient's medical history in search of family history or a disease that affects tissues or organs.

C. Electro Stimulating Equipment
An electro-stimulator is electronic equipment used in the development of protocols for performance evaluation and physical rehabilitation through electrical pulses. There are different electrostimulation equipment oriented to the sports field, health, among others [13].
The basis of electro-stimulators' action is based on the reproduction of the body's impulses, which are transmitted through the skin utilizing electrodes to the nerve fibers, respectively muscle fibers [14] [15]. For these purposes, it is essential to place the electrodes in various parts of the body; electrical stimuli are harmless and dynamic and do not produce pain. During the applications, It only feels a slight tingling or a slight vibration. The electrical impulses that penetrate the box influence the emanation of the nerve pathways and the nerve ganglia and muscle groups in application areas.
Neuromuscular electrical stimulation (NMES) has emerged as a new therapeutic alternative to improve patients' physical condition with muscle loss problems [16]. There has also been some rehabilitation research aimed at the particularities of women [17], and rehabilitations may even be carried out at a robotic level [18], where the development of a novel functional electrical stimulation system (FES) is presented. New approaches to emergent rehabilitation robotics propose residual muscle activity or limb movements during the neuromotor rehabilitation process.
Electrostimulating equipment contains different parameters that vary; one of these is the operating frequencies; Table I shows the frequencies at which it operates in a general way: Regarding the wirelessly controlled electro-stimulator, Araujo et al. [19] present an approach to hardware and software-controlled solutions in the field of electrical stimulation. A miniaturized, portable, and wireless electrostimulator was designed controlling the stimulation parameters in real-time for stimulation sessions with high flexibility and ease, using a friendly interface for a computer or Android platform that communicates with the portable and wireless device.

III. METHODOLOGY
As mentioned in the previous section, electrostimulating equipment is based on the generation of an impulse that generates the contraction of the cells, which causes a depolarization of the electrical changes.
Since the research is focused on the design of an electrostimulator, its design is based on the use of different parameters of the electrical signal that allows the prevention and treatment of muscle atrophy in patients, which must have a user interface-friendly machine for the application and control of said signals.
To start with the design of the equipment, some characteristics that must be met in order to make it safe and reliable for the user:  Have control of the parameters of the stimulation signal at all times.
 Maintain accuracy against input values such as supplied voltage and current. www.ijacsa.thesai.org  Comply with safety for both patient and user.
 Have a user-machine interface that is easy to use and implement.
The Block Diagram used in the electro-stimulator design is presented below.

A. Blocks Diagram
The user defines the parameters and time of application of the signal through the mobile equipment. With this information already determined, the microcontroller receives said instructions to generate the necessary routines and fulfill what the user is looking for. The signal generator with the signal already adapted goes through an amplification circuit, ending all this in the signal's adapter circuit to be transmitted through the electrodes positioned on the body.
In Fig. 1, the block diagram of the equipment is shown.

B. Design and Development of the Circuit
Having control of the parameters, such as the frequency and the operating time of the device, is a great advantage in terms of the application of therapy; all this is controlled from a graphical interface (computer with Android operating system), which communicates wirelessly with the computer through the Bluetooth protocol; the equipment has the PIC 16F690 as its receiver and the PIC 12F683 as the pulse generator.
The PIC 12F683 microcontroller produces two signals; the first is a square wave pulse train; this is going to be connected to a non-inverting Buffer (CD4050) that helps to adjust the signal of the electrical pulses to the base of the transistor to pass to the two-phase isolation coil. The second signal to generate is a pulse width modulation (PWM) signal, connected to a resistor-capacitive (RC) circuit, passed to an operational amplifier in non-inverting mode, with positive gain to amplify the signal. The LM 358 integrated circuit provides us with two operational amplifiers, one is used in non-inverting mode, at the + input of the amplifier with an RC circuit; this circuit is configured as a low pass filter, thus obtaining the pass of the frequencies low and reject high frequencies. For the calculation of the filter cutoff frequency, the following Eq. 1: Suppose the amount of ohms used is not adequate; for example, 1500 ohms, the work's intensity decreases. Consequently, the induction of muscle contractions is reduced; therefore, to achieve the desired effect, the current must remain constant despite variations in our body's resistance. In this case, 1000 ohms was used as resistance (R) and 1µF as a capacitor (C). Replacing is shown in Eq. 2: = 1 2 * 1000 * 1 * 10 −6 = 159. 24 = 159 The PIC 12F683 generates two PWM frequencies, the first of 490 Hz and the other of 980 Hz, all this in order to obtain an average voltage in the charge and discharge of the capacitor. This signal enters the pin + of the operational amplifier, which is in a non-inverting configuration with a positive gain. At the same time, the signal for the output must be conditioned; in this case, a train of pulses is generated which passes through the non-inverting buffer CD4050; A Darlington configuration is used for the amplification of the current using the NPN 2N2222 transistors, with that the signal already conditioned passes through the isolation transformer and is applied to the patient. For protection in this stage, a fast-acting diode 1N4148 is used.

C. Control Design and Development
About the control stage, two fundamental components are used for this equipment: the PIC 12F683 and the PIC 16F690, from the Microchip brand, they are high-end devices accessible to the market. Regarding the PIC 12F683 to implement the pulse width modulation (PWM), we use the CPP module; in this module, we have three types of operation: capture, comparison, and PWM. When the PWM module is activated using the CCP1CON register, different working frequencies can be generated, and there is even the option of varying the duty cycle while maintaining one frequency.
In this operating mode, the Prescaler is used, and TIMER2; the PR2 register varies from 0 to 255 (this being 8 bits but with the availability of being able to extend to 10 bits and work from 0 to 1024 as necessary), for its calculation Eq. 3: To calculate the Duty Cycle, we have Eq. 4: Regarding communication with the mobile device, the PIC 16F690 was used, which has various functions that facilitate its programming; this microcontroller processes the data it receives from the mobile device through the Bluetooth module. For this communication, the EUSART module (Enhanced Universal Synchronous Asynchronous Receiver Transmitter) was used, which works in asynchronous mode, since the Bluetooth module has an internal clock signal, the TXSTA, RCSTA, and BAUDCTL work registers are used.  Once the data transmission speed with which the microcontroller is working has been configured, the reception and transmission of this data are configured; through the Android application, the electrode site's configuration is configured, along with with the intensity and the time of the application of the electrical impulses. These signals are transmitted from the mobile to the microcontroller by the HC-05 Bluetooth module. Bluetooth is an open system communications protocol of IEEE 802.15, enabling data passage between devices through short-distance wireless communication around the 2.4 GHz free band [20].
It can be established that the design of the electrostimulation equipment controlled remotely by the user can contribute to the science regarding the use of the Myostimulation vest. Fig. 3 shows the electrodes' positioning in the Myostimulation vest developed suggested by Beurer [13]; this vest has the connection points in the lower part, where the equipment connects and generates the signal of the electrical pulses in patients. Likewise, the IEC 60601-1 standard recommendations were followed, which is a series of technical standards for the safety and essential performance of medical electrical equipment [21]. The standard's main requirement is the creation of an excellent and complete structure that must contain the complete documentation of the project development.

D. Mobile Application for Equipment Control
Our equipment parameters will be entered through a mobile device with an Android operating system [22]. In the current market, we have several programs for the development of these applications; the MIT App Inventor 2 software [23] contains two parts of programming: the first dedicated specifically to the graphic design of the user interface, and the second refers clearly to programming, this programming is by blocks of essential functions that are based on the C ++ language.
When starting the application, there is a screen with two buttons: "Bluetooth connection" and "EMS" the first button allows establishing a connection with the electro-stimulator equipment, and the second access the configuration of the equipment parameters. When you click on the "Bluetooth connection," it generates the second screen of the application to link the mobile device's equipment. (IJACSA) International Journal of Advanced Computer Science and Applications, Vol. 11, No. 10, 2020 442 | P a g e www.ijacsa.thesai.org The "EMS" button generates the second screen of the application in which several parts are shown: in the first, the application channel is selected, the equipment has four output channels, where you can select the four output channels or on the contrary, only the working channel; In a second part, you can select the team's work area, where you have four options, similarly when one is selected, it will turn green, while the others will turn lead, showing that they cannot be activated.
When selecting a part of the work, there are two images on the display screen. These images provide us with the positions in which we will connect the electrodes; As a third party, you have the program to select; this refers to the frequency of work that the equipment will have; as mentioned, there are seven work modes, and finally, two fields are presented to fill, the first one referring to the time of application of the equipment (in seconds) and the second field focused on the intensity, for this case there are intensities from 1 to 10. There is also a button called "Load" for the data established in applying to the electro stimulator equipment.
In Fig. 5, the interface of the mobile application with which the user interacts is shown.

IV. RESULTS
Having the PIC 12F683 generating the pulse trains and the PWM helps us better control the user's stimulation parameters.
In Fig. 6, the pulses at the output of the transformer are observed, which through the electrodes will be transmitted to the patient; in the image on the left side, we have a frequency of 50 Hz, thus obtaining the muscle firmness that the patient needs for the depolarization of muscle cells, while in the image on the right we have a frequency of 100 Hz, generating an explosive force in the muscle with which we will progressively contract the muscle obtaining a response in each muscle cell.
At the moment of stimulating a cell, a positive net internal charge effect is produced; this is given by a change in the ionic fluxes of Na and K, the K ions are directed towards the outside of the cell while the Na ions go inside; this movement produces the effect of positive net internal charge. Once the cells present a resting voltage, the stimulation that generates is that that voltage is exceeded, which will cause the membrane to depolarize.
According to the results obtained, you can control and select the different working frequencies and signal parameters.
Likewise, Table II shows the comparison between four implemented equipment, a commercial product that is sold in the market (BEURER EM80) [13], the other is a revised research work by Tame [24], the third equipment is the Muscular Strain of Different Whole-Body Electromyostimulation [25], and the fourth equipment is the one proposed in this study.
Within this table, it can notice the different characteristics regarding the proposed equipment, among which the following stand out:  The proposed equipment has an output signal based on biphasic pulse trains, compared to the other two devices www.ijacsa.thesai.org with a biphasic pulse signal or only non-biphasic pulse trains.
 By having a lower current than the BEURER EM80 equipment, the equipment's size is reduced.
 The proposed equipment has four application channels (8 electrodes) to better apply for the treatment programs.
 The four computers have a user interface, but it can be highlighted that the proposed equipment does not depend on the use of a screen on the equipment, that if the equipment fails, it will be inoperative.
 Compared to the three teams, an application for mobile devices was developed for the team, in which different actions will be generated for the team; on the contrary, the other two teams do not have this benefit.
 The mobile application presented has a registry of patients in which the equipment will be used.
 Besides, it also has a record of the results obtained in the sessions and displays different results.

V. CONCLUSIONS
A Bluetooth-controlled Electro Stimulator was designed to improve muscle atrophy. The equipment responds to the user's parameters through wireless communication from a mobile device, always considering the standards that govern its design. We have an EMS electro stimulator with components and materials to obtain muscle activation in the local market.
It was possible to build an interface for mobile devices with Android operating system, easy to use for the user or therapist, which allows us to connect with the equipment wirelessly through the Bluetooth protocol, having as possible future designs the incorporation of a web server such as use and storage of data where the therapist can easily access the patient's medical history.
It was possible to obtain control of the frequency, application time, and amplitude of the duty cycle to have better results when applying therapy in specific areas of the body, all this through the mobile device.
The team can be part of therapeutic sessions for people with quadriplegia, improving the muscular atrophies that these patients present. This equipment is exposed to improvements in its design and programming, the change in technology, and the initial algorithm's different parameters.
As future work, the design of the programming can be changed for use through web servers, with which the patient's medical history can be saved so that doctors can access it more easily. Likewise, you can double the pulse stage for conditioning and thus obtain more outputs for the application.