Pages: [1]   Go Down
Author Topic: Arduino 5V output - Switch a device on/off with relay  (Read 2087 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I am running a camera that requires 5V 80-100mA. I can use the 5V output of arduino, no problem. I tried running from a digital pin(which I believe provides ~40mA), this does not work. So I tied 3 together to get my mA requirement. I rather not use all of these pins just to provide power to camera, can I put a relay on the 5V out instead?

Thanks,

-ren
Logged

Offline Offline
Faraday Member
**
Karma: 66
Posts: 2578
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Paralleling pins - Gasp!
Get a 5V reed relay, the one Radio Shack sells is just right, and its contacts are rated for 1/2A.
If you don't live in America, look for one with a coil resistance of 200Ω or so.  And.. you need that diode, too, [though some have that integral.]
Or - get a transistor.

* * * *
http://s270.photobucket.com/albums/jj118/new_clear_days/circuits/?action=view&current=OSRRdemo-1.mp4

http://arduino.cc/forum/index.php?action=dlattach;topic=77590.0;attach=8885;image
« Last Edit: April 09, 2012, 10:29:30 pm by Runaway Pancake » Logged

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks I will give it a try!
Logged

Dubai, UAE
Offline Offline
Edison Member
*
Karma: 22
Posts: 1675
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
    Go for the transistor option, its cheaper.

Duane B

rcarduino.blogspot.com
Logged


Offline Offline
Faraday Member
**
Karma: 66
Posts: 2578
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey, renasis,
I just wanted to note that the pic was used in answer to another's question.  He was needing to trigger a camera into an active status.
But you want to switch power, so the contacts, being an SPST switch, would be placed between the supply/battery and "camera +Vin"
Logged

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

Initially I was going to use the reed relay, but I happen to have a npn 3904 transistor, so I am going to give that a try. I will have a digital pin connected to the base. I can figure out the resistor needed to give me enough current Ib, to allow the current needed for the load(camera) Ic. I will put 5V to load(camera) to the collector of the transistor. I have seen some people online putting a diode(flyback) in parallel to the load to eliminate excess voltage. I understand that this is to protect against a voltage spike at the collector of the transistor. I probably don't need this in this case because this device will not build up a charge, but I am curious as how the value of the diode is determined if I decided to add. Also, in some instances online I have seen where a resistor placed between the load and the collector, why? If it requires too much explaining, could you point me to a reference to learn about this?

Thanks,

-ren
Logged

Offline Offline
Faraday Member
**
Karma: 66
Posts: 2578
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The "backward" diode gets placed across the relay coil.  The coil, being it's a coil, has an inductance, it's an inductor, and inductors store a charge (hundreds of volts, for microseconds) - and they release that charge when they're de-energised.  The diode provides a low-resistance path for that charge (discharge).  That's it in a nutshell.
You don't have to sweat base resistor values for idealised collector current v. h_FE, etc. - anything 1K-5KΩ ought to get it good enough.
Logged

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 85
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Runaway Pancake,

Thanks for the explanation about the diode. How do you chose the proper size of diode?

Thanks,

-ren
Logged

Offline Offline
Faraday Member
**
Karma: 66
Posts: 2578
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Any 1N4000-series diode will do.
Logged

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Pages: [1]   Go Up
Jump to: