LCD Backlight Proper Wiring


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    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...

  2. #2
    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

  3. #3
    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.

  4. #4
    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, 20:14
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 20:54
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 17:56
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 27th June 2007, 00:07
  5. Easy LCD BackLight
    By Melanie in forum Schematics
    Replies: 0
    Last Post: - 17th October 2004, 14:18

Members who have read this thread : 0

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