How to control the current in a LED

As we know, LED is a light-emitting diode which is restricted to its breakover current. If the current value through LED is higher than its limitation, the LED will be damaged. Based on this, LED must connect to its own current limiting series resistor which we can also use for controlling the brightness of LED. In this tutorial, we’ll build a buck converter for LED considering its low required voltage and use a PI controller to control the current of LEDs as below. The idea of PI controller is to measure the current value of the four series LEDs and then compare it with the reference current (If=350mA) for adding a decision of the switch in the buck converter. Since the reference current is 350mA, the voltage of the current limiting series resistor shall be 350mA*2.2 ohm. That’s the grounds that we use a voltage sensor in this schematic.

<br>Click to close the image

To build the above schematic, the necessary components are as below. To select the components from component list, find out the location of the necessary component, left-click the component and release the mouse button, and then move your mouse cursor into the workscreen and left-click again. The parameters of each component are shown in brackets behind. Right-click components for editing the required parameters.

Using components:

We can find the above components in the following paths:

<br>Click to close the image

We can find the above components in the following paths:

<br>Click to close the image <br>Click to close the image <br>Click to close the image <br>Click to close the image

Simulation parameters: (Go to Simulation/Simulation Parameters or click the short-cut button in the menu bar)

After configuring all the necessary parameters, go to Simulation/Start simulation to execute the simulation or click the short-cut button in the menu bar and get the following result.

<br>Click to close the image

The first blue curve is the output voltage of buck converter. The red curve is the current vale through the four LEDs and sky blue is the current reference value. The reference current is often set 300mA but up to 350mA.

<br>Click to close the image

The control signal from PI controller to the switch of buck converter.

<br>Click to close the image

For controlling the brightness of LED, we can also change the reference current to 300mA so that feedback voltage will become 0.66 V. Modify the third input trace of the first scope to 0.3 A (300mA) and re-run the simulation.

<br>Click to close the image

Get the following result and see if the PI controller works well (restrict the current via LED according to the reference current 300mA).

<br>Click to close the image
© 2024 CASPOC, All rights reserved. Home   |   Terms and Conditions   |   Legal   |   Export Compliance   |   Privacy Policy   |   Site Map