Saturday, 26 January 2013

Leds Strip Fading system



Description
I made a little test with some components to find out how to control the brightness of this leds strip, I couldn't find a good answer on Google so I came up with a solution.
Keep in mind that I am not an electronic so this solution could be not the best one, it worked and tested. 

Items
  • Leds strip
  • Arduino
  • N-Channel MOSFET, my was 2N7000
  • 200 ohm resistor
Schema


Code

void setup() {
    pinMode(5,OUTPUT);
    pinMode(6,OUTPUT);
}

void loop() {
 analogWrite(5,0);
 for (int i = 0;i < 260;i++) {
    analogWrite(6,i);
    delay(10);
 }
}

4 comments:

Indissoluble said...

Why do you put a resistor? And why 200ohm? How do you calculate that?

Thank you

Christian Bianchini said...

I have followed ada fruit tutorial and what I understood is that the resistor is a security to don't burn the Arduino in case of overloading.
You can put something like 50-300

David Witkowski said...

It would be helpful for you to label the FET terminals in your schematic. Gate, Source, Drain.

ianaz said...

do you suck cocks too?