hello! i'm using the arduino to control ALL the lights in my room, and doing so i needed to use many relays. I have 1 - 30 amp relay, and 3 - 1 amp relays, and i also believe a .5 amp relay. I'm also possibly going to add another 30 amp relay to control my air conditioning. Now im sure naybody who knows anything will know right away just hooking all these up to the arduino will make it reset itself because trying to switch most of those, or even all the relays on will draw too much power. The long and hard way i was thinking of doing this is geting some very small amperage relays, and another 5v source thats stronger, and having to make the arduino switch the smaller relays to connect them to the better external 5v source, so they can switch on the bigger relays. I was randomly searching through the web and read a little about transistors. can transistors help me use all my relasy with the arduino so i can turn them all on without drawing too much power form the arduino?
Yes, you want to learn about transistors. Transistors will draw very little power from Arduino and will switch plenty of power for driving relays.
You'll also probably want to learn about snubber circuits (flyback diodes, transient voltage suppressors) to protect your transistors and relays when all this abrupt switching goes on. But I expect others much more qualified than I will come by to offer some advice soon.
This is a good on about transistors:-
http://www.kpsec.freeuk.com/trancirc.htm
Also see:-
http://www.thebox.myzen.co.uk/Workshop/Motors_1.html
It says motors but is about relays as well.
thank you very much for all the help! it's nice to learn about another component which looks like it could help me alot!!
let me just try and get this strait however, just so i don't mess anything up haha. I connect my output pin to the base of the transistor. i connect the emitter to ground, and then collector to my relay, and the other side of my relay to... vcc?
also should i put anything else in the circuit, because im not sure but will this increase the amount of current returned to the arduino possibvly damaging it?
...and the other side of my relay to... vcc?
Your described schematic is correct.
should i put anything else in the circuit
Yes. Did you read the "protection diode" section of the first link Grumpy_Mike provided? And the second link he provided?
I also recently learned that it's good practice to connect a 10k resistor between Arduino digital out and ground so that if the Arduino is off the base doesn't float and accidentally turn the transistor on.
yes i read the diode protection but i wasn't sure if that would protect the arduino, and how it would do it, basically seemed like they piggybacked a wire around the motor, and just put a diode so that electricity could not flow in the wrong direction causing a short... i wasn't sure how that would protect the arduino, but from your comment im guessing it does assist in protecting, thank you! and i will definitely put in the resistor between the digital out and ground. my only question would be, if i do connect the 10k resistor from the ground to out, wil that affect my circuit inbetween the digital out back to ground? ( to the relay and such... )
and i will try this asap and post back results also!!
Hello everyone!
My name's Fabio and I'm a new italian Arduino user... pleased to meet you all!
I'm dimming 12V, 20W lamps by an Arduino duemilanove and some mosfets (IRL520N)... I read a lot about this on the web, but I still got some questions I can't find the answer to: :-/
- Is the IRL520N the right modfet to dim 12W 20W lamps by PWM?
- Have I to put a resistor or a diode between the arduino PWM pin and the mosfet gate (some say "put a diode!", some "put a resistor, 300 up to 1k!" and some say "no no, do NOT put any resistor or diode!)?
- How many mosfets can I control by a single Arduino pin? I read the mosfet datasheet but couldn't find this current absorbtion... I only know that Arduino is able to supply only some mA, like 20 or 40...
Sorry for my poor english, and thank you in advance for your answers... I'm new to this and getting pretty mad! :o
bye!
Fabio
i think you will get more help if you post this in a new thred, in the correct section if applicable
- Is the IRL520N the right modfet to dim 12W 20W lamps by PWM?
Yes, that is a good choice.
- Have I to put a resistor or a diode between the arduino PWM pin and the mosfet gate (some say "put a diode!", some "put a resistor, 300 up to 1k!" and some say "no no, do NOT put any resistor or diode!)?
No diode required or desired, series resistor 300-1K desired but not required. I like to wire a 10k resistor from gate to ground to ensure the MOSFET turns off if Arduiono is powered off before external lamp power is turned off.
- How many mosfets can I control by a single Arduino pin? I read the mosfet datasheet but couldn't find this current absorbtion... I only know that Arduino is able to supply only some mA, like 20 or 40...
Mosfet gate do not consume continous current as they are insultated from the gate/source terminals. They only charge or discharge the capacitance of gate terminal, so current is sourced or sunk from the Arduino pin only during switching transistions. I suspect a Arduino digital output pin could control several mosfets but it would really have to be calculated or measured. If you were planning on driving a lot of power mosfets from one pin I would consider using a mosfet driver chip like this:
http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=170396832896&ssPageName=STRK:MEWAX:IT
Lefty
A clear and usesful answer. Thank you retrolefty!
So, I'm starting with:
- a 300 series resistor on Arduino pin
- a good 10k resistor on the mosfet gate to ground
I need to dim nr. 4 12V 20W lamps (4 mosfets, one each) by 2 Arduino PWM pins (5-6), so I'll be driving 2 mosfets per pin... I'd like to use the mosfet driver (fast switching=less heating) but I don't know how to correctly connect it between Arduino and mosfet (I'm REALLY a beginner! ). Someone's got a wiring diagram for this?
Thanks a lot in adavance!
Have a nice week!
Fabio
PS: sorry for posting in the wrong place...
I would go ahead and try it without the gate drive, I think that an Arduino output pin would drive two of your MOSFETs, worth a try anyway.
Here is a link to the datasheet for that gate driver showing pin assignments and pin descriptions:
Lefty