LCD16x2 backlight question

Hello, While starting the work on a project, I stumbled across some problems.

Firs problem: I bought a 16x2 HD44780 compatible LCD and successfully connected to an Arduino UNO. All is fine except backlight. The backlight works but it draws approx. 24 - 25mA from the digital pin with wich I want to control the backlight so i can turn it off along with the LCD using noDisplay(). I tried using a 56 ohm resistor, but the light is verry dim. Good news is, the backlight LED draws only 10 - 11mA. What's the best way to provide power to the backlight and keep the digital pins safe ?

Second problem: I want to attach an RTC module, some LED's, push buttons, temperature sensors (thermistors or LM335DZ - I think I will use LM335DZ for accuracy... ). Here come my question: how much current can be drawn from the +5V pin on the arduino? I was thinking about building a second PSU with a LM7805 and two caps to power the sensors and other stuff and connect to the arduino only the LCD module and RTC module. Is it better to use an external PSU or the +5V pin is enough to power all the current sensors/lcd/rtc module without problems?

Third question: If I want to build a 5V psu, Is it better to use an LM7805 or LM317?

The project will be battery powered from a 9V battery.

Thank you.

Sajuuk: The backlight works but it draws approx. 24 - 25mA from the digital pin with wich I want to control the backlight so i can turn it off along with the LCD using noDisplay(). I tried using a 56 ohm resistor, but the light is verry dim. Good news is, the backlight LED draws only 10 - 11mA. What's the best way to provide power to the backlight and keep the digital pins safe ?

Use an NPN transistor such as BC337 to switch the backlight, emitter to ground, base to the digital output pin through a 1k resistor, collector to backlight cathode, backlight anode to positive supply through an appropriate series resistor. As your project will be run from a 9v battery, I would connect that resistor to +9v instead of +5v to reduce the power dissipation in the voltage regulator. This will of course require a higher value series resistor. You can use PWM to vary the backlight brightness if you want.

Sajuuk: Second problem: I want to attach an RTC module, some LED's, push buttons, temperature sensors (thermistors or LM335DZ - I think I will use LM335DZ for accuracy... ). Here come my question: how much current can be drawn from the +5V pin on the arduino? I was thinking about building a second PSU with a LM7805 and two caps to power the sensors and other stuff and connect to the arduino only the LCD module and RTC module. Is it better to use an external PSU or the +5V pin is enough to power all the current sensors/lcd/rtc module without problems?

From that list of devices, the only one that takes much current is the LCD backlight, which is why I suggest powering it from 9v through a resistor (I am assuming that "some LEDs" means just a few, say 5 or less). So you don't need an external 5v regulator.

Thank you verry much for your reply.

I did not understand very clearly the way I should connect the transistor to the backlight an 9V battery :( :( If it is not a big problem, can you post a schematic ? At the moment I have a 2n3904, a BC547 and BC549. If I remember correctly I could use 2N3904 as replacement for BC337?

2n3904 has a lower current rating (200mA) than BC337 but will do for this application. Schematic attached.

Thank you verry much!!!
Now it’s clear.

Hello,

After a little digging around the datasheet I found the backlight information which I missed ( :( ) the first time I read the datasheet. I found out that the BL requires a minimum of 3V and 20mA. How would the schematic would change if I want to connect the BL to the 5V pin ? Thank you.

There's no problem drawing 24-25mA from a digital pin. You can even pull 30mA from it. Even a little more. Just find the resistor that makes the magic.

There's no problem drawing 24-25mA from a digital pin.

Correct --IF all you are using is that one digital pin. Otherwise you have to take into account the total draw from all of the I/O pins. The information is in the notes following Table 28-1 in the data sheet.

Don

Sajuuk: After a little digging around the datasheet I found the backlight information which I missed ( :( ) the first time I read the datasheet. I found out that the BL requires a minimum of 3V and 20mA. How would the schematic would change if I want to connect the BL to the 5V pin ?

Is 3v and 20mA really the minimum, or is it the maximum? The datasheets I have seen quote a maximum current for the BL and the voltage at that current, not a minimum current.

Because 20mA is quite low, you can drive that BL from a digital output pin without a transistor, as has already been said, just as you would drive a LED. You need a 100 ohm series resistor.

If you do use a transistor, then you can use the schematic I posted with either 9v or 5v powering the BL, just choose the series resistor according to the voltage.

floresta:

There's no problem drawing 24-25mA from a digital pin.

Correct --IF all you are using is that one digital pin. Otherwise you have to take into account the total draw from all of the I/O pins. The information is in the notes following Table 28-1 in the data sheet.

Yes, from 1, 2 or 3, or up to the port limit, and to the chip limit.

Is 3v and 20mA really the minimum, or is it the maximum? The datasheets I have seen quote a maximum current for the BL and the voltage at that current, not a minimum current.

Of course if he posted a link to the datasheet that he used we could actually evaluate the situation rather than having to speculate.

Don

dc42:

Sajuuk:
After a little digging around the datasheet I found the backlight information which I missed ( :frowning: ) the first time I read the datasheet.
I found out that the BL requires a minimum of 3V and 20mA. How would the schematic would change if I want to connect the BL to the 5V pin ?

Is 3v and 20mA really the minimum, or is it the maximum? The datasheets I have seen quote a maximum current for the BL and the voltage at that current, not a minimum current.

The maximum values are 3.2V and 25mA.
The 3V/20mA is the typical value. I don’t have in the datasheet the minimum value.

dc42:
Because 20mA is quite low, you can drive that BL from a digital output pin without a transistor, as has already been said, just as you would drive a LED. You need a 100 ohm series resistor.

If you do use a transistor, then you can use the schematic I posted with either 9v or 5v powering the BL, just choose the series resistor according to the voltage.

I think I would still use the transistor schematics, as I think this is the best way to do it.

This is the link to the datasheet of the LCD I have.
http://www.soselectronic.ro/a_info/resource/d/bolymin/BC1602A_series_VER02.pdf

LE: dc42, the R value from the formula you gave is in ohm or kilo-ohm ? I am asking because when I calculate the R for a 5V power source I get R=(5-2)/20 = 0.1 ohms!? or 100 ohms ?

Thanks.

This is the link to the datasheet of the LCD I have. http://www.soselectronic.ro/a_info/resource/d/bolymin/BC1602A_series_VER02.pdf

It's right there on page 13 or 14 (depending on which color LED you have). Use the value shown for the resistor that is connected between +5 and the upper LCM terminal.

Don

I've seen that page but I don't know if I have edge BL or matrix BL. The collor is green. Another thing I don't know is if the LCD itself already has a current limiting resistor on the BL+ pin.

Sajuuk: I've seen that page but I don't know if I have edge BL or matrix BL. The collor is green. Another thing I don't know is if the LCD itself already has a current limiting resistor on the BL+ pin.

You will have to help yourself. No one has seen a single picture of your actual display since you started the thread. The page 4 of the spec sheet details (best I've ever seen lately) how to read their part numbers. Your concern in position 6 about what back light you have. Provide either a picture or your part number.

liudr:

Sajuuk: I've seen that page but I don't know if I have edge BL or matrix BL. The collor is green. Another thing I don't know is if the LCD itself already has a current limiting resistor on the BL+ pin.

You will have to help yourself. No one has seen a single picture of your actual display since you started the thread. The page 4 of the spec sheet details (best I've ever seen lately) how to read their part numbers. Your concern in position 6 about what back light you have. Provide either a picture or your part number.

Ok.. I should stop doing hobby electronics at late hours. I missed reading in the first pages of the datasheet... It's LED Array. Now I guess I have all the answers I need to do this.

Thank you all for being patient with me. :) A.

Sajuuk: LE: dc42, the R value from the formula you gave is in ohm or kilo-ohm ? I am asking because when I calculate the R for a 5V power source I get R=(5-2)/20 = 0.1 ohms!? or 100 ohms ?

If you express the current in amps, the result will be in ohms. You said that the backlight drops 3v at 20mA. So R = (5-3)/0.02 = 100 ohms.

You said that the backlight drops 3v at 20mA.

But that was apparently incorrect since those are the values for a white/blue LED and he now tells us that the LED is green.

Your calculations do agree with the values that they show on the diagram for the white/blue LED so we can rest assured that Ohm's Law has not yet been repealed.

Don