The TL431 is a three-terminal programmable shunt regulator diode. It has two different packages, T0-92, SOT-23-3, and SOT-89
It has three pins:
The TL431 usually combined with an optocoupler, it works in a similar way 2.5V voltage error amplifier, so we need to connect a compensation network between R-pin and K-pin. Prevent TL431 oscillations, and R-pin as the input of voltage error amplifier, and K-pin as the output of the voltage error amplifier.
In the switching power circuit, TL431 is used to control the output voltage. The range of output voltage is 2.5V-36V. as shown in the circuit diagram below, adjust R1 and R2 to set the output voltage.
V(output) = 2.5 * (1 + R1 / R2) V. For example:
If we want output 12V/1A, R1 = 14K R2 = 3.6K V(output) = 2.5 * (1 +14 / 3.6) = 12.2V
And we always connect R and K in the circuit, this will get an accurate output 2.5V.