Control TFT Backlight.

Status
Not open for further replies.

Thread Starter

Pepe333

Joined Feb 12, 2018
86
Hi all!,
I'm interested in control the backlight of a TFT screen.
The idea is control bright from a pin out of a microcontroller. I tested some things, like to use a transistor NPN, but I must do something wrong, because I cant achieve the maximum bright (the Vcc is 3.3v from microcontroller, and with the transistor I achive 2.6v max, ¿¿3.3.-0.7Vbe??.
How can I do this?

Now I have a 2N2222(NPN) wired this way (but works like a switch)
-TFT GND to Collector
-Pin Out to RLim to Base.
-Emisor to general GND

Thanks in advance!
 

Thread Starter

Pepe333

Joined Feb 12, 2018
86
But this is the problem, I have 3.3V pin out from microcontroller. If I connect the LED pin from TFT to 3.3V the bright is high.
But the question is: ¿How can I achieve that pin out PWM working form 0V to 3.3V? The pin only can supply a 6ms current, so I need a transistor or something to amplify current.
 

ericgibbs

Joined Jan 29, 2010
21,425
hi,
Do you know how to program the MCU to give a PWM signal.?
Yes, you would have a transistor driver, connected to the MCU PWM output, via a 470R resistor.
You could use a Analog input with a potentiometer connected to 3.3v to enable PWM control.
E
 

ScottWang

Joined Aug 23, 2012
7,500
I saw some small TFT LCD which similar as yours and they used the voltage to control the brightness, so I think you could try to use the potentiometer(5K or 10K) from 3.3.V(pin 1) and Gnd(pin 3) and the pin 2 of potentiometer connected to the brightness control pin of LCD.
 

JWHassler

Joined Sep 25, 2013
308
But this is the problem, I have 3.3V pin out from microcontroller. If I connect the LED pin from TFT to 3.3V the bright is high.
But the question is: ¿How can I achieve that pin out PWM working form 0V to 3.3V? The pin only can supply a 6ms current, so I need a transistor or something to amplify current.
The reason that a 3V3 connected to the TFT gives full brightness is likely that that is seen as maximum PWM duty-cycle.
If the TFT module will work with the 3V3 outputs from your Arduino(?), it will be able to use the PWM from the same.
Try it: program up a PWM output on some pin and connect it to the 'LED' pin of the module.
Also: the amount of current the pin can supply is not an issue: you'll need less than 1mA.
 

philba

Joined Aug 17, 2017
959
I have that LCD display, or something very close to it. There are 2 variations for backlight: one with a built in driver transistor for the backlight LEDs and the other connects directly to the backlight LEDs. I suspect you have the latter and you are seeing the voltage drop from your transistor. See the images. Yours may be slight different. You can trace the LED pin if the image below looks significantly different. The version with the driver transistor (labeled Q1) works fine via 3.3V PWM. See the two images below. You may or may not have the eeprom footprint.

If there is only the VReg (labeled U1) then you have the latter version. A small mosfet like a 2N7000/2N7002/BSS138 or similar will give you less drop or you can just use 5V to drive the LED with an NPN BJT (with about a 100 ohm resistor). I believe the BL needs 30-50 mA for reasonable brightness though I've run one for hours at 80 mA with no apparent ill effects. PWM works fine. The backlight circuit is separate from the rest of the LCD so actual voltage won't matter, just current limiting.

2 questions:, what voltage are you supplying to the Vcc pin and have you closed the J1 solder jumper?

tft drive trans.JPG
tft no drive trans.jpg
 
Last edited:

philba

Joined Aug 17, 2017
959
By the way, this is a really nice display for the money ($6 or so from china). What you actually get is kind of a crap shoot though. I prefer the ones with the driver transistor. I bought 4 about 2 months ago via AliX and the image on the site showed no driver transistor. What I got has the driver so go figure. In my PCB layout, I have both a direct PWM interface and an NPN driver. I just populate the right one for which ever version of the LCD I install. A slight insulation to the vagaries of dealing with China.

Also, some units have a weird "white screen" problem that appears to be fixed by bypassing the VReg (closing the J1 solder jumper). Vcc pin must not exceed 3.3V in that case.
 
Last edited:

Thread Starter

Pepe333

Joined Feb 12, 2018
86
I have that LCD display, or something very close to it. There are 2 variations for backlight: one with a built in driver transistor for the backlight LEDs and the other connects directly to the backlight LEDs. I suspect you have the latter and you are seeing the voltage drop from your transistor. See the images. Yours may be slight different. You can trace the LED pin if the image below looks significantly different. The version with the driver transistor (labeled Q1) works fine via 3.3V PWM. See the two images below. You may or may not have the eeprom footprint.

If there is only the VReg (labeled U1) then you have the latter version. A small mosfet like a 2N7000/2N7002/BSS138 or similar will give you less drop or you can just use 5V to drive the LED with an NPN BJT (with about a 100 ohm resistor). I believe the BL needs 30-50 mA for reasonable brightness though I've run one for hours at 80 mA with no apparent ill effects. PWM works fine. The backlight circuit is separate from the rest of the LCD so actual voltage won't matter, just current limiting.

2 questions:, what voltage are you supplying to the Vcc pin and have you closed the J1 solder jumper?

View attachment 145775
View attachment 145777
Thank you!
I have the version without Q1, just the regulator. No, I dont closed the J1(I dont know how works). I supply 3.3V to the TFT, from the 3.3V output of an NodeMCU ESP32. I can't supply 5V because I want to control the bright by software, and the GPIO pins are 3.3V output.
 

Thread Starter

Pepe333

Joined Feb 12, 2018
86
The reason that a 3V3 connected to the TFT gives full brightness is likely that that is seen as maximum PWM duty-cycle.
If the TFT module will work with the 3V3 outputs from your Arduino(?), it will be able to use the PWM from the same.
Try it: program up a PWM output on some pin and connect it to the 'LED' pin of the module.
Also: the amount of current the pin can supply is not an issue: you'll need less than 1mA.
Thank you!
The board is a NodeMCU ESP32, works at 3.3V. I think my TFT need more power than 1ma and I'm afraid to damage the ESP32 if I connect directly.
 

Thread Starter

Pepe333

Joined Feb 12, 2018
86
hi,
Do you know how to program the MCU to give a PWM signal.?
Yes, you would have a transistor driver, connected to the MCU PWM output, via a 470R resistor.
You could use a Analog input with a potentiometer connected to 3.3v to enable PWM control.
E
Thank you!
Yes I know how to program a PWM output.
The problem is I want to control the bright by software, and with transistor, I cant achieve the 3.3v output (I dont know how to do it. I lost the 0.7V from Vbe)
 

philba

Joined Aug 17, 2017
959
OK, so you are supplying 3.3V to the Vcc pin? That goes through the VReg so that's where your 2.6V is coming from.

First, you need to run the board at 3.3V, not 2.6V. You have 2 choices:
- feed 5V to the Vcc pin. It goes through the onboard regulator. The board runs at 3.3V. You won't damage anything.
- close the J1 solder jumper and apply 3.3V to Vcc pin. That converts the board to 100% 3.3V operation.

Second, definitely use a BJT to drive the backlight LED. On the one I have with no drive transistor the LED anode is tied to Vcc but yours appears to have the cathode tied to ground.

[edit] With the cathode tied to ground, you may need to use a PNP to get full voltage if running off of 3.3V. Or maybe a mosfet like 2N7000, 2N7002 or BSS138.[/edit]
 
Last edited:

Thread Starter

Pepe333

Joined Feb 12, 2018
86
Please, check the attached file. What I'm doing wrong?
I don't know how to supply 3.3V to the Led TFT pin. How can I do it?

Sin título-1.jpg
 

ericgibbs

Joined Jan 29, 2010
21,425
hi P,
Have tried placing the TFT light pin in the transistors Collector.?
As you are using a Emitter follower connection in the circuit you posted, you will lose 0.7V across the Vbe.
E
 

philba

Joined Aug 17, 2017
959
First, fix your TFT display Vcc feed problem following either of the the steps I outlined above. Without doing that your backlight is starting at a disadvantage. Don't waste your time until you have done that.
 

philba

Joined Aug 17, 2017
959
No drawing is needed. Do the following:
  1. Remove the LCD display
  2. Warm up your soldering iron
  3. Look for J1, it is very close to U1.
  4. Tin the tip of of your iron with some solder.
  5. Put the tip of your soldering iron so the solder is on both pads of J1
  6. Count to 5 and then touch solder to the J1 pads. Get enough on them to form a big blob.
  7. Move the soldering iron back and forth to spread the solder blob across both pads.
You have now converted your LCD to 3.3V only operation. Put it back on your breadboard (or what ever) and try it. The Vb on your transister will probably be > 3V and that should allow an emitter follower to work.

Note: don't ever connect the Vcc pin to +5V unless you remove the solder jumper.
 

Thread Starter

Pepe333

Joined Feb 12, 2018
86
Oh, man!
Thank you very much for ypour explanation... it was very clear... maybe you forgot some important points:
1.1 breath.
2.0 plug the soldering iron
3.1 throw a fart

...but the question you didnt answer is: "How to amplify the current, of an output, from 0 to 3..3V from a GPIO giving a 3.3V max.
After your perfect explanation, can you explain how to achieve that?, maybe with a drawing?
 
Status
Not open for further replies.
Top