LCD Backlight Proper Wiring


Closed Thread
Results 1 to 12 of 12
  1. #1
    Join Date
    Jan 2008
    Location
    Pennsylvania
    Posts
    113

    Default LCD Backlight Proper Wiring

    What would the proper way to wire the LCD backlight to a port and setting that port so that it comes on. Currently I wired the backlight to +5v on the plus side and the minus side of the LCD backlight to portd.0. The LCD backlight is an LED. So to turn the backlight on I set LOW PORTD.0 which I understand and to turn it off I set it HIGH. This method puts +5vdc on the LED at all times. Of course it does not come on until I set portd.0 low which is understandable. I'm just trying to figure if this is standard way to hook something like this up. Can a variable be set to HIGH to end this confusion?
    I'm sure this is a dumb simple question but I'll ask anyway.
    Example:
    _OFF = High
    _ON = LOW
    portd.0=_on
    Thanks
    David

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DavyJones View Post
    What would the proper way to wire the LCD backlight to a port and setting that port so that it comes on. Currently I wired the backlight to +5v on the plus side and the minus side of the LCD backlight to portd.0. The LCD backlight is an LED. So to turn the backlight on I set LOW PORTD.0 which I understand and to turn it off I set it HIGH. This method puts +5vdc on the LED at all times. Of course it does not come on until I set portd.0 low which is understandable. I'm just trying to figure if this is standard way to hook something like this up. Can a variable be set to HIGH to end this confusion?
    I'm sure this is a dumb simple question but I'll ask anyway.
    Example:
    _OFF = High
    _ON = LOW
    portd.0=_on
    Thanks
    David
    Hi David,
    It is not uncommon for devices to be "hot" and the controller provides ground, usually through a transistor (I am thinking back to my days as a mechanic) even those pretty excuse me lights on the top of opieDog's G ride are done that way. What you can do rather than using PORT HIGH to turn it off is tristate the port by TRIS 1 . The downside to this is you now have a noise antenna, so use plenty of bypass filters, caps, choke . . .
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    The way you have it wired is fine... providing you have a current limiting Resistor in series somewhere.


    Backlight var PortD.0

    LightON con 0
    LightOFF con 1

    .. ..

    Backlight=LightON

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Some of the LCD backlights I've come across will draw 100ma or more depending on brightness. Big 4x20 displays.

    You might want a transistor in there, since the PIC pin can only sink 25ma.
    <br>
    DT

  5. #5
    Join Date
    Jan 2008
    Location
    Pennsylvania
    Posts
    113


    Did you find this post helpful? Yes | No

    Default specs on backlight

    Thanks everyone.
    Odd the specs don't say what ma the backlight will draw/require or I am blind, probably blind....

    It just says typical voltage 4.2 to 4.6v

    Without knowing the current it will draw what would you suggest for a limiting resistor value?
    thanks
    David

  6. #6
    Join Date
    Jan 2008
    Location
    Pennsylvania
    Posts
    113


    Did you find this post helpful? Yes | No

    Default Limiting resistor

    I just got off the phone with New Haven display and they said that it is typically going to draw between 120 and 150ma for this backlight. He also said that on the back if R7 has a resistor then I don't need a current limiting resistor just hook up 5vdc to it and I will be fine. So I guess that answers that?
    Thanks
    David

  7. #7
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    In this day and age, any B/L drawing more than 25mA is pretty poor design!!! You need that Transistor (or spare driver on a ULN2004 or similar if you're also driving relays and things)... but then that simplifies your B/L software...

    Backlight var PortD.0

    .. ..

    High Backlight ' Turn ON B/L
    Low Backlight ' Turn OFF B/L


    You can also run the B/L through a spare Hardware PWM Channel... then you can vary the Brightness (as you can with Contrast) to the Users comfort preference. This is handly... B/L's wear out and age (especially the White LED types which tend to be driven at their extreemes)... if normal operation is about 40% of PWM, as it ages you can just increase the Brightness. Typically, white LEDs start to deteriorate after 2-3 years of continuous use... the Punter sends the unit back for repair because it's looking a bit 'dull', you increase the PWM up to 60% (via a secret software SETUP) and charge a few $$ for the repair... geeze... how many money-making business ideas can a girl give out on a public forum...

  8. #8
    Join Date
    Jan 2008
    Location
    Pennsylvania
    Posts
    113


    Did you find this post helpful? Yes | No

    Default Much thanks...and a follow up question(s)

    Melanie, Thanks for the great tips. I think I am just going to add a couple
    2N2222's to my circuit to take care of the relays I am drving and the LCD backlight for now. I see on rentron.com he's using the 2N2222 with a 10k resistor as a relay driver so I would assume that driving the LED for the backlight the 2N will work just as well. The specs say it will drive up to
    600ma so I should be good to go with those, see any problems with that? So let me ask a stupid question. As long as whatever device I am going to drive stays within the boundaries of being able to be driven by TTL signal I'm ok coming directly off a pin on the pic, perhaps I may need a pull up or pull down resisitor but I won't be overdrawing current that could damage the pic correct? Now for the really stupid question which really shows my lack of electronics knowledge the relays I am going to be driving are +12vdc. It's ok to mix that +12vdc through the 2N2222 to drive those right? If that is so stupid you don't want to answer I will understand.

    Thanks
    David

  9. #9
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    A ULN2004 has 16 pins and is one component. (of which 60% will remain unused and available for future expansion.

    Two Relays need (a) a Transistor each (3 pins), (b) a Base Resistor each (2 pins), and (c) a Diode across the Relay coil to surpress the back-emf each (2 pins) each. The LED will require a Transistor (3 pins) and a Base Resistor (2 pins). That's eight components and a total of 19 wires to solder (and a lot more money!). So make work for yourself...

    You don't need a pull-up or pull-down Resistor if your PICs initialisation is quick enough... but if you're sloppy, those Relays will need a pull-down (two more components and another four soldered joints).

    The 12vDC current path goes through the Transistor and not through the PIC. The PIC is just driving the Transistors Base (through a limiting Resistor). The next question you haven't asked yet is the value of the Base Resistor. Well, how much current do you want the transistor to draw through the Emitter/Collector junction. 10k may well be good enough for your Relays which are probably around 30mA each, but you may need a lot lower value for 120mA of Backlight.

    The plain vanilla 2N2222 has a gain of 100 (Datasheet). So a 10K Resistor at 5v will draw 500uA through the Base multiplied by the device gain is good for upto a 40-50mA load (simplified explaination but will suffice here). A 120mA load will require about 1.5mA through the Base... well you can do the math...

  10. #10
    Join Date
    Jan 2008
    Location
    Pennsylvania
    Posts
    113


    Did you find this post helpful? Yes | No

    Default I like soldering (not!) Good advice thanks.

    Melanie, I think you're going to have to start to charge tuition... I realize we've gone beyond a question regarding a general pic question I hope you don't mind the follow up. If I just asked you for the value of the base resistor I would not end up learning anything it would just show I am lazy and I am not.

    Ok so let's say I just want to drive the backlight and go with a 2N2222 to accomplsih this. If I review the data sheet and the calculation I've looked up to calculate the needed base resistor I get: (Sorry if my symbols aren't exactly accurate. Hfe and Vbe from the datasheet)

    Ib = Ic / Hfe = 120ma/100 = .120/100 = .0012
    Rb = (Vdc - Vbe ) / Ib = (5 - .6 ) / .0012 = 4.4/.0012 = 3666 = 3.7k

    If I add in a 30% extra 5 - .6 / .0012 * 1.3 = 4.4/.0015 = 2933 or approx 3k on the base resistor.

    Did I get close?
    Thanks again for your advice and assistance.
    David

  11. #11
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Yes, you're good to fly solo on that one.

  12. #12
    Join Date
    Jan 2008
    Location
    Pennsylvania
    Posts
    113


    Did you find this post helpful? Yes | No

    Default Good news

    Quote Originally Posted by Melanie View Post
    Yes, you're good to fly solo on that one.

    I couldn't have done it without you! Thanks very much for getting me pointed in the right direction.

    David

Similar Threads

  1. Is this code not initialising the LCD properly?
    By Platypus in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th January 2010, 19:14
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  5. Easy LCD BackLight
    By Melanie in forum Schematics
    Replies: 0
    Last Post: - 17th October 2004, 13:18

Members who have read this thread : 1

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts