Controlling the Power Supplied to Touchscreen's LED Pin

Status
Not open for further replies.

Haybur

Active member
I'd like there to be a button on the touchscreen that cuts power to the screen's LED pin, and then any touch on the screen restores power. Even with nothing on the screen, the backlight is too bright to have the screen displayed next to my LED strip.

Ideas I have:
1. Use a PWM or digital pin to provide power to the screen's LED pin
2. Use a transistor controlled by a digital pin to provide power

I'd like to do option 1 since it doesn't add any hardware components. I'm just concerned that the screen may require more current than a digital pin can supply. I'm also wondering if I'd still need the 100 ohm resistor between the power source and the screen.
 
To pin that down you need to know more about the design of the screen. Some already have a FET drive for the backlight so that makes it easy to PWM etc, others directly drive the LED from the pin and you'd need to find the current draw, either by measurement or from some sort of data sheet. Basic rule of thumb suggests that if there are visibly more than 2 LEDs in there you will be exceeding the pin drive capability and need to have a transistor drive stage.
 
Thanks Gremlin. If I tried powering it straight from a digital pin to see if it'd work, is there a chance I can damage the board if it draws too much current?
 
Yep. It's not garunteed and have seen them survive pretty horrible things but you risk not just damaged to the pin but also to the entire CPU if you manage to exceed it's total current capacity as well.

If you want the poke it and see approch a 330 ohm resistor will clamp current to 10mA for a connection to ground, which is inside the pin capacity. If you know more about the diode voltages you can reduce that staying inside 10mA but would be a starting point. If they are white LEDs the may not even light from a 3.3V supply and 10mA is not very much in lighting terms (3.3V @ 0.01A = 33mW of light if magically 100% efficient).
 
I'm guessing from 100Ohm comment that you have the PJRC ILI9341 touchscreen. The digital pins will only output 3.3V which is a huge difference compared to powering the backlight from 5V.

You can use multiple pins to share to the current. E.g. like this:
Code:
         pin 1  ----- 200 Ohm -----|
Teensy   pin 2  ----- 200 Ohm -----|------ backlight
         pin 3  ----- 200 Ohm -----|
         pin 4  ----- 200 Ohm -----|

I'm guessing that 200Ohm is a good value. 4x in parallel are effectively 50Ohm, which will somewhat compensate for the lower voltage. 200Ohm @ 3.3V is 16.5mA max, well below the absolute maximum rating of 25mA / per pin current for Teensy 3. Make sure the current is 9mA or less, that's what the Teensy is rated for (continuous operation). (9mA corresponds to a voltage of 1.8V across the 200Ohm resistor.)

You can control brightness by driving less pins. Set the pins to open drain output mode or input mode to turn them "off". Don't drive a mix of them low / high, you will have a high current flow between them (but there won't be damage if you only do it briefly).

To set the pins to high drive strength (otherwise you only get 2mA per pin):
https://forum.pjrc.com/threads/31941-Connecting-SPI-Device-on-Teensy?p=91453&viewfull=1#post91453
 
Status
Not open for further replies.
Back
Top