Circuit fails after 2nd power up

Hello everybody,

I am building a RGB ledstrip controller. Now I used TIP122 to drive this high currents.
The first powerup worked, my LEDstrip gave the requested RGB color. But after a couple of seconds, the LEDstrip flashed a little bit.
I thought it was the PWM code so I tried to fix it, but when I placed the Atmega328 back in the circuit, the LEDstrip does just nothing.

Is it possible that the TIP122 failed or something else?

My code:

#include <SoftPWM_timer.h>
#include <SoftPWM.h>
#include <TimedAction.h>

/*
   ******************************************
   *               Trainduino               *
   *                                        *
   *----------> RGBLEDCONTROLLER <----------*
   *                                        *
   *           V 0.9.6 PRERELEASE           *
   ******************************************
   THIS IS A PRERELEASE! I'm never resposibly for any damage to your stuff! This version is also NOT completely tested.

   (c) Dylan Van Assche (2013 - 2014), producer of the Trainduino serie.
*/

#define RED_PIN 2
#define GREEN_PIN 3
#define BLUE_PIN 4
#define WHITE_PIN 5

int red                   =     230;
int green                 =     230;
int blue                  =     75;
int white                 =     0;

int redValue              =     255;
int greenValue            =     255;
int blueValue             =     255;
int whiteValue            =     255;

boolean Status            =     true;

TimedAction RGBTimer      =     TimedAction(1000, RGB);
TimedAction Clock         =     TimedAction(500, ClockFunction);

int currentHour           =     7; // Start ALWAYS the program in DAY mode. Day is from 07:00 to 19:00.
int currentMinutes        =     0;

void setup() {
  SoftPWMBegin(); // Start the SoftPWM library.
  
  pinMode(RED_PIN, OUTPUT); // Setup RED_PIN for SoftPWM.
  SoftPWMSet(RED_PIN, 0);
  SoftPWMSetFadeTime(RED_PIN, 4000, 4000);

  pinMode(GREEN_PIN, OUTPUT); // Setup GREEN_PIN for SoftPWM.
  SoftPWMSet(GREEN_PIN, 0);
  SoftPWMSetFadeTime(GREEN_PIN, 4000, 4000);

  pinMode(BLUE_PIN, OUTPUT); // Setup BLUE_PIN for SoftPWM.
  SoftPWMSet(BLUE_PIN, 0);
  SoftPWMSetFadeTime(BLUE_PIN, 4000, 4000);
  
  pinMode(WHITE_PIN, OUTPUT); // Setup WHITE_PIN for SoftPWM.
  SoftPWMSet(WHITE_PIN, 0);
  SoftPWMSetFadeTime(WHITE_PIN, 4000, 4000);
  
  randomSeed(A5);

}

void loop() {

  Clock.check(); // Time tracking process.
  if (Status)    // DAY.
  {
    redValue    =  230;
    greenValue  =  230;
    blueValue   =  75;
    whiteValue  =  255;
    RGBTimer.check(); // Every time the RGBTimer is triggered, changes the PWM output. With this timer you can change the colors of the RGB LEDstrip very slowly.
  }
  else  // NIGHT.
  {
    redValue    =  40;
    greenValue  =  12;
    blueValue   =  100;
    whiteValue  =  0;
    RGBTimer.check(); // Every time the RGBTimer is triggered, changes the PWM output. With this timer you can change the colors of the RGB LEDstrip very slowly.
  }
}

void RGB() // This function controls the RGB LEDstrip.
{
  if (red < redValue)
  {
    red = red++;
    SoftPWMSet(RED_PIN, red);
  }
  else
  {
    red = red--;
    SoftPWMSet(RED_PIN, red);
  }

  if (green < greenValue)
  {
    green = green++;
    SoftPWMSet(GREEN_PIN, green);
  }
  else
  {
    green = green--;
    SoftPWMSet(GREEN_PIN, green);
  }

  if (blue < blueValue)
  {
    blue = blue++;
    SoftPWMSet(BLUE_PIN, blue);
  }
  else
  {
    blue = blue--;
    SoftPWMSet(BLUE_PIN, blue);
  }
  
    if (white <= whiteValue)
  {
    if(whiteValue == 0)  // Keeps the white LED OFF. Otherwise it sticks in an ON/OFF loop...
    {
      
    }
    else
    {
    white = white++;
    SoftPWMSet(WHITE_PIN, white);
    }
  }
  else
  {
    white = white--;
    SoftPWMSet(WHITE_PIN, white);
  }
}

void ClockFunction()
{
  currentMinutes++;

  if (currentMinutes == 60)
  {
    currentHour++;
    currentMinutes = 0;

  if (currentHour == 7)
  {
    Status = true;  // DAY
  }
  if(currentHour == 20)
  {
    Status = false;  // NIGHT
  }
  if(currentHour == 24)
  {
   currentHour = 0; 
  }
}
}

PCB & Schematic see attachment.
I added a wire to connect the 12V input with the LEDstrip...

Cheers,
Dylan

You have no supply to the AVcc pin - that's bad.

Also you should have 0.1uF decoupling capacitors on the supply/grounds close
the 328 (one each for Vcc and AVcc).

The darlington circuits look OK - did any overheat? What sort of current level are you expecting?

TIP122 is setup like NPN, and wants to sink current from Vsupply thru the LEDs to Gnd.
With little schematic is hard to tell if you are doing that. Can you make it bigger?

Click the picture, it will expand (in Firefox).

The PCB shows 1 unrouted trace.
You can probably solve that by rotating the power terminal (in this case change the wires), the Elco and the regulator.

Thanks for the replies. I will try to add th Avcc and some decoupling capacitors.

I will let you know if it works.

Cheers Dylan

I just tried it but the problem still exits...

Cheers,
Dylan

Hi, what is your LED strip specs, and where are you drawing the LED power from.
Have you measured the supply to the LEDs.(I notice that you must have a wire jumper on the PCB to get power to the LEDs terminal strip.
Have you tried a single LED and resistor in place of the strips to see if output is still working?
As a general inclusion on a PCB like this, in hindsight to mount a LED and resistor on each channel on the PCB as an indicator for just this problem.

Tom... :slight_smile:

I tried it but the same thing... I used a 3mm red clear led.
I saw a little red dot in the led when it was connected to one of the mosfets. So they are giving a little power.

Cheers,
Dylan

You tried it like this and it still doesn't work?

Yes that's right. I tried it like this.
But at the first powerup it works and now it does nothing at all.
Is used the schematic for the TIP122 many times but I never had something like this.

Cheers,
Dylan

Hi, what value resistor are you using in series with the test LED, what are the specifications on the RGB LED strip?

Tom........ :slight_smile:

I was using a 1000 Ohm resistor with the test led(3mm) on 12V of course.
The RGB ledstrip specs:

5050 RGB Non-Waterproof Led Strip
LED type: SMD5050
Color: RGB
LED Quantity: 300 leds/5 Meter
Size: L500cm (5M) x W14cm x T2cm
View angle: 120°
Protection Rate: IP33 Not Waterproof
Working Input Voltage:: 12VDC
Working Current/meter: ? 5A/5M
Working power: ? 60W/5M
Working Tempreture: -20° to 50°
Drive Mode: Contant Voltage
Package: 1 X 5 Meters / Reel

I used only 0.5m form this RGBledstrip to try my PCB out.

Cheers,
Dylan

Hi, Dylan, can you upload a test sketch that just turns the four channels on for 5 seconds each, no PWM, to check that all is well with the arduino.
As each channel is activated you can measure voltages around the transistor to see if any failures.

Tom...... 8)

Are you ever going to answer the question abot where you are getting power?

Testsketch doesn't work. I can only measure then 0,45V on each output.

123Splat:
Are you ever going to answer the question about where you are getting power?

Sorry about that, I forgot that to mention. I use a 12V @ 1A adapter.

Cheers,Dylan

Hi, post us your test sketch.
Thanks Tom.. :slight_smile:

Check the Adapter ..might it be fried.. Is Adapter working?

void setup()
{
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
}

void loop()
{
digitalWrite(2,HIGH); //red
digitalWrite(3,HIGH); //green
digitalWrite(4,HIGH); //blue
digitalWrite(5,HIGH); //white
delay(5000);
digitalWrite(2,LOW);
digitalWrite(3,LOW);
digitalWrite(4,LOW);
digitalWrite(5,LOW);
delay(5000);
}

The adapter is fine, the LEDstrips light up when I just connect them to the adapter.

Cheers,
Dylan

Be very precise when you communicate test results.
What outputs are you talking about ?
The Arduino outputs, the transistor outputs, or your output terminal to the LEDs ?

TomGeorge asked to measure around the transistors.
I read that as measuring each transistor pin.
Did you do that and if so, what was each result ?

I measured 0,4V on the output terminal.
I will measure the transistors pins as soon as I can.

Cheers,
Dylan