HW Hack: Keyboard light


Thanks for your replies!


The LED I've used was running fine just with PWM controlled values (thanks WizardStan, I completely forgot it's PWM) when kept low, no overheating or high mA draining (checked with SystemInfo PND). But I thought it might be good to define some treshold on HW level.


Here are the full specs of LED:


http://www.cree.com/...ng/XlampMLE.pdf


The reason why I decided for this LED are marked in attached pictures. Also the size and form factor decided.


I can't get my head around which values are relevant when only one LED is in the circuit, parallel or serial?


Edit:


@MWeston + WizardStan: After reading your tips slowly and carefully and viewing the forward current graph in the LED documentation I conclude that no resistor is needed, am I correct? It seems that LED can stand voltages slightly above 3.7V and up to 500 mA. The problem is that it gets hot when PWM values are above 80-150. Is there a HW way of limiting mA/V so the LED can't fry it's surrounding when PWM 255 is fed into the pads?


If it's not possible or the circuit design gets more complex I can live happily with PWM control only. It works and the light is blinding already at PWM values around 40. For reading in dark room the values from 5-10 are absolutely sufficient.

uploadfromtaptalk1351235673594.jpg

uploadfromtaptalk1351235772388.jpg

uploadfromtaptalk1351235789003.jpg
 
Last edited by a moderator:
Nicely done, looks like it works really well and perfectly illuminates the required area. Does it blind a bit or is it ok?
 
According my old and limited electronics knowledge, LED always pairs with a resistor.
 
Last edited by a moderator:
Could need a lit Keyboad, it's hard to write on the Pandora at night in a dark room. ^^


But I would prefer real lit keys, if there also could be a mod?
 
I like this mod. Looks like it would also make a good flashlight with the lid closed.


I think I will try this one once we get final word on the LED resistor thing.
 
no overheating or high mA draining (checked with SystemInfo PND)
It doesn't seem like it is overheating but that's because it has a chance to cool down between pulses. Trust me, you're burning out your LED faster than if it had a resistor attached to it.

The problem is that it gets hot when PWM values are above 80-150. Is there a HW way of limiting mA/V so the LED can't fry it's surrounding when PWM 255 is fed into the pads?
A resistor *IS* the HW way of limiting the current. You need a 3.3Ohm resistor in that circuit. Do that, and it should no longer get hot at max brightness, and it'll give you much better control over that brightness.
 
Nicely done, looks like it works really well and perfectly illuminates the required area. Does it blind a bit or is it ok?
No, it doesn't blind you. You are normally facing Pandora's screen and the LED is directed down to the keys and it is intruded a bit into the lid.

According my old and limited electronics knowledge, LED always pairs with a resistor.
That's how I understand it too. But I'm not sure if it should protect the circuit from too hungry LED or the LED from high current/voltage levels :huh:

Could need a lit Keyboad, it's hard to write on the Pandora at night in a dark room. ^^


But I would prefer real lit keys, if there also could be a mod?
If somebody creates transparent or semi-transparent keymat we can have it. The other KB light pad is ready right at the keboard side of the MB.

A resistor *IS* the HW way of limiting the current. You need a 3.3Ohm resistor in that circuit. Do that, and it should no longer get hot at max brightness, and it'll give you much better control over that brightness.
Thanks again! In one moment in my calculations I got the the point that I would need 3.2 Ohm resistor but I was not sure at all if I calculated it correctly. So I'll look for 3.3Ohm then.
 
Last edited by a moderator:
That's how I understand it too. But I'm not sure if it should protect the circuit from too hungry LED or the LED from high current/voltage levels :huh:
An LED is a semiconductor: you're basically shorting the battery when you attach an LED without a resistor. Fortunately LEDs also act as a kind of fuse: too much current for too long and the LED will blow. MWeston would probably be able to explain better.
 
Thanks dgame! For completeness ... it looks like this with all values relevant for that Cree LED I use:


8126224589_3f10080e1d.jpg



Thanks to this scheme I can finally understand the LEDs forward current graph and the role of the resistor (read as "I was enlightned"). It has to knock down the voltage to provide LED with current level that is delivered by Pandora pads. I warned you, I have low theoretical background so I'm learning by reinventing the wheel? :rolleyes:


8126238612_3f161da27e_z.jpg
 
edit: forgot to mention you need to be super user.



Code:
sudo su

<enter password>

echo 255 > "/sys/class/leds/pandora::keypad_bl/brightness"


WizardStan or notaz, could you please explain a bit what kind of file is this? Is it a link, something else or a regular file? I'm confused by those colons. I wrote a simple script which receives PWM value as an argument. Before I can run this script I have to do:



Code:
sudo chmod 755 /sys/class/leds/pandora::keypad_bl/brightness


This chmod is effective only in one user login session and doesn't persist over reboot. Is there a way how to mod the brightness file permissions permanently? Thanks.
 
Last edited by a moderator:
It's a system file. Like a dev file. Unix (and thus by extension Linux and all other permutations of nix) made the decision that everything you could ever want to access would be a "file" with appropriate read/write handlers. When you read from the "file", you aren't actually reading from a physical file stored anywhere, the kernel translates that read into a system call which accesses the read function of the driver, and the driver returns a value. Similarly, when you write to it, you aren't actually writing to anything, the kernel calls the "write" function of the module and does whatever it is supposed to do with the stuff you were trying to write. Want to be able to read or write on the serial port? It's just a file, open it with read/write properties and go nuts. Want to record raw audio? It's just a file, read from it until bored. Want to play that raw audio back into the speakers? FILE! Just cat that file you just made back into the sound device. It's pretty cool magic. They aren't physical files, but the system allows you to treat them as files for really easy use. The reason your chmod doesn't persist is because of this fact: since they aren't physical files they aren't stored anywhere, the system recreates them on boot based on the kernel modules that get loaded (and can change them over time if the modules change).


As far as the colons are concerned, they're allowed in file and directory names, absolutely nothing unusual going on there, other than you probably haven't seen them before.
 
Last edited by a moderator:
I know about the nature of files on nix systems but thanks for demystifying those sys files being recreated after boot. I'll try to include the permission check into the script so it should ask for sudo password when launched first time after the boot.


And here is little video of the hack in action:


http://youtu.be/2dbRYO0XHuM
 
Back
Top