help with driving lamps from a LED driver

Discussion in 'The Projects Forum' started by ruprecht, Aug 11, 2009.

  1. ruprecht

    Thread Starter Well-Known Member

    Mar 25, 2004
    73
    0
    Hi all, long time.

    I'm working on a project for my simulator cockpit which I have some ideas on, but am being a bit careful so as not to damage my electronics. Hopefully I'll describe the problem sufficiently well for someone to fill in the blanks for me!

    I have a PhidgetLED64 output module attached to my PC. It has 128 output pins, of which I'm only concerned with 10: 5 pairs of anode/cathode pins.

    In software, I can drive a variable current down those pins. The anode pulses a square wave at about 13kHz, 50% duty cycle from 0V to 3.3V DC. At full power, the anode sources 30mA; this is controllable from 0 to 30mA in 100 linear steps (noting that due to the 50% duty cycle from the anode voltage PWM, it is effectively 15mA).

    Essentially, the board is designed to have LEDs attached directly to it. No current limiting resistor is needed, as the anode is designed as a constant current source.

    However, I want to attach 12V lamps to them. This is the problem.

    Now my first idea was to use an optocoupler (essentially a LED right?) on the output pins, which would trigger a solid state relay to drive the lamps. But the PWM gave me cause for pause there and I wondered if I'd have issues with relays.

    Can anyone suggest the bit in the middle, between the output A/K and the two lamp pins, assuming a separate 12VDC supply?

    *edit* and my usual supplier is Jaycar in Australia, hopefully all required components would be available there.

    Many thanks
     
    Last edited: Aug 11, 2009
  2. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    Hey, do you need to vary the current level to the 12v bulb? Or just switch it on and off?? What is the current rating for the bulb? Just switching on and off can be achieved with a power transistor along with a normal transistor. Varied output can be handled with a transistor along with a TRIAC. Relays aren't really necessary.
     
  3. ruprecht

    Thread Starter Well-Known Member

    Mar 25, 2004
    73
    0
    Hi,

    Sorry should have said, I just want them on or off. I'm not sure on the current rating of the bulb, it's not well documented. I'll stick my multimeter on it and see.
     
  4. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    If its a bulb similar to the one used in a car, it might be somewhere between 10-20w.
    However, if it is below 10W, a BD139 would be sufficient.
    This might help. A capacitor in the inputs will be necessary if its PWM.

    [​IMG]
     
  5. ruprecht

    Thread Starter Well-Known Member

    Mar 25, 2004
    73
    0
  6. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
  7. ruprecht

    Thread Starter Well-Known Member

    Mar 25, 2004
    73
    0
    Yep, SPDT illuminated switches :) They contain a 12V lamp that is integrated with, but separately activated to, the switch.
     
  8. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    If you could tell the correct current draw, it would be easier. But Those wont need more than 2W, I guess they are 0.5W. I guess AC127\AC187 instead of that TIP would do just fine at 1W.
     
  9. ruprecht

    Thread Starter Well-Known Member

    Mar 25, 2004
    73
    0
    Hiya, just finished measuring the lamps. They draw 40mA at 12VDC, so 0.5W roughly.
     
  10. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    So you can try AC127 or 128
     
  11. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    AC127/AC128 are 50 years old germanium transistors that have not been made for many years.
     
  12. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    I had one for many yrs until one day it blew up on some short circuit. I thought it was still in production.

    Hmm... 2N2222 alone will do the job as it has an Ic max of 800mA where 40 is only required and is a 500mW transistor.

    So wire a 2N2222 with base to your LED line through a 1K resistor, Emitter to GND and collector to your 12v bulb . Thats all what you would need.
     
  13. ruprecht

    Thread Starter Well-Known Member

    Mar 25, 2004
    73
    0
    Thanks for the replies. I mocked up the attached using components I had to hand. Would this be close? I would like to isolate the Phidget from the lamp circuit for a number of reasons, chief of which is that I don't trust myself not to melt it :)

    Also how would I determine the type and size of smoothing cap to use?

    BD135: http://jaycar.com.au/products_uploaded/BD135R07.pdf
    MOC3021: http://jaycar.com.au/products_uploaded/ZD1920.pdf
    Lamp draws 40mA at 12V as previously noted
    PhidgetLED64 output is a constant current source @ 30mA, on a 0-3.3V 13kHz square wave, 50% duty cycle.

    Many thanks

    *edit* as alternative transistors, I also have 2N3904 and BC107B available.
     
    Last edited: Aug 16, 2009
  14. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    That would do. Capacitor value >= 2.2uF would be enough. I hope.
     
  15. ruprecht

    Thread Starter Well-Known Member

    Mar 25, 2004
    73
    0
    OK thanks! I'm gonna go wire it up and see if the magic smoke stays inside.
     
  16. ruprecht

    Thread Starter Well-Known Member

    Mar 25, 2004
    73
    0
    Alright: good news and bad news.

    Good news is all the magic smoke is still inside, and the optocoupler does seem to work. With the phidget power set to 0 (0mA) there is no current through the opto output. At full power on the phidget, there is 0.045mA at 0.8V through the opto output.

    Bad news is: the lamp stays on all the time, regardless of the phidget power (and even with it totally disconnected). There is always a constant 1mA through the Base, at about 0.8V. I tried disconnecting the cap, it made no difference.

    Any ideas? I triple checked the connections, even took it completely apart and rebuilt it. Same problem.

    Is the attached more sensible?
     
    Last edited: Aug 16, 2009
  17. eblc1388

    Senior Member

    Nov 28, 2008
    1,542
    102
    I'm sorry, no.

    The MOC3021 is an opto-TRIAC for AC usage and its use here is inappropriate.

    I would suggest the follow circuit, which uses only 4 components and is proven to work in simulation. :)

    Just drives the LED inside the optocoupler using interface board and you can turn ON/OFF the 12V Lamp. You don't need "the link" as shown in the image as it is for simulation purpose only.

    You can use any general purpose MOSFET like 2N7000, 2N7001 or 2N7002 etc.... They are the size of a small TO-92 transistor.

    If you have component selection questions, you can post here.

    [​IMG]
     
    Last edited: Aug 18, 2009
  18. Søren

    Senior Member

    Sep 2, 2006
    472
    28
    Hi,

    No, but you can use this:
    [​IMG]
    (A 2N2222 should do as well)
     
  19. jj_alukkas

    Well-Known Member

    Jan 8, 2009
    751
    5
    Søren ,

    Isn't the above ckt configured for a low logic enabled output?? Or will the phototransistor in the opto always give a low till the LED fires to make it high?? Im confused.
     
  20. Søren

    Senior Member

    Sep 2, 2006
    472
    28
    Hi,

    When the LED in the coupler fires, it pulls the base of the PNP transistor low to open it.
    LED ON => Lamp ON
     
Loading...