Go Down

Topic: 12v LED Strip softly strobing when it should be off. (Read 300 times) previous topic - next topic

prometheus

Thank you in advance for any help you can provide.

This project is simply fades in an LED light strip inside a display case as you walk up to it and fades it back off as you walk away. This worked for about a month, but now the light strip softly strobes or pulses when no input is present. The light continues to work normally when a person walks up to the case. An infrared motion detector with a built-in timer is being used to provide the input to the arduino board. The 12vDC source powers the Arduino UNO Rev3 and the LED light strip.

NPN MOSFET part number: STP55NF06
10K 1/8W pull down resistor on the input
330ohm 1/8W pull down resistor on the Gate

Code in use:

Code: [Select]
#define BUTTON 2
#define LED 9

int fadeAmount = 1;
int brightness = 0;
int delayTime = 10;
int buttonState = LOW;

void setup() {
  pinMode(BUTTON, INPUT);
  pinMode(LED, OUTPUT);
}

void loop() {

  buttonState = digitalRead(BUTTON);

  if ((buttonState == HIGH) && (brightness < 255)) {
    brightness += fadeAmount;

    } else if ((buttonState == LOW) && (brightness > 0)){
     brightness -= fadeAmount;
  }

  if(brightness > 255) {
      brightness = 255;
    } else if (brightness < 0) {
      brightness = 0;
  }
 
  analogWrite(LED, brightness);
  delay(delayTime);
}

Grumpy_Mike

Quote
. This worked for about a month, but now the light strip softly strobes or pulses when no input is present.
So the problem is likely to be a hardware one then.

Please supply a full schematic of your circuit.

Go Up