RGB Lights always dimly ON

hi,
I am doing this circuit on attiny85 even tried it on arduino but the rgb strip leaks and stays on any ideas?

bias ,no pull down.

HI,

destiny2008:
I am doing this circuit on attiny85 even tried it on arduino but the rgb strip leaks and stays on any ideas?

What are those transistors ?

Yours,
TonyWilk

Assuming the active parts are NPN transistors, I would remove the Red, Green and Blue wires from the Arduino and connect them to the ground strip on your plug board. My guess is the LED will go off. If so the issue is with the Arduino / program.

If they don't go off you will need to tell us what the active elements are (partnumber etc) and recheck your wiring.

Hi,
Ops circuit.

What are the part numbers of the transistors?
Please post your code.

Tom... :slight_smile:

using basic blink code
with the connected pins 9/10/11

they are n channel mosfet as2HB style G/D/S

i tried even without because i am only using a strip with 3 smd 5050 so current draw max at 255 is about 20ma for all 3 of the same color.

fading works but cannot turn the completely off even with a basic simple code like
delay 3000 @ 0 brigthness

/* Three PWM Outputs */

// ATtiny85 outputs
const int Red = 0;
const int Green = 1;
const int Blue = 2;

volatile uint8_t* Port[] = {&OCR0A, &OCR0B, &OCR1B};
int Pin[] = {0, 1, 4};

void setup() {
  pinMode(Pin[Red], OUTPUT);
  pinMode(Pin[Green], OUTPUT);
  pinMode(Pin[Blue], OUTPUT);
  // Configure counter/timer0 for fast PWM on PB0 and PB1
  TCCR0A = 3<<COM0A0 | 3<<COM0B0 | 3<<WGM00;
  TCCR0B = 0<<WGM02 | 3<<CS00; // Optional; already set
  // Configure counter/timer1 for fast PWM on PB4
  GTCCR = 1<<PWM1B | 3<<COM1B0;
  TCCR1 = 3<<COM1A0 | 7<<CS10;
}

// Sets colour Red=0 Green=1 Blue=2 to specified intensity 0 (off) to 255 (max)
void SetColour (int colour, int intensity) {
  *Port[colour] = 255 - intensity;
}

void loop() {
  for (int colour=0; colour<3; colour++) {
    SetColour((colour+2) % 3, 0);
    for (int i=0; i <= 255; i++) {
      SetColour((colour+1) % 3, i);
      SetColour(colour, 255-i);
      delay(25);
    }
  }
}

destiny2008:
they are n channel mosfet as2HB style G/D/S

Can you post a link to data/spec as2HB?
Have you tried;

void loop() {
  for (int colour=0; colour<3; colour++) {
    SetColour((colour+2) % 3, 0);
/*    for (int i=0; i <= 255; i++) {
      SetColour((colour+1) % 3, i);
      SetColour(colour, 255-i);
*/
      delay(100);
    }
  }
}

This should blank all your strips. (I hope, code untried)
Tom... :slight_smile:

You posted some useless Fritzing picture with an Uno and TO-220 mosfets.
In reality you use an ATtiny85 with smd mosfets.
Time to see a diagram and a real picture of your setup.

Fets are ESD sensitive devices, and can easily be damaged by handling them wrong.
Did you reflow the fets the proper way, or use a non ESD safe soldering iron.

Get the ATtiny out of the equation, and connect the gate directly to source.
That should get 'off' leakage current to <1uA. I doubt that you can see the LEDs at that current.
If you can see the LEDs, then the fets are damaged.
Leo..

Hi,
OPs MOSFET.

Tom... :slight_smile:

Change this:

  TCCR0A = 3<<COM0A0 | 3<<COM0B0 | 3<<WGM00;

to

  TCCR0A = 2<<COM0A0 | 2<<COM0B0 | 3<<WGM00;

and change

void SetColour (int colour, int intensity) {
  *Port[colour] = 255 - intensity;
}

to

void SetColour (int colour, int intensity) {
  *Port[colour] = intensity;
}

Using the PWM hardware directly doesn't allow you to both fully turn off and fully turn on the pin, you only
get to do one of these, and you chose the wrong one.

Surely those should all be 1. Why would you shift in a 2. That makes no sense at all and it would end up setting a bit other than the one you named.

MarkT:
Using the PWM hardware directly doesn't allow you to both fully turn off and fully turn on the pin, you only
get to do one of these, and you chose the wrong one.

No, the original code was correct.

Your modification will output low+pulse for 0 intensity and 100% high for 255 intensity.

The original code will output 100% low for 0 intensity.
Assuming the transistors/mosfets are wired correctly, that should turn the leds fully off.

Yours,
TonyWilk

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
NOT a fritzy..

Can you please post some pics of your project so we can see how your component layout?

Thanks.. Tom.. :slight_smile:

Hi,
Can you run this code on your UNO please, using the fritzy diagram you posted in your original post;

/* Three PWM Outputs */

// UNO outputs
const int RedPin = 6;
const int GreenPin = 5;
const int BluePin = 3;


void setup() {
  pinMode(RedPin, OUTPUT);
  pinMode(GreenPin, OUTPUT);
  pinMode(BluePin, OUTPUT);
}


void loop() {
  analogWrite(RedPin, 0);
  analogWrite(GreenPin, 0);
  analogWrite(BluePin, 0);
  delay (5000);
  analogWrite(RedPin, 255);
  analogWrite(GreenPin, 255);
  analogWrite(BluePin, 255);
  delay (5000);
}

It should flash the LEDS WHITE, ON and OFF at 5second intervals.
Long enough for you to see if they go completely OFF.

Thanks.. Tom... :slight_smile:

Red and green stay on but blue totally off

TomGeorge:
Hi,
Can you run this code on your UNO please, using the fritzy diagram you posted in your original post;

/* Three PWM Outputs */

// UNO outputs
const int RedPin = 6;
const int GreenPin = 5;
const int BluePin = 3;

void setup() {
  pinMode(RedPin, OUTPUT);
  pinMode(GreenPin, OUTPUT);
  pinMode(BluePin, OUTPUT);
}

void loop() {
  analogWrite(RedPin, 0);
  analogWrite(GreenPin, 0);
  analogWrite(BluePin, 0);
  delay (5000);
  analogWrite(RedPin, 255);
  analogWrite(GreenPin, 255);
  analogWrite(BluePin, 255);
  delay (5000);
}




It should flash the LEDS WHITE, ON and OFF at 5second intervals.
Long enough for you to see if they go completely OFF.

Thanks.. Tom... :)

right just connected straight to rule out components

TomGeorge:
Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
NOT a fritzy..

Can you please post some pics of your project so we can see how your component layout?

Thanks.. Tom.. :slight_smile:

so i plugged a 9V battery and the leds go off -- using a 12 V power wall adapter i think i have a gnd leak is there a way to fix that?

destiny2008:
so i plugged a 9V battery and the leds go off -- using a 12 V power wall adapter i think i have a gnd leak is there a way to fix that?

In that picture:

  1. Is the thing on the end of the two black wires on the right hand side a Pushbutton or 3V3 power ?
  2. Do you have the LED strip powered from 12V ?

Yes?
In that case it is likely you will have blown up the Arduino pins.
The Arduino is being powered thru the LED strip and into the digital pins.

And what is that 8-pin device near all the wires on the breadboard ?

Yours,
TonyWilk

that is a capacitor for programming the ATTINY85 which is the 8 pin chip
it is disconnected as of my last post

the strip is powered by itself on another +12V and the grounds connected to arduino I/O
the arduino is powered by usb computer.

TonyWilk:

In that picture:

  1. Is the thing on the end of the two black wires on the right hand side a Pushbutton or 3V3 power ?
  2. Do you have the LED strip powered from 12V ?

Yes?
In that case it is likely you will have blown up the Arduino pins.
The Arduino is being powered thru the LED strip and into the digital pins.

And what is that 8-pin device near all the wires on the breadboard ?

Yours,
TonyWilk