Showing posts with label PWM. Show all posts
Showing posts with label PWM. Show all posts

Saturday, September 6, 2014

16M color using RGB led and arduino #15

RGB leds have 4 leads in it. RGB leds ase like common led but its just three led with RED GREEN and BLUE colored LED in single LED body . Each pin are for red , green and blue colored led and one for ground.
Using Arduino's PWM feature we can change the intensity of each of the individual led and the color of the led will give the 2^8 level ie 255 for each color. Then with three eight bit colored led it will give 2^24 level of color. I.E about 16 million of color.But our human eye couldn't detect all those colors.
Now connect the pins of RGB led to any of the PINS in arduino labeled with PWM or ~ kind of symbol.




Most of the RGB led have the above pin configuration. The cathode pin is ground connected to arduinol's ground and other to any of the PWM pins lets say 9 to R,10 to G and 11 to B.
In arduino's program add
#define R 9
#define G 10
#define B 11

In setup() add
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);
pinMode(11,OUTPUT);

Now any where in program we can adjust the brightness of each of the led to change the color the led using analogWrite(X,VALUE);
where X is either R, G or B
and VALUE is anywhere between 0 to 255. Its always better to and some resistors 220 to 330 (around)  to the R G and B pins in series to arudino 's pin to limit the current flowing.



Monday, September 1, 2014

CLASS D AMPLIFIER BASED ON SG3524 PWM IC #11

SG3524 is a PWM controller IC. This IC is normally used in power management , in buck or boost converters. Since class D audio amplifier is can be understood with the analogy of SMPS power supply, we can use the SG3524 as the PWM generator for the class D audio amplifier. The voltage level of the audio input to the circuit determines the instantaneous duty cycle of the output waveform whose frequency can be determined by the use of timing resistor and capacitor RT and CT. Then the low pass filter at out desired frequency cut off the high switching frequency typically 400 KHz .
Here's the link for its datasheet from Texas Instruments (http://www.ti.com.cn/cn/lit/ds/symlink/sg3524.pdf).

Mosfet can be driven by using the MOSFET driver using the dedicated IC driver like International Rectifier's IR2101 with both high side and low side drivers.
Here's the link on basic of class D amplifier(http://shortedwire.blogspot.com/2014/08/introduction-to-class-d-amplifier-4.html).
The dead generator is used in the circuit in order to avoid the turning on of the mosfet on  high side and low side at the same time of the same side of the bridge.
Sorry for the low q schematic.

Here some terms explained in the class d amplifier
http://shortedwire.blogspot.com/2015/07/terms-explained-in-class-d-amplifiers.html