Arduino and BD710 Transistor...

Hello dear Community,

(please see last post)

////////////////////////////////////////////////////////////////////////////////////////////////////////////////
I've been trying to control a 12v solenoid with my arduino (uno) and the help of a bd710 transistor. (datasheet)
Unfortunately I can't get it to work properly which is why I've got to ask: is this transistor "able" to control the solenoids with an arduino or did I just buy the wrong product? (and if so can someone point me to a good site where I can read and learn more about transistors and how they work so that I can buy the right thing the next time?). Or if someone would be so kind to shortly explain to me what exactly this data tells me about the transistor: "80/80V - 12 A - 75 W - TO-220" Works up to 80v, at 12A and 75W or needs that much current to work/get switched? The datasheet confuses me also a little because I'm not 100% sure which pinout is which... what does the schematic in the datasheet tell me about that? (does it at all?)

I've been following this tutorial on bildr: http://bildr.org/2011/03/high-power-control-with-arduino-and-tip120/
Everything is pretty much the same way hocked up. The diode is a Schottky Diode 60V 5A SB560.

My code at the moment is just a simple test thingy with the basepin connected to the base of the transistor and so on...

int basePin = 9;
int led = 13;

int s = 800;
int d = s * 5;

void setup()
{
  pinMode(basePin, OUTPUT);
  pinMode(led, OUTPUT);
}

void loop()
{
  for(int i = 0; i < 2; i++)
  {
    analogWrite(basePin, HIGH);
    digitalWrite(led, HIGH);
    delay(s);
    analogWrite(basePin, LOW);
    digitalWrite(led, LOW);
    delay(s);
  }
  delay(d);
}

Thank you very much in advance!

Best
Marcel

The TIP 120 transistor is a NPN darlington type. The BD710 is a PNP transistor. The two are very different and do not work the same.

groundfungus:
The TIP 120 transistor is a NPN darlington type. The BD710 is a PNP transistor. The two are very different and do not work the same.

oh my... how come I have overlooked that. :~
luckily I just found a site that explains a lot (PNP Transistor switching)
thank you groundfungus :slight_smile:

I'd recommend getting a logic-level MOSFET, you won't be able to switch 2.6A using
a single BJT as it will need 200mA on the base (far beyond the capability of an Arduino
pin), and a Darlington will need quite a lot of heatsinking at that power level (about 3W).

An n-channel logic level MOSFET with an Rds(on) of 30 milliohms or less will be fine
and won't need any heatsinking, the diode across the solenoid is always required, note.

Thank you Mark!
for example those would work?:

or:

Sorry for pushing, but can someone confirm that the IRL 530 N will work like the TIP 120 with the arduino and 12 volts? (e.g. this one)

Leistungs-MOSFET IRL530NPBF N-LogL 100V 17A 79W 0,10R TO-220AB

Looks like an IRL530N will do the job just fine. "Logic level" (at 3A at least) and generously rated. Mind you I prefer the English datasheets! :smiley:

Note you are going to use use PWM. You should have a 220 ohm series resistor to the gate in order not to overload the MCU pin when it has to charge and discharge the gate; otherwise I did not look at your code. You also need a 47k resistor from the gate to ground to keep the FET switched off if the MCU is in reset or otherwise not functioning.

PWM to a solenoid eh? I don't recall; are you the guy playing with ferrofluids, or doing a "levitation" trick?

Thanks Paul. Then I think I'll just order a couple of these :slight_smile:
I'm a newbie on this topic, so I hope you don't mind me asking whether a 2,2k resistor will also work? Wow and also a 47k? Not 4.7k? Ok... no no I'm just trying so build a little mechanical loom for myself :relaxed:

The series resistor is to limit the current sourced by the Ardiuno port pin into the input capacitance of the FET. For PWM, you want the FET to switch on and off as fast as possible, so you want the smallest resistor appropriate. A 220 ohm resistor will limit the current at 5V to 22 mA which is the maximum comfortably rated for the mega328 (or most similar) chip.

The parallel resistor is merely to pull the gate to ground when nothing is otherwise controlling the voltage, and the gate has a very high input impedance (many megohms) so this resistor can be quite a high value. 47k is really quite low and will have no effect on the PWM driving. A 4k7 would be OK if the series resistor was 220 ohms, but slightly reduces the drive voltage (by one twentieth), but 4k7 against 2k2 would prevent the circuit from working as it would reduce the gate drive voltage by one third.

You could in fact, put the 4k7 resistor not from the gate to ground, but from the Arduino port to ground if those are the only resistors to hand, but the values I carefully specified would be much preferred.

Thanks Paul, I just ordered a bunch of irl530s and 47k resistors and am very much looking forward to try that out. I also wonder if there might be a way to use somethig like a switch between the arduino and the solenoid/voltage. So that I don't need a transistor and an arduino pin for every solenoid I want to control but can toggle power on and off for every single solenoid with just like 2 pins. Any idea is very much appreciated!

Look into the shift register (74hc595 for instance). Using 2 or 3 pins to control as many solenoids as you want in any order with SPI or bit banging (shiftOut()). Another route is the I2C port expander (2 pins ,A4 and A5 on Uno).

marwi:

groundfungus:
The TIP 120 transistor is a NPN darlington type. The BD710 is a PNP transistor. The two are very different and do not work the same.

oh my... how come I have overlooked that. :~
luckily I just found a site that explains a lot (PNP Transistor switching)
thank you groundfungus :slight_smile:

You can still switch the solenoid on/ off you just need to change the logic from your arduinio to allow it to work..

7hc595 br the cheapest solution to control multiple devices with limited pins

unfortunately I still can't get it to work. As I don't have 220 ohm resistors I'm using a 330 resistor to the gate and the 47k to the ground. The transistor is a IRL 530N TO-220AB (datasheet). But I'm not sure how to read the datasheet properly to know which pin is which (at the moment I figured from left to right: 1 = Gate, 2 = source, 3 = drain). The diode is a Schottky Diode (60V 5A SB560). Here's an image of the setup:

Then I directly connect the solenoid with the 12v it works. Also if I change drain and source the solenoid gets powered but isn't controlled by the arduino (its like directly connected to the power).
Did i connect something wrong or might be something damaged already?

@cjdelphi: how do you mean changing the logic?

Swap drain and source (gate drain source)

You also have the pulldown 47? K on the wrong side, it needs to be connected directly to gate

(High/low logic... to answer your question high = off. Low = on)

I have swapped them (its like written in the image now)
yes 47k, i removed the 330 ohm resistor and connected the pin 9 directly to the gate and the pulldown resistor. but it still doesnt seem to get powered...

it basically looks like this now: (except for I have an 47k resistor, a 12 v solenoid and use pin 9)

You still need a resistor to gate to protect the pin.

The pulldown goes to gate directly, arduino pin via the resistor to gate

Now your photos show drain and source wrong, swap them leave the gate pin alone.

marwi:
I removed the 330 ohm resistor and connected the pin 9 directly to the gate and the pulldown resistor. but it still doesn't seem to get powered...

Don't remove the 330 ohm resistor. There is no way it can be causing the arrangement not to work. 330 ohm; 220 ohm - you will see no difference.

First things first. Connect the Arduino to just the 330 ohm resistor and a LED on your breadboard and verify that the LED is being controlled as you expect.

hi paul, that so far worked as expected. the led flashes for ~10 msec.

int basePin = 9;
int led = 13;

int s = 1000;
int d = s * 2;

void setup()
{
  pinMode(basePin, OUTPUT);
  pinMode(led, OUTPUT);
}

void loop()
{
  for(int i = 0; i < 2; i++)
  {
    analogWrite(basePin, HIGH);
    digitalWrite(led, HIGH);
    delay(10);
    analogWrite(basePin, LOW);
    digitalWrite(led, LOW);
    delay(s);
  }
  delay(d);
}

marwi:
hi paul, that so far worked as expected. the led flashes for ~10 msec.

int basePin = 9;

int led = 13;

int s = 1000;
int d = s * 2;

void setup()
{
  pinMode(basePin, OUTPUT);
  pinMode(led, OUTPUT);
}

void loop()
{
  for(int i = 0; i < 2; i++)
  {
  [font=Verdana]  analogWrite(basePin, HIGH);[/font]
    digitalWrite(led, HIGH);
    delay(10);
    [font=Verdana]analogWrite(basePin, LOW);[/font]
    digitalWrite(led, LOW);
    delay(s);
  }
  delay(d);
}

??
see what happens if you replace "HIGH" and "LOW" with different values in the analogWrite() commands :wink:

SO SIMPLE! alnath you made my day/evening. Thanks a lot to all of you guys! Replacing HIGH/LOW with 255 and 0 solved everything. It completely works now! Thank you :slight_smile: