Repciu wrote: what is the maximum current that can flow through the diode?
The maximum current that can flow through the LED is given in the directory.
If you know the type of diode, you look in the application note there you have it:
conduction current Ip, maximum current Imax that can flow through this element without damaging the connector.
For the red LED it is about 25..30mA, I don't remember exactly, but in any case it does not exceed 30 [mA]
If you want its value to be, for example, 15 [mA], then depending on the value of the supply voltage, the value of the series resistor R must be:
1. I assume that the current flowing through the diode is 15mA
Id = 15 [mA] = 0.015 [A]
2. It is assumed that I will power the diode from a voltage of 20 [V]
Uz = 20 [V]
Ud = 1.2 [V] - voltage drop across the diode
3. I calculate the value of the resistor:
R = Uz-Ud / Id = 20-1.2 / 0.015 = 1253.33 ? = 1.3k? Its value is 1.3k?
4. Builds a circuit: instead of a fixed resistor with a value of 1.3k, I put a variable resistor of the same value, connect an ammeter in series and adjust it so that I get the assumed 15mA.
5. I disconnect the circuit and measure the value of the variable resistor with an ohmmeter and in its place I put a permanent resistor of the same value as I obtained when measuring the variable resistor.
6. It connects completely and I have a ready project
PS Points 4 and 5 are not necessary, I have just mentioned for understanding the problem.