RGB LED control

#2
Welcome to the PICAXE Forum.

Yes, I've used PICAXEs to control RGB LEDs using PWM in several projects. PWM allows the software to control the brightness of each of the colours, permitting many thousands of hues. Some of the projects were on a large (commercial) scale for clients, see images, below. My PICAXE microcontroller of choice for PWM control of LEDs is the 28X2 but smaller PICAXEs that have 3 PWM channels can be used.

There are a few different types of RGB LEDs that you could use. These could be a simple 4-wire device with R, G, B and common leads or the more sophisticated WS2801-driven ones Eg the 5050 size. The WS2801 driver requires the use of SPI, which is not so simple for the beginner.

Could you tell us what hardware you have to start with?
3. 'Flourish' (Evening) FITZ Apartments LoRes.jpg 5. 'DownLounge' (Night) Leederville LoRes.jpg
 
Last edited:

hippy

Technical Support
Staff member
#3
There are a fair few projects and discussions on the forum for driving single RGB LEDs which is probably the best way to start, including -

https://picaxeforum.co.uk/threads/picaxe-rgb-controller.9747

Using a single 4-leg RGB LED, common cathode or common anode, and even with just one resistor in the common line, one can start experimenting with them, three resistors, one per LED, is a better way.

A PICAXE with three separate PWM channels is perhaps best and easiest to use, but a single PWM and multiplexing the LEDs with three digital lines, or just pulsing digital lines to 'bit-bang the PWM' can also work.

Unfortunately this forum, like most others, doesn't support searching for short words like "RGB LED" and similar but Google and other internet search engines can help there, especially when the "site:" is specified, for example -

rgb led site:www.picaxeforum.co.uk
 
#4
I have made a number of successful single pixel RGB APA102 chip devices where the chip is connected to 4 wire common telephone wire - V+, V-, Data, Clock connections. I think this is easier than using a 4 wire RGB LED with 3 different PWMOUTs though it can be done...
 
#5
For the WS2801 combined driver chip and RGB LED you can have a look at my past thread here:
https://picaxeforum.co.uk/threads/g...channel-rgb-led-driver-with-pwm-output.22713/

I have driven up to 6 in series with X1 and M2 parts. An X2 PICAXE part with higher click speeds could easily drive more.

Believe other have used similar code and the WS2803 to control 6 RGB LEDs. A forum search will find more info on that possibility.
 
#6
I like the ease of driving the APA102s AND much higher flicker rate if you do not use the global dimming function - have to admit I didn't do well with WS28xx units I tired... [with 08M2s]...
 
Top