# Investigation of an LED Strip Controller Based on a PWM Driver and a PIC Series Microcontroller
## 3 Results and Discussion  
The electric circuit of the LED controller consists of a microcontroller, a power source, a DC/DC converter, optocouplers, and a BLUETOOTH module. The main electrical diagram of the LED controller is shown in Figure 2.  
Figure 2: Basic electrical diagram of LED lighting controller. The design and production of the electrical scheme were also part of the research, since the process included the search for original and optimal solutions and the process of optimizing the electrical circuits. The LED controller controls the light flux of the LED strips and other parameters by controlling the power supply of the LED strips and receiving information from motion sensors. Optocouplers are used to protect the microcontroller, through which information from motion sensors is also transmitted. By using optocouplers, it is possible to avoid random voltage jumps in the circuit (such jumps are likely to occur in a motion sensor circuit due to the random induction caused by extraneous sources) and thus protect the microcontroller circuit from damage [2; 3; 4]. In order for the user or the system operator to receive primary information about the operation of the LED controller, INPUT SIGNAL INDICATOR LEDS can be used, through the operation of which it is possible to understand whether the LED controller has executed the necessary commands and whether the main power source is switched on. In order to change from 12 V DC to 5 V DC, a DC/DC type converter was used. A voltage of 5 V was required to power the microcontroller. A bus with a programmer input was created on the PCB for programming the microcontroller. An ICS-type programmer was used for programming. The LED controller was designed and manufactured in such a way that its operating modes can be changed. For this purpose, a BLUETOOTH module was used to receive commands from a mobile application. The system components are closely related to each other and have a logical connection: the microcontroller program executes commands according to the information of the motion sensors and the BLUETOOTH module. Based on this information, the microcontroller controls the power supply signals to power the LED strips. In order to provide the user with initial information (about the state of the LED controller), information LEDs are needed. Meanwhile, optocouplers (as mentioned earlier) have a dual function, they protect against voltage spikes and generated electromagnetic noises that can occur in cables used for powering and controlling LED strips. The lighting mode and parameters of the LED strips are controlled using a PWM signal. A PWM driver was used to generate the PWM signal. The PWM driver receives commands from the microcontroller by changing logic states (see diagram in Figure 3). Based on the logic states/commands programmed in the outputs of the microcontroller, the PWM driver forms a PWM signal of the appropriate width/duration. In order for the LED strip to emit a lower light flux than the maximum value, it is necessary that the average electrical power of the PWM signal is lower than the maximum power supply of the LED strip diodes. In this way, by changing the duration of the PWM signal generated by the PWM driver, it is possible to control the light flux of the LED strip, since the average power of the PWM signal changes. The transfer of commands between the microcontroller and the PWM driver takes place using the I2C protocol. The PWM driver chip at the outputs cannot generate the necessary electrical power to power the LED strips. MOSFET-type transistors are used to power the LED strips, which are respectively controlled by the PWM driver by transmitting PWM pulses of the appropriate duration. According to the control pulses, power is transferred to the LED strip from the power source through the MOSFET. Such is the operational scenario for the power and control channels of one LED strip. The LED controller has 16 power and control channels for LED strips.