Driving touchscreen LED with IO pins

Status
Not open for further replies.

pjrcbear

Well-known member
Hi,

I'd like to control the LED of my touchscreen with IO pins from my Teensy 3.2.
My screen is the touchscreen sold by PJRC.

Currently its LED pin is hooked to VIN with 110 Ohm in series. The Teensy is powered by USB. VCC/VIN is 4.93V. The current to the LED is 19 mA.

I'd like to remove the hardwire from VIN to an IO pin on the Teensy so I can turn the screen on/off programmatically (I don't need values in between for now, but I guess I could PWM to control brightness more granularly).

The question is: can I hook up an IO pin to the resistor to the LED? Will the current drawn be "OK" for the teensy to take on? If not, can I combine multiple IO pins to provide "more current" while staying in range of a safe "per pin current rating"?

Thanks in advance!
 
According this document https://www.pjrc.com/teensy/K20P64M72SF1.pdf

- Maximum current single pin limit (applies to all digital pins) is 25 mA
- Output high current total for all ports is 100 mA

But I didn't find out, how much current the background led of that display takes. I think it's not likely that it would exceed 25 mA, but of course you could meter it.
 
I see a transistor and a FET on the Flexiboard, driving the bg LED. I think it's an overkill, for this display unit. But can't say anything sure without measuring the current.
 
I see a transistor and a FET on the Flexiboard, driving the bg LED. I think it's an overkill, for this display unit. But can't say anything sure without measuring the current.

In my current setup: LED pin is hooked to VIN with 110 Ohm in series. The Teensy is powered by USB. VCC/VIN is 4.93V. The current to the LED is 19 mA.
If I'm not mistaken that means 2.09V around the resistor, and 2.84V for the LED. So if I use a pin @ 3.3V and target 19 mA, the voltage around the resistor would be 0.46V (assuming LED is kinda constant - not sure that's a valid assumption), so I would need R=24 Ohm, and nothing else...

Does that make sense? I'm not a EE so I could really use another pair of eyes around this...

Thanks!
 
if 19ma is bright enough for you, why not.
i don't remember exactly, i think in the ILI9341 (used for the flexiboard) are 4 LEDs (20ma? each) so at least, a transistor or fet is needed. i wanted the maximum brightness.

but i'm not a EE, too.

If there is a more efficient way for the flexiboard v0.2: hints are welcome.
 
Last edited:
What I've seen so far with 19 mA is bright enough for me. I guess I can dial down the resistor to get to 25 mA.
I'm planning to implement a "screen saver" (which is more like a battery saver really) so it shouldn't be @ 25 mA for a very long duration anyway. That's why I need the pin-based control: to turn it off (I don't really care that much about the granular pwm/brightness control - on/off is good enough for me).
 
i don't remember exactly, i think in the ILI9341 (used for the flexiboard) are 4 LEDs (20ma? each) so at least, a transistor or fet is needed. i wanted the maximum brightness.
I have this screen from PJRC store http://pjrc.com/store/display_ili9341_touch.html

I just measured it: when the bg LED is powered by 5 V thru a 100 ohm resistor, it takes just about 21 mA. So it is well below 25 mA that one Teensy pin can source.

But a transistor or FET may be needed when using some other similar display, or when one want's to use the Teensy pins for other leds etc. So I think your flexiboard is fine as is.
 
Hooked up the screen LED to PWM pin 5 directly without any resistor. At max PWM value (255), the current is about 13 mA. Not super bright, but probably bright enough for now. Way under 25 mA pin max.
 
Status
Not open for further replies.
Back
Top