Pages: [1] 2   Go Down
Author Topic: Scrap what I've got - lets get the right stuff.  (Read 1931 times)
0 Members and 1 Guest are viewing this topic.
South Africa
Offline Offline
Sr. Member
****
Karma: 2
Posts: 403
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

In another post, I was looking to use some C106D1G or 2N2222A's for controlling larger V and A to other appliances that the output pins could not handle.

Why ? well, simply because I already had these components.

But thinking about it, I think it would be wiser to use better components instead of trying to save a few cents.

So looking at other posts, I get the impression that I should be using a MOSFET, activated by the output pin ( with Resistor in series and a pull down resistor ) to control power to a 12V relay.

Please tell me if you see any flaws in this ( I need to go thru this learning curve ) :

I want to drive a small relay which, in turn, will activate a gates' magnetic lock or similar item (requires 12V 1A).
The relay spec is : N4078 2c 12v 0.2(w).  1A/125VAC.  2A/30VDC.

So my logic is :
1.  Relay can easily carry the current required by the end device.
2.  0.2W / 12V = 16mA required to drive the relay coil.

So I need to find a MOSFET that I can drive with the output pin, and can easily handle 12V 16mA. Correct ?

Here's where the difficulty starts :
Our local supplier has stock of IRLZ44NPBF MOSFETs.

Unfortunately, I don't know what I am looking for on the datasheet in relation to :
1. what V is required to fully activate the MOSFET.
2. what A the MOSFET will draw from the output pin ( need to make sure it is within the specs for the board ).
3. is there a minimum current that the MOSFET will pass from S to D ?
4. what is the maximum that can pass thru the MOSFET ?

Once I know these values, I can highlight them on my datasheet (http://docs-europe.electrocomponents.com/webdocs/0791/0900766b807913d7.pdf) and learn the terminology used. Then if you don't think this is the correct component, I can go searching for something better ( and available ).
Logged

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1643
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm trying to understand why you think you can't drive your small relay (N4078) with a 2N2222A.


* driver3.jpg (22.62 KB, 559x366 - viewed 34 times.)
« Last Edit: April 09, 2011, 06:15:16 pm by pwillard » Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17253
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's where the difficulty starts :
Our local supplier has stock of IRLZ44NPBF MOSFETs.

That is a fine LOGIC level Mosfet and it will do the job. However it's overkill to an extream for your use to pull in a 12v 16ma relay coil. That mosfet can handle up to 47amps (with proper heat sinking), and is most suited for switching large DC motors. A simple small signal npn bipolar transistor should be more then enough to handle the relay coil and should cost less then the mosfet. I would think it would be hard to find a npn transistor that can't switch that relay coil on and off.
 
Unfortunately, I don't know what I am looking for on the datasheet in relation to :
1. what V is required to fully activate the MOSFET.

That is a little tricky to find on a datasheet. The Vgs(th) is called the Gate Threshold voltage and it tells you at what gate voltage the mosfet just starts to conduct. The Rds(on) spec tells you how hard the device will turn on at various gate voltages, in your example a +5vdc on the gate will result in a device resistance of just .025 ohms which is full on for all pratical purposes. There are also graphs in the datasheet showing drain current Vs different gate voltages. Again a logic level mosfet is perfect for interfacing to an arduino digital output pin.

2. what A the MOSFET will draw from the output pin ( need to make sure it is within the specs for the board ).

The suprizing answer is that the gate will draw no current at all once it's fully off or on. The gate only draws current during the brief time it's transiting from on to off or off to on. A 300-500 ohm series resistor from the output pin to the gate will protect the output pin from the momentary current spikes during switching of the mosfet.

3. is there a minimum current that the MOSFET will pass from S to D ?

No minimum current rating, it can assume full off to full on from 0-47amps for that device.

 4. what is the maximum that can pass thru the MOSFET ?

Yes, every mosfet will have it's own specified maximum current limit, your datasheet show Is (continous source current) of 47 amps, with proper heatsinking of course.

Once I know these values, I can highlight them on my datasheet (http://docs-europe.electrocomponents.com/webdocs/0791/0900766b807913d7.pdf) and learn the terminology used. Then if you don't think this is the correct component, I can go searching for something better ( and available ).

I still think to power a simple 12vdc 16ma relay coil, a simple small npn transistor is more in line. See if they have a 2N2222A or 2N3904, or really any small npn transistor. Just wire a 1k ohm resistor from the output pin to the base of the npn, wire the emitter to ground and the collector goes to one lead of the relay coil and the other relay coil terminal goes to +12vdc. Be sure to jumper a wire from the +12vdc supply negitive terminal to a arduino ground pin, and you should be good to go.

Lefty
« Last Edit: April 09, 2011, 06:00:04 pm by retrolefty » Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I want to drive a small relay which, in turn, will activate a gates' magnetic lock or similar item (requires 12V 1A).
You can of course forget the small relay to directly control the mag lock (or whatever) with the FET.

The only reason I can see for having an intermediate relay is to make it a generic voltage-free output that you can hook pretty much anything to without worrying about voltage spikes etc.

Doing it this way keeps the FET connections short to a local relay, and the actual control wires (which may be long and prone to being abused) are connected to a relay that is very robust.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

South Africa
Offline Offline
Sr. Member
****
Karma: 2
Posts: 403
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@pwillard -- thank you so much for such a detailed drawing. really appreciated.

@Graynomad -- Yes, I am running long 12V wires ( about 40 meters ) so wanting to keep that 12V circuit separated from the Arduino by the relay.

@retrolefty -- to you too, my sincere thanks for the time and effort you put into your reply.

I have looked at the 2N2222A and 2N3904.

The 2N2222A is almost the same price as the IRLZ44NPBF MOSFET ( R4.28 in my currency -- $0.54 ) whereas the 2N3904 is only 0.31c ($0.03).

My calc tells me the relay needs 5V 0.2W = 40mA. The 2N3904 can manage 200mA continuous and needs between 0.85V and 6V to saturate the gate, so doesn't require a resistor between the pin and gate, unless I want to drop the output-to-gate to about 2V using a 150ohms resistor.

The only thing which I don't seem to be able to find, is the A that the 2N3904 base will draw from the output pin ?  Is it so small that is isn't even mentioned on the datasheet, or am I just not seeing it ?


Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset



Quote
The 2N3904 can manage 200mA continuous
That will be with a decent heatsink I would think, but at 40mA I think it would be OK in free air.

Quote
0.85V and 6V to saturate the gate
Transistors are current-driven, the voltage on the base isn't very important, basically you just have to exceed the effective diode drop of the Base/emitter junction IIRC.

Quote
so doesn't require a resistor between the pin and gate,
Yes it does, the BE junction is essentially a forward biased diode, without a resistor you have a short to 0.6V.

Quote
the 2N3904 base will draw from the output pin ?
That is controlled by the base resistor you have to have. If the transistor has a gain of 100 and you set the base current to 1mA then it will conduct 100mA. For simple switching applications there's normally no need to calculate stuff, just use some values from an example. The above schematic shows 1k, that's as good a value as any. 1k over say 4.4V (5v - diode drop of BE junction) == 4.4mA, so you only need a gain of 10 for the relays and any transistor will have that much gain.

Hope I'm right with the above, It's been some time since I thought much about transistors.

______
Rob



Logged

Rob Gray aka the GRAYnomad www.robgray.com

South Africa
Offline Offline
Sr. Member
****
Karma: 2
Posts: 403
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Rob

OK. I don't understand where you get the "short to 0.6V", "gain of 100", "1k over say 4.4V (5v - diode drop of BE junction) == 4.4mA".

However, maybe I have to stop trying to understand every detail ( until I have time to study at leasure ) and just go with the Guru's suggestions.

So either a 2N2222A or 2N3904, with a 1k resistor from pin to base as in the drawing earlier in the post, and a diode across the relay contacts.

I assume that a floating gate does not happen with a transistor like it does with a MOSFET, so no pull-down resistor required ?

Thanks again to all who have contributed to this.
Logged

South Africa
Offline Offline
Sr. Member
****
Karma: 2
Posts: 403
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK. So now we've got the right stuff for the pin output side of things, to isolate the board from the 12V system of mag locks, etc.

Now for the input.

If I am feeding 12V to a bunch of sensors ( cables up to 50m in length ) and my board is waiting for a break of the ground signal, I assume it would be best to have the 12V circuit running through an optocoupler, with only a short isolated loop from the board ground to the input pin.

I have found the following online : CNY75GA

Can anyone tell me if this should be suitable, or what the preferred part should be, and any links to how this should be wired ?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 89
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

   
Use this board ,it can drive till 4 chanels
Arduino 4 Route MOSFET Button IRF540N Free 4 cable   
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17253
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
and a diode across the relay contacts.

Diode goes across the relay's coil, not it's contacts. Cathode end to the positive 12vdc side of the relay coil.


Lefty


Logged

South Africa
Offline Offline
Sr. Member
****
Karma: 2
Posts: 403
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Lefty

Yep, I meant to say the contacts for the relays' coil.

Appreciate you catching me. will teach me to try to use the correct terminology in the future.
Logged

South Africa
Offline Offline
Sr. Member
****
Karma: 2
Posts: 403
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

   
Use this board ,it can drive till 4 chanels
Arduino 4 Route MOSFET Button IRF540N Free 4 cable   


Thanks elandd2011

At this point, I am trying to find a way to protect my board from damage in the input side.

Yes, I know that if I leave it in its box, it won't get broken, but then it wouldn't be a very interesting toy, would it.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17253
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Yep, I meant to say the contacts for the relays' coil.

Better to call them 'relay coil terminals', as 'contacts' have a specific meaning in context with relays.  smiley-wink


Lefty
Logged

South Africa
Offline Offline
Sr. Member
****
Karma: 2
Posts: 403
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Yep, I meant to say the contacts for the relays' coil.

Better to call them 'relay coil terminals', as 'contacts' have a specific meaning in context with relays.  smiley-wink


Lefty


Thanks Lefty.

Now about the best way to isolate the boards' input pins from the 12V circuit around my house (magnetic door and window contacts) .....
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17253
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Now about the best way to isolate the boards' input pins from the 12V circuit around my house (magnetic door and window contacts) .....

If you mean you have external switched +12vdc on/off signals that you want to wire to arduino input pins (digital or analog?) then you can use transistors or optoisolators or even two resistor voltage dividers. I would need to see a drawing of these system inputs to suggest the 'best' solution.

Lefty

 
Logged

Pages: [1] 2   Go Up
Jump to: