I have a PQC1602K-SYL alphanumeric LCD display with a backlight LED. I would like to drive the LED using a microcontroller pin. How can I achieve that?
What I have tried
According to the data sheet, the LED requires 4.2 V and 100 mA.
My circuit works on 5 V, therefore I need to drop the voltage to 4.2 V. Using Ohm's law I have calculated that I need a 8 Ohm resistor, assuming 100 mA go through the LED. If I connect the LED directly to the supply, like in the following circuit, the LED turns on at full brightness. I measured the current that goes through the LED and I get about 85 mA. I am not sure why it is not closer to the specified 100 mA, though.
I can't substitute the power supply with the microcontroller's output pin because the 100 mA (or 85 mA ??) are more than the pin can supply, therefore I need some kind of buffer. I believe that a common solution is to use a transistor using a connection simmilar to the circuit below. However, my knowledge of transistors is very limited and rusty. I have tried to calculate the values of the resistors using Kirchoff's laws but I could not reach any meaningful solution. I then tried experimentally with some NPN transistor I had lying around and I managed to reach the desired voltage by completely removing the resistors, but I only get 30 mA through.
Please help me learn how to find the solution to this problem.