Author Topic: Custom Lighting  (Read 2955 times)

0 Members and 1 Guest are viewing this topic.

Offline Melvang

  • Exquisite Lord of Bumfluff
  • * Maker
  • Thread Starter
  • Posts: 4398
  • Location: Waterloo, IA
  • Melvang's Desktop Customs
Custom Lighting
« on: Wed, 02 October 2013, 07:57:26 »
So I have an idea for lighting my keyboard, and have some questions.

Basically what I am wanting to do is use an LED under my Esc key and CCFL bulbs for the keyboard for the chassis (pics will be provided when finished).  Now what I want to do with this is have the Esc LED function as my HDD LED (I have already done this) and the chassis lighting stay steady.  But when holding the Function key down have the roles reverse.  Is this possible to do with hardware alone?

I know that the HDD LED voltage is way to low for the CCFL's.  Any ideas on how to accomplish this?  My Function switch is going to be a panel mount toggle switch if this helps.  I have not purchased yet so if i needs to be DPDT i can get that.  If this is possible what else would I need to purchase to get this to work (relays etc.)?  If it helps the HDD LED is in the 3.2 volt range.
OG Kishsaver, Razer Orbweaver clears and reds with blue LEDs, and Razer Naga Epic.   "Great minds crawl in the same sewer"  Uncle Rich

Offline Photoelectric

  • * Administrator
  • Posts: 6766
Re: Custom Lighting
« Reply #1 on: Wed, 02 October 2013, 08:40:25 »
Why CCFLs, if you don't mind me asking?  Why not more LEDs?  (and I did not realize you can have them in small sizes).
- Keyboards: LZ-GH (Jailhouse Blues)M65-a, MIRA SE, E8-V1, MOON TKL, CA66
- Keyboard Case Painting Tips -
- Join Mechanical Keyboards photography group on Flickr -

Offline Melvang

  • Exquisite Lord of Bumfluff
  • * Maker
  • Thread Starter
  • Posts: 4398
  • Location: Waterloo, IA
  • Melvang's Desktop Customs
Re: Custom Lighting
« Reply #2 on: Wed, 02 October 2013, 08:42:28 »
Why CCFLs, if you don't mind me asking?  Why not more LEDs?  (and I did not realize you can have them in small sizes).

The extra heat generated here is negligible in this application.  And yeah I have seen CCFL's in 15", 12" (this being most common), I think I have seen 8", 6" and 4".
OG Kishsaver, Razer Orbweaver clears and reds with blue LEDs, and Razer Naga Epic.   "Great minds crawl in the same sewer"  Uncle Rich

Offline Neebio

  • Posts: 115
  • Location: Canada
  • Dance Master
Re: Custom Lighting
« Reply #3 on: Wed, 02 October 2013, 16:07:28 »
You want to use a couple relays, driven by the HDD LED signal and the FN key signal.  You'll want Solid State relays (or else the keyboard will be noisy from the relays clicking), and you'll want to make sure they can be switched by the power being put out by the HDD LED/FN key signal (probably around 3-5 volts).  You'll also need to make sure the relays (especially for the CCFL side of things) can handle the voltage and current that the CCFLs will pull.  I put together a hardware implementation of what you're asking below.  I'm using the relays to complete the circuit to ground, but you can reverse it and use the relays to complete the circuit to +V if you want, it shouldn't make a difference.

Hardware implementation:
37547-0

The behaviour of this circuit is such that when both sources are off (no key press, no activity on HDD), the Normally OFF relays for the LED prevent the LED from having a complete circuit to ground: LED OFF.  The Normally ON relay for the CCFL(s) ensures there is ALWAYS a completed circuit to ground if the FN key is NOT pressed: CCFL(s) ON. The LED will still turn on if there is HDD Activity.

When the FN key is pressed, the Normally OFF relay for the LED turns on and completes the circuit to ground for as long as the FN key is held: LED ON. The Normally ON relay of the CCFL is disabled when the FN key is pressed, disconnecting the CCFL(s) from ground: CCFL(s) OFF.  The CCFL(s) will still turn on if there is HDD Activity.
« Last Edit: Wed, 02 October 2013, 16:11:58 by Neebio »
RK9000RE w/ Raindrop & DDR arrow keys
Cherry G80-11900LUMEU-2 w/ Red/Black SA keys

Offline Melvang

  • Exquisite Lord of Bumfluff
  • * Maker
  • Thread Starter
  • Posts: 4398
  • Location: Waterloo, IA
  • Melvang's Desktop Customs
Re: Custom Lighting
« Reply #4 on: Wed, 02 October 2013, 17:10:24 »
You want to use a couple relays, driven by the HDD LED signal and the FN key signal.  You'll want Solid State relays (or else the keyboard will be noisy from the relays clicking), and you'll want to make sure they can be switched by the power being put out by the HDD LED/FN key signal (probably around 3-5 volts).  You'll also need to make sure the relays (especially for the CCFL side of things) can handle the voltage and current that the CCFLs will pull.  I put together a hardware implementation of what you're asking below.  I'm using the relays to complete the circuit to ground, but you can reverse it and use the relays to complete the circuit to +V if you want, it shouldn't make a difference.

Hardware implementation:
(Attachment Link)

The behaviour of this circuit is such that when both sources are off (no key press, no activity on HDD), the Normally OFF relays for the LED prevent the LED from having a complete circuit to ground: LED OFF.  The Normally ON relay for the CCFL(s) ensures there is ALWAYS a completed circuit to ground if the FN key is NOT pressed: CCFL(s) ON. The LED will still turn on if there is HDD Activity.

When the FN key is pressed, the Normally OFF relay for the LED turns on and completes the circuit to ground for as long as the FN key is held: LED ON. The Normally ON relay of the CCFL is disabled when the FN key is pressed, disconnecting the CCFL(s) from ground: CCFL(s) OFF.  The CCFL(s) will still turn on if there is HDD Activity.

Dude you are amazing.  This is exactly what is am looking for.  Any specific stats or specs I need to make sure of for the relays before I order them?  I am not really an electronics person I am essentially an industrial maintenance mechanic on my day job.
OG Kishsaver, Razer Orbweaver clears and reds with blue LEDs, and Razer Naga Epic.   "Great minds crawl in the same sewer"  Uncle Rich

Offline Neebio

  • Posts: 115
  • Location: Canada
  • Dance Master
Re: Custom Lighting
« Reply #5 on: Wed, 02 October 2013, 20:37:15 »
You want to use a couple relays, driven by the HDD LED signal and the FN key signal.  You'll want Solid State relays (or else the keyboard will be noisy from the relays clicking), and you'll want to make sure they can be switched by the power being put out by the HDD LED/FN key signal (probably around 3-5 volts).  You'll also need to make sure the relays (especially for the CCFL side of things) can handle the voltage and current that the CCFLs will pull.  I put together a hardware implementation of what you're asking below.  I'm using the relays to complete the circuit to ground, but you can reverse it and use the relays to complete the circuit to +V if you want, it shouldn't make a difference.

Hardware implementation:
(Attachment Link)

The behaviour of this circuit is such that when both sources are off (no key press, no activity on HDD), the Normally OFF relays for the LED prevent the LED from having a complete circuit to ground: LED OFF.  The Normally ON relay for the CCFL(s) ensures there is ALWAYS a completed circuit to ground if the FN key is NOT pressed: CCFL(s) ON. The LED will still turn on if there is HDD Activity.

When the FN key is pressed, the Normally OFF relay for the LED turns on and completes the circuit to ground for as long as the FN key is held: LED ON. The Normally ON relay of the CCFL is disabled when the FN key is pressed, disconnecting the CCFL(s) from ground: CCFL(s) OFF.  The CCFL(s) will still turn on if there is HDD Activity.

Dude you are amazing.  This is exactly what is am looking for.  Any specific stats or specs I need to make sure of for the relays before I order them?  I am not really an electronics person I am essentially an industrial maintenance mechanic on my day job.

I mentioned a couple things above, but specifically, here's the short list:

- You probably want solid state relays, but look into the options out there, or maybe somebody else can add some insight.  Regular relays are clicky (since they're electro-magnets closing [or opening] a circuit), but solid state ones should be silent.
- You need to know the voltage and current that the CCFLs will be putting through the relays, and select relays that are rated for high enough voltage/current to withstand the load
- You'll also need to know the voltage/current requirements for your LED, but pretty much most relays should be able to handle driving an LED (basically if it can handle 5 volts and 500mA, it'll be fine for the LED [don't forget the resistor for the LED])
- The last thing is to doublecheck that you have the correct type (normally off, normally on)
« Last Edit: Wed, 02 October 2013, 20:49:01 by Neebio »
RK9000RE w/ Raindrop & DDR arrow keys
Cherry G80-11900LUMEU-2 w/ Red/Black SA keys

Offline Melvang

  • Exquisite Lord of Bumfluff
  • * Maker
  • Thread Starter
  • Posts: 4398
  • Location: Waterloo, IA
  • Melvang's Desktop Customs
Re: Custom Lighting
« Reply #6 on: Wed, 02 October 2013, 21:37:48 »
Thanks I figured all that just double checking there wasn't something else lurking under the surface that I would need to know
OG Kishsaver, Razer Orbweaver clears and reds with blue LEDs, and Razer Naga Epic.   "Great minds crawl in the same sewer"  Uncle Rich

Offline Melvang

  • Exquisite Lord of Bumfluff
  • * Maker
  • Thread Starter
  • Posts: 4398
  • Location: Waterloo, IA
  • Melvang's Desktop Customs
Re: Custom Lighting
« Reply #7 on: Thu, 17 October 2013, 09:35:47 »
Ok I have drawn up a prototype version of a schematic that I think would work for this.  What do you guys think?

39619-0
OG Kishsaver, Razer Orbweaver clears and reds with blue LEDs, and Razer Naga Epic.   "Great minds crawl in the same sewer"  Uncle Rich

Offline Neebio

  • Posts: 115
  • Location: Canada
  • Dance Master
Re: Custom Lighting
« Reply #8 on: Thu, 17 October 2013, 13:51:10 »
Ok I have drawn up a prototype version of a schematic that I think would work for this.  What do you guys think?

(Attachment Link)

Have your requirements changed about how you're running the lights?  I mean you have a rocker switch now, are you using that instead of holding the function key?
RK9000RE w/ Raindrop & DDR arrow keys
Cherry G80-11900LUMEU-2 w/ Red/Black SA keys

Offline Melvang

  • Exquisite Lord of Bumfluff
  • * Maker
  • Thread Starter
  • Posts: 4398
  • Location: Waterloo, IA
  • Melvang's Desktop Customs
Re: Custom Lighting
« Reply #9 on: Thu, 17 October 2013, 15:35:30 »
I wouldn't say that my configuration has changed, just revealing a couple more details.
OG Kishsaver, Razer Orbweaver clears and reds with blue LEDs, and Razer Naga Epic.   "Great minds crawl in the same sewer"  Uncle Rich

Offline Neebio

  • Posts: 115
  • Location: Canada
  • Dance Master
Re: Custom Lighting
« Reply #10 on: Thu, 17 October 2013, 19:39:05 »
Ok.. but that doesn't really help me make sure your circuit will do what you want :p

Here's what I gather from the circuit diagram you've provided:

When the rocker switch is off:
the HDD 3.3V signal will power the LED directly. (through the normally closed pin of relay 1) [if 3.3V = on, LED = on]
the CCFL inverter will receive 12V constantly. (through the normally closed pin of relay 2) [CCFL = on]

When the rocker switch is on:
the 5V power from the rocker switch will power the LED directly. (through relay 1 signal pin) [LED = on]
the CCFL inverter will receive an inverted version of the HDD signal. (through relay 2 normally closed pin) [if 3.3V = on, CCFL = off, else CCFL = on]

At the moment, relay 3 (far right) does nothing.  If the goal of relay 3 was to turn off the CCFL by grounding it, this is unnecessary.  Simply disconnect anything from the normally open pin of relay 2.  That way, when relay 2 is on, nothing powers the CCFL, and it turns off.
Also, unless the specific relay you're looking at requires them, none of the diodes in the diagram are needed.

One last thing.  Instead of the diode above relay 1 (in green), that should probably be a resistor instead.  If the LED will be driven by 3.3V directly, you will probably want a resistor to drop the 5V from the rocker switch to 3.3V so that you don't damage the LED, and so that there is as little visual difference in brightness as possible.

Revised Diagram:
39716-0

To be clear, what the above does is this:
IF Rocker Switch = OFF
CCFL = ON constant
LED = HDD 3.3V

IF Rocker Switch = OFF
LED = ON constant
CCFL = INVERTED HDD 3.3V (CCFL off when HDD on, CCFL on when HDD off)
RK9000RE w/ Raindrop & DDR arrow keys
Cherry G80-11900LUMEU-2 w/ Red/Black SA keys

Offline Melvang

  • Exquisite Lord of Bumfluff
  • * Maker
  • Thread Starter
  • Posts: 4398
  • Location: Waterloo, IA
  • Melvang's Desktop Customs
Re: Custom Lighting
« Reply #11 on: Thu, 17 October 2013, 20:25:52 »
Thanks for the advice.  And the third relay (far right) was to un-invert the HDD signal so end result would be HDD on = CCFL on.  Not sure if I got that one right but yes you got my intended function correct.  I had the extra diodes in there because I wasn't sure about back feeding the signal poles on the relay.  But now that I think about it, it can't back feed because when the rocker switch is off there is a break at the led so no current flow anyway.

So on a side note how did I do in the actual drawing of my schematic?  And yes it was done in MS Paint.
« Last Edit: Thu, 17 October 2013, 20:33:25 by Melvang »
OG Kishsaver, Razer Orbweaver clears and reds with blue LEDs, and Razer Naga Epic.   "Great minds crawl in the same sewer"  Uncle Rich

Offline Neebio

  • Posts: 115
  • Location: Canada
  • Dance Master
Re: Custom Lighting
« Reply #12 on: Thu, 17 October 2013, 21:50:48 »
haha not bad, but remember to crop out the white space before saving!  (my edits were done in ms paint too :p)

Ok I've touched up my revision of your drawing to add back that third relay, but this time the circuit should do like before, except without inverting the HDD activity signal to the CCFLs.  Oh, and keep in mind when you collect parts for this, you'll need at least one of the relays to be able to be switched by 3.3V instead of a more usual 5V.  And don't forget, solid state relays! (mechanical relays are noisy!)

Second Revision:
39731-0

Rocker Switch Off:
LED driven by HDD activity
CCFL Constant ON

Rocker Switch ON:
CCFL driven by HDD activity
LED Constant ON
RK9000RE w/ Raindrop & DDR arrow keys
Cherry G80-11900LUMEU-2 w/ Red/Black SA keys

Offline Melvang

  • Exquisite Lord of Bumfluff
  • * Maker
  • Thread Starter
  • Posts: 4398
  • Location: Waterloo, IA
  • Melvang's Desktop Customs
Re: Custom Lighting
« Reply #13 on: Fri, 18 October 2013, 07:59:57 »
Looks good Neebio.  My foreman at work has been into electronics since he was about 10 years old I guess.  Mostly as a light hobby off and on I guess.  I ran this one by him as well and gave him my hand drawn copy of the first version I drew up and the second version you drew up.  I will see what he says tomorrow if he didn't just crash when he got back to his hotel room. 

Now with this revision I would assume that I would only need one in SPDT and two in SPST one as normally open and one as normally closed, correct?  Instead of needing 3 in SPDT.  The problem now is now that I am actually looking for specific relays to order and use, the more I look and read on relays (specifically the solid state versions) the more I get this all jumbled up in my head and have no idea which ones I need for this to come out right.  I found one at www.mouser.com with this part number, 849-LCC110P and this one at digikey.com, hell I don't know anymore.

I might need a bit of help on this one.  Also I do want to put that extra diode in the first one on the 5v line.  Any suggestions for part number here?  The first relay doesn't really need to be solid state but not horribly loud as the switch that I am using that will effectively trigger the first relay is a rocker switch that I already have in hand the part number for it is 54-553 from www.nteinc.com.  I ordered it from a local electronics store. 

Sorry if it seem that I am asking you to hold my hand but electronics is not my forte.  I do understand some basic electrical stuffs but getting into the electronics side is a touch over my head.  Which is why I wanted to stay away from doing this from the teensy.  That I would have been willing to pay someone to do.  This I think with the right questions and prodding I can get there.

For the resistor on the LEDs when both are lit I went to www.ledcalc.com and punched in the values that I knew.  Voltage drop for each LED (clicked the LEDs in series tab since that is how they are configured in the schematic) I used 3.3, 20mA draw with 2 LEDs and I basically got told that won't work with a 5 volt power source.  I and guessing that I wouldn't need a resistor and they would both be dim as well.  Would it simplify the schematic at all if I used 12 volt from the PSU instead of the 5 volt for the pair of LEDs when they are both on steady?  Using the previous numbers with a 12 volt power source it is telling me 270 ohms calculated and next closest higher resistor is 330 ohms with a 1/8watt rating.

I think I am on the right track with the LEDs but need some help with those damn relays.  Again thank you for any help you might still have for me and all you have already given me.
OG Kishsaver, Razer Orbweaver clears and reds with blue LEDs, and Razer Naga Epic.   "Great minds crawl in the same sewer"  Uncle Rich

Offline Oobly

  • * Esteemed Elder
  • Posts: 3929
  • Location: Finland
Re: Custom Lighting
« Reply #14 on: Fri, 18 October 2013, 08:41:15 »
Switching a CCFL on and off rapidly (like from an HDD activity signal) may not be the best idea. The inverter may not like it since it has to give a large starting current every time it switches on. This may put the kibosh on the whole plan.

Since the Esc LED is on when the switch LED is on, you can run them parallel off a single shared resistor, but it may be best to do as you suggested, running them off 12v, since then you only need the 12v supply and HHD LED lines plus ground (3 wires).

Also, don't forget the forward voltage drop across the diode (probably around 0.7v).
Buying more keycaps,
it really hacks my wallet,
but I must have them.

Offline Melvang

  • Exquisite Lord of Bumfluff
  • * Maker
  • Thread Starter
  • Posts: 4398
  • Location: Waterloo, IA
  • Melvang's Desktop Customs
Re: Custom Lighting
« Reply #15 on: Fri, 18 October 2013, 08:53:53 »
The flashing on the CCFLs won't be very long as this will only happen when I have my keyboard in the function layer.  This even will only be for accessing the "F" keys and media keys.  Plus during normal operation when I would be doing this the HDD LED only flashes briefly about once every second to second and a half at rough estimate.  So, 99.9% of the time the CCFLs will be steady. 

I would still use 4 wires for the HDD and the 12 volt power since I already have all four run to the connector.  So for figuring if I can even use the 5 volt power from the USB I would have to add the voltage rating from both LED's and the left side of the relays and that would have to be less than the supplied voltage correct?  If it isn't to much of a difference (say less than 1 volt) would I even need to add in a resister?  So I went back to www.ledcalc.com and punched in the numbers for running the LED's in parallel and it is telling me I can do it with a 47 ohm resistor on a 5 volt supply.  But due to my lack of experience I am failing to see how to power both LEDs while using that loop as the signal wire for the first relay and not have the middle LED steady in all switch states.

Melvang
OG Kishsaver, Razer Orbweaver clears and reds with blue LEDs, and Razer Naga Epic.   "Great minds crawl in the same sewer"  Uncle Rich

Offline regack

  • Posts: 660
  • Location: Thessia
Re: Custom Lighting
« Reply #16 on: Fri, 18 October 2013, 10:37:56 »
Correct me if I'm wrong, but I get the general gist is that you want the Esc LED to act like the HDD activity light, and the CCFL to be on... unless you're in the function layer (or by some switch or something), in which case you want the behavior to change (CCFL Flash, Esc LED Solid).

If that's the case, I would simply the circuit a bit, and just use the 3.3v HDD signal to induce the flicker effect and leave the LED and CCFL circuits powered completely separately.

So, the idea is that the 3.3v HDD signal triggers the InterrupterRelay to switch back and forth thus interrupting power to whichever circuit is running through it.  The ModeSwitchRelay sets which power circuit is passing through the Interrupter.

Default behavior is this:
- LED circuit is on the Normally Open side of the ModeSwitchRelay and passes through the Interrupter
- CCFL circuit is on the Normally Closed side of the ModeSwitchRelay and receives steady voltage

Let me know if I'm way off base...

39791-0

Offline Neebio

  • Posts: 115
  • Location: Canada
  • Dance Master
Re: Custom Lighting
« Reply #17 on: Fri, 18 October 2013, 11:18:03 »
Here's an updated version of the circuit with some resistors added in.  This is assuming that both LEDs (the one in the rocker switch and the one for esc key) are 3.3V forward voltage at 20mA.  I also added in a resistor I forgot previously that prevents basically short circuiting the 5V to ground... (the 10K)

By the way, I really don't actually know, but I think flickering the power to the inverter won't do any harm, but what you can do if you're worried about it is run the output of the inverter through the relay instead of the input to the inverter.  So instead of running the 12V DC through relay #2 and #3, run whatever the inverter spits out (120V AC?).  I think this would be the cautious way to reduce risk of essentially strobing the inverter.

Revised Diagram:
39803-0

I took a look at Regack's diagram as well (after revising the original diagram above) and it looks like it would also work.  I think there are some issues with it with respect to which pins of the top DPDT relay are connected to what, causing inverted signal stuff.  But by the looks of it, it should work.  My only concern with it is related to my above concern about whether it's better to flip the switch on the DC power to the inverter or the AC output from the inverter.  You would definitely need a different relay for the AC power (since much higher voltage).  If that's the case, the original diagram may be better since the relays are split apart and it would be easy to replace one for a higher capacity relay without affecting the rest of the circuit.
RK9000RE w/ Raindrop & DDR arrow keys
Cherry G80-11900LUMEU-2 w/ Red/Black SA keys