LED Strips, TIP-120/IRF-510 and an Arduino Uno

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
Miryokuteki
 
Posts: 7
Joined: Mon Mar 03, 2014 3:03 am

LED Strips, TIP-120/IRF-510 and an Arduino Uno

Post by Miryokuteki »

Greetings! I recently posted about an endeavor involving my attempt to use the Adafruit 12-channel PWM controller... I again thank the gent that helped determine that the board was unsuitable for what I was attempting to do and am hoping someone could help with the work that has resulted since. I realize this is stepping outside the boundaries of it relating to Adafruit customers, but hopefully this ties in enough with my recent purchase and assuredly future purchases enough to net some assistance from such a lovely community! With that all said and done, on we go:

I have an Arduino Uno driving 4 channels of RGB LED strips via the SoftPWM library and an array of transistors (TIP-120/IRF-510); These are wired as follows:

RGB Channel #0: [pins] 2, 4, 7
RGB Channel #1: [pins] 3, 5, 6
RGB Channel #2: [pins] 8, 12, 13
RGB Channel #3: [pins] 9, 10, 11

: SETUP :
This layout is due to grouping the strips by hardware and non-hardware PWM outputs, as early on in prototyping, I ran into odd issues with SoftPWM if I combined the usage of these pins. Anyway, moving forward into the rat's nest. External power is supplied by a 12v/1.25A PSU, with the ground connected to the Uno's Vin/Gnd set GND pin. [For some reason, if I connected it via the barrel jack, the Uno's power LED kept rhythmically flashing]. --- There are 11 TIP-120 transistors and 1 IRF-510, all with their own ties to Gnd and varying indepenent resistors in the 100~250Ω range.

: CODE :

Code: Select all

#include <SoftPWM.h>

int ledR0 = 2;
int ledG0 = 4;
int ledB0 = 7;
int ledR1 = 3;
int ledG1 = 5;
int ledB1 = 6;
int ledR2 = 8;
int ledG2 = 12;
int ledB2 = 13;
int ledR3 = 9;
int ledG3 = 10;
int ledB3 = 11;

void setup() {
  Serial.begin(9600);
  SoftPWMBegin();
  SoftPWMSet(ledR0, 0);
  SoftPWMSet(ledG0, 0);
  SoftPWMSet(ledB0, 0);
  SoftPWMSet(ledR1, 0);
  SoftPWMSet(ledG1, 0);
  SoftPWMSet(ledB1, 0);
  SoftPWMSet(ledR2, 0);
  SoftPWMSet(ledG2, 0);
  SoftPWMSet(ledB2, 0);
  SoftPWMSet(ledR3, 0);
  SoftPWMSet(ledG3, 0);
  SoftPWMSet(ledB3, 0);
  
  SoftPWMSetFadeTime(ledR0, 300, 300);
  SoftPWMSetFadeTime(ledG0, 300, 300);
  SoftPWMSetFadeTime(ledB0, 300, 300);
  SoftPWMSetFadeTime(ledR1, 300, 300);
  SoftPWMSetFadeTime(ledG1, 300, 300);
  SoftPWMSetFadeTime(ledB1, 300, 300);
  SoftPWMSetFadeTime(ledR2, 300, 300);
  SoftPWMSetFadeTime(ledG2, 300, 300);
  SoftPWMSetFadeTime(ledB2, 300, 300);
  SoftPWMSetFadeTime(ledR3, 300, 300);
  SoftPWMSetFadeTime(ledG3, 300, 300);
  SoftPWMSetFadeTime(ledB3, 300, 300);
  Serial.println("Ready!");
}

void loop() {
  delay(1000);
  Serial.println("On");
  SoftPWMSetPercent(ledR0, 100);
  SoftPWMSetPercent(ledG0, 100);
  SoftPWMSetPercent(ledB0, 100);
  SoftPWMSetPercent(ledR1, 100);
  SoftPWMSetPercent(ledG1, 100);
  SoftPWMSetPercent(ledB1, 100);
  SoftPWMSetPercent(ledR2, 100);
  SoftPWMSetPercent(ledG2, 100);
  SoftPWMSetPercent(ledB2, 100);
  SoftPWMSetPercent(ledR3, 100);
  SoftPWMSetPercent(ledG3, 100);
  SoftPWMSetPercent(ledB3, 100);
  delay(1000);
  Serial.println("Off");
  SoftPWMSetPercent(ledR0, 0);
  SoftPWMSetPercent(ledG0, 0);
  SoftPWMSetPercent(ledB0, 0);
  SoftPWMSetPercent(ledR1, 0);
  SoftPWMSetPercent(ledG1, 0);
  SoftPWMSetPercent(ledB1, 0);
  SoftPWMSetPercent(ledR2, 0);
  SoftPWMSetPercent(ledG2, 0);
  SoftPWMSetPercent(ledB2, 0);
  SoftPWMSetPercent(ledR3, 0);
  SoftPWMSetPercent(ledG3, 0);
  SoftPWMSetPercent(ledB3, 0);
}
: THE ISSUES :
All channels work as expected, except for ledR2 (on pin #8) which has a persistent fully open gate (unfettered output, full blast) and ledB2 (pin #13, the rogue IRF-510), which has a markedly dimmer output than any of the other transistors in the circuit (which all have what appears to be an ideal and full output). I've verified all solder points, and checked for continuity and solder bridges but I just cannot seem to resolve these two issues. If anyone could suggest what may be causing this, I'd be very appreciative. Thank you in advance!

Picture #1:
Image

Picture #2:
Image

PS: I'm quite aware that my soldering work is rather sloppy... I hope to improve that, as time goes by. haha

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: LED Strips, TIP-120/IRF-510 and an Arduino Uno

Post by adafruit_support_mike »

WRT the mosfet for ledR2: check for continuity/resistance between the gate and the VCC pin, or any other nearby signal that might carry nonzero voltage. If you don't find anything there, turn the circuit on, set ledR2 LOW, and measure the voltage at the gate. If you get continuity through the channel when the gate voltage is 0v, it means you have a blown mosfet.

WRT ledB2: check for possible connections between the gate and GND, or nearby signals that might have a low value. Again, if that doesn't show anything useful, power the circuit up, set ledB2 HIGH, and measure the gate voltage. If you get the kind of voltage you expect there, measure the voltage at the source and drain. You might have a bit of resistance in the connection between the source and GND.

Miryokuteki
 
Posts: 7
Joined: Mon Mar 03, 2014 3:03 am

Re: LED Strips, TIP-120/IRF-510 and an Arduino Uno

Post by Miryokuteki »

Thank you for replying! I'm admittedly very new to MOSFETs, but here are the readings I'm getting, along with their locations:

14.31v --- PSU distribution point (the yellow/black solder-hills) to the upper board, where the problematic FETs are.
1.5v --- Gate pin of MOSFET associated w/ledR2.
0.66v --- MOSFET output (Fully lights LED strip)

* Resistor in series between the Uno and MOSFET is 100Ω, reading -1.316 (MM set to 2KΩ)

For some reason, I can't seem to get the gate pin to read anything other than 1.5v, regardless of the pin being set to LOW or HIGH explicitly in the code. After testing for continuity as you'd recommended between the gate and emitter, it turns out it is indeed blown, so I've removed the FET from the board and will be replacing it as soon as I get my iron working properly again. In the mean time, I have enough channels to do ~90% of what I intended to do with this circuit. Except for ledB2, everything else seems to be working as expected. Does the fact that it is powered by an IRF-510 have any bearing on what it is being used for? From what I'd read, it is as good as a drop-in replacement for a TIP-120 MOSFET; I am only using it because I only had so many TIP-120 components and happened to have obtained the IRF-510 while at Radioshack one day early on in this prototype's development. From what I can tell, there is no bridging of any kind on this component, nor is there any continuity detected, so I'm a bit perplexed as to why it is dimming as it is. If I connect the LED strip to the base pin of the IRF-510, it glows with full brightness, so it would seem that it is not a connectivity issue (I'm guessing..?), but I could very well be wrong.

Testing code:

Code: Select all

int ledR2 = 8;

void setup() {
  pinMode(ledR2, OUTPUT);
}

void loop() {
  digitalWrite(ledR2, LOW);
  delay(1000);
}

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: LED Strips, TIP-120/IRF-510 and an Arduino Uno

Post by adafruit_support_mike »

Your description of the connections you've made contains mixed terms, and some of the terms don't make sense in the context you've used them.

First of all, mosfets and Darlington transistors are different kinds of devices with different names for the terminals:

Darlington transistors have a collector, an emitter, and a base. You generally connect the emitter to GND and the collector to the load. The base is the control terminal. According to the datasheet (http://www.adafruit.com/datasheets/TIP120.pdf), about 100mA will flow through the TIP-120 when the voltage between the base and emitter (called Vbe) is about 1.3v. The current rises to 10A when Vbe is about 2.5v.

Mosfets have a drain, a source, and a gate. You generally connect the source to GND and the drain to the load. The gate is the control terminal, and it can have almost any voltage. According to the datasheet (http://www.vishay.com/docs/91015/sihf510.pdf), the current flowing through the IRF-510 will be very low until the voltage between the gate and source (called Vgs) rises to about 4v. The current rises to about 10A when Vgs is about 10v. When Vgs is 5v, the current through the IRF-510 will be about 1A.

The voltage at the emitter of a TIP-120 or the source of an IRF-510 should be 0v. The voltage at the collector of a TIP-10 should be about 0.5v when the curren through it is 1A, and about 2v when the current is 10A. The voltage at the drain of an IRF-510 will be about 1v per amp of current flowing through it until it reaches the maximum current possible for that Vgs value. After that it will rise with the supply voltage.

Connecting an LED strip to the gate of a mosfet should do nothing at all.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”