I want to mod my laptop and replace the built in lighted HP logo with an RGB LED. The original LED is a white 5050 SMD LED but I think I can wedge a 5mm LED bulb if I file them thin with flat sides. There is a fixed 5v source that feeds the LED, it can do Arduino and a single LED.
I'm planning on using 3 PWM lines to control an RGB LED. As there's limited space between the LCD panel's back and the top cover, I can't use the regular parts like ATMega DIP chip. Can someone suggest a tiny thin one? Lilypad would work but a smaller one would be nice.
I do have UNO and the DIP chip can be removed and use the onboard USB connector for programming arduino that doesn't have onboard USB.
The 5050 LED already inside is about 5mm by 5mm and it's oriented sideway to illuminate the small reflective plexi that makes up HP logo. Edge lighting design if I understand correctly. The flat version looks like it'd work the best since it'd be easier to solder + heatshrink wires on it than trying to solder on the sides of that plcc-4 chip.
I've looked at ttiny85, as long as they are SMD and not DIP it may fit. I don't know about the PWM, one article mentions 2 PWM pins and other mentions 3, the same pin is also used for USB connection. Seems to me if I am trying to program it and test to see how it worked, the LED lighting might interfere with USB or serial communication and that might make reprogramming a bit messy. I'd have to disconnect the LED if I need to tweak and reprogram. I'll keep checking, I got whole weekend to figure out what works.
If you want something really small and don't mind the price then these may be suitable. I use them for radio control in N-Gauge model trains. See also the main Deltang page.
raschemmel:
Those are really cool ! Do you have a link to buy them ?
There's like a zillion arduino projects that would work with those.
I bought mine direct from DavidT - by email and PayPal - there should be links on the web pages.
His main products are the "Deltang" devices which he programs to work with standard R/C transmitters. But since they contain an Atmega328 I figured I could program them as an Arduino. I wrote about that here. It is a tiny bit out of date so don't use it without checking with me - the expensive smoke may escape.
I'm too lazy to look it up on the datasheet right now to confirm, but I believe the ATTiny85 has only two hardware PWM pins. You can have as many software PWM pins as you like, though. An ATTiny85 should have no problem running two hardware + one software PWM pins.
tylernt:
I'm too lazy to look it up on the datasheet right now to confirm, but I believe the ATTiny85 has only two hardware PWM pins. You can have as many software PWM pins as you like, though. An ATTiny85 should have no problem running two hardware + one software PWM pins.
Can it handle a software PWM while computing the change in output value from one color to next smoothly? My color changing idea was along this line:
randomize new red, green. and blue value
calculate difference between current value and new value to determine increment rate
increment current R, G, B PWM value once per second
when the current R, G, and B value reaches the target value, repeat for new value.
Obviously with 3 hardware PWM, I could use wait 1 second before changing value. But with software PWM, I can't do that since I'd need to continuously toggle the pin on and off at millisecond interval to simulate PWM.
What about Digispark?? https://www.kickstarter.com/projects/digistump/digispark-the-tiny-arduino-enabled-usb-dev-board suggests 3 hardware PWM and it has built in USB support. If the PWM pin isn't shared with those used for USB, I could tap into the laptop's web cam (which uses USB) and connect to that, allowing me to change (ie static color only or cycle between specific color for event or something) without having to open my laptop. I never used the built in web cam anyway 8) (don't like the idea hacker could see me without my knowing so I unplugged it when I first got the laptop)
wilykat:
Can it handle a software PWM while computing the change in output value from one color to next smoothly?
Yes. Software PWM isn't terribly intensive, if you set the frequency to a reasonable value.
Obviously with 3 hardware PWM, I could use wait 1 second before changing value. But with software PWM, I can't do that since I'd need to continuously toggle the pin on and off at millisecond interval to simulate PWM.
Software PWM can be done in the main loop(), or with a timer interrupt. If you use an interrupt, the desired PWM value can just be stuffed in a volatile variable any old time, and the ISR will pick up on it at the next interrupt. Interrupt-based software PWM is pretty much the equivalent of hardware PWM at that point, as long as you don't try to run the frequency too fast.
Here, someone's already written the interrupt-based software PWM code for you:
The ws2812b led has its own pwm drivers built in, so the tiny85 has only to send the command for any particular colour. Only 3 wires between the tiny and the led, including power and ground. Use the neopixel library and run the tiny85 at 8MHz.
With the above 10-packs you could make one for yourself and sell 9 others!