////////////////////////////////////////////////////////////////////////////////////////////////////////////////
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'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.
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!
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
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
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).
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?
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)
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.
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