SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions on the software and hardware for Atmel's STK standard.
By Dig
#137034
I've been playing around with Arduino and now want to make something tiny and standalone. My 'project' is a temperature sensor and RGB LED and display a colour based on the temperature, easy enough to prototype on Arduino, now I want to make it work with as few parts as possible.

I'm considering using a ATTiny13 or ATTiny85, problem is I'm using 3 PWM pins for the LED and these seem to have only 2 PWM pins.

There must be a trick! And if there is, is there also a trick to use only one resistor for the RGB LED or is it always necessary to use 3?

Thanks,
User avatar
By elevator4
#137040
You can always use regular pins and implement the PWM in firmware.
Or use a different uC. My RGB light (picture attached) uses a Silabs C8051F304 which has 3 PWM channels (and the pin-compatible F302 also has a temp sensor integrated).
To the question about one resistor for the LED, yes it is possible but depending on how much color fidelity you want, the firmware can become complicated (lookup tables, PWM interleaving). Note that the three LEDs have different forward voltage drops, so base brightness will be much different already. I wouldn't go the single resistor route, it's just not worth it IMO.
E
You do not have the required permissions to view the files attached to this post.
By Dig
#137058
Thanks, rfor the info, was looking at ATTiny because I know where to get them, but certianly open to other options. I'll investigate further. Good point with the resistors, there'll be plenty of room on my little board for 3 so if that's easiest I'll do it that way.

Cheers,