0
A lesson learned
Posted by Chris
on
Tuesday, December 29, 2009
Something that has been bugging me for a little while now is the backlight on our ScoreSure Golf Pro device. It works fine when a 3V3 supply is put to it. But the PIC microcontroller can't provide enough current to drive it directly from one of the output pins. So we've been using a transistor (an NPN BP199 from Farnell if you must know) to switch the backlight on and off via an output pin on the mcu.
It works, but we've never been 100% happy with it.
The backlight comes on, but it's noticeably dimmer when the transistor is used, compared to just connecting power to the LED anodes. But we've got to the bottom of it - it's all to do with using the microcontroller to "sink" or "source" the power to the backlight LEDs.
Here's how to use an mcu and transistor to "source" current for the LED backlight:
When the PIC micro backlight output pin is high, the transistor allows current to flow from the power source into the LCD backlight LED anode (LCD_A+).
Here's how to use an mcu and transistor to "sink" current for the LED backlight:
In this example, the power is always connected to the backlight LED anode (LCD_A+), but the transistor only allows current to flow from the LED cathode (LCD_K-) to ground when the PIC backlight output pin is high. This is known as "sinking" current.
The two switching techniques both work - only "sinking" the current makes the LCD light up nice and brightly, whereas when "sourcing" current through the transistor, the LCD does light up, but more dimly.
It works, but we've never been 100% happy with it.
The backlight comes on, but it's noticeably dimmer when the transistor is used, compared to just connecting power to the LED anodes. But we've got to the bottom of it - it's all to do with using the microcontroller to "sink" or "source" the power to the backlight LEDs.
Here's how to use an mcu and transistor to "source" current for the LED backlight:
When the PIC micro backlight output pin is high, the transistor allows current to flow from the power source into the LCD backlight LED anode (LCD_A+).
Here's how to use an mcu and transistor to "sink" current for the LED backlight:
In this example, the power is always connected to the backlight LED anode (LCD_A+), but the transistor only allows current to flow from the LED cathode (LCD_K-) to ground when the PIC backlight output pin is high. This is known as "sinking" current.
The two switching techniques both work - only "sinking" the current makes the LCD light up nice and brightly, whereas when "sourcing" current through the transistor, the LCD does light up, but more dimly.