I need to design a circuit that can control the amount of current that an LED draws (the LED is rated from 0 - 500 mA). The current drawn by the LED should be controlled in the code that the Teensy 4.1 is running, by probably varying the duty cycle of a PWM signal (since the Teensy 4.1 does not have a DAC).
I came across the following circuit here:
The circuit uses a control voltage (I figured that from the "CTRL2" terminal shown) and a sense resistor (SENSE2) to control the current flowing through the LED, that's pretty much all I know about the circuit.
I have been unable to construct this circuit since I do not know how exactly the sense resistor is doing its thing here.
How does this circuit work? What is this type of LED driver (current regulator) called? That would help me Google it at least.
Is it possible to control the same circuit by converting the PWM signal to an analog voltage and giving that to CTRL2 or is there a simpler way to achieve what I want to do?