Go Down

Topic: Arduino Cut power! (Read 1 time) previous topic - next topic

Catcher

I don't know what you thought of the title but here's what its about.

As some may know windows 7 has wierd Internet Connectivity problems.
And from my earlier thread i said i had to cut the power for the router every now and then.

How can I use the Arduino to cut power for the router at precisely midnight every day for 30secs then continue powering the router.

I'm not letting you do all the work. Here are some ideas I planned.
In the code make the arduino sleep.
I know how to do the code.

I need help hardware-wise. How would I connect 12 volts to an arduino to have it cut the power.

Wall -> 12 volt adapter -> arduino (external power) -> router

Senso

Use an relay to do that.

Coding Badly

Specifically, a relay that has "normally closed" contacts.  When the relay is energized, the contacts are opened (the circuit is broken).

retrolefty

Quote
Specifically, a relay that has "normally closed" contacts.  When the relay is energized, the contacts are opened (the circuit is broken).


Yes, that would make for a very simple 'black box'. It would have a 12vdc input jack from the wall wart transformer and a 12vdc output cable with a plug that fits the router's power input jack. Inside the box could be a any simple "bare bones" type Arduino board that will accept 12vdc power (that is, has it's own internal +5vdc regulator).

The Arduino would then drive a small SPDT +5vdc relay, such as (  http://www.allelectronics.com/make-a-store/item/RLY-496/5VDC-SPDT-REED-RELAY/1.html ) that can be driven directly from a Arduino output pin. Do wire a reverse connected diode directly across the relay coil terminals. The relay coil's two terminals will wire to your assigned output pin and the Arduino ground pin. Turning the output pin HIGH will energize the relay, causing the normally closed contact to open, thus removing power to the router until the output pin is brought LOW.

The +12vdc input wires to both the Arduino power input and to the normally closed relay contact. The power input jack ground wires to both the Arduino board and the negative wire of the 12vdc output cable/plug. The relay's common contact wires to the positive output wire of the 12vdc output cable/plug.

I would just use a simple sketch using the millis() function to initially turn on the relay coil for 30 sec, then off,  and then again on every 24 hours worth of millis() time for 30 secs. You could wire an external reset switch to the box wired between ground and the Arduino reset pin, so you could force a immediate 30 sec 'power off' state and then start the 24 hour wait for the next automatic power interruption.

Good luck with your project, and giving Windows 7 a little Arduino helper  ;)

Lefty

Osgeld

Ive had 7 for about a month now on my "main" pc, never had a issue with its network

my pos netgear wifi router on the other hand ... so yes good luck on your idea

Catcher

Just got my relay, looks like the one from all electronics but it was from my local hobby shop.

Thanks for the hardware help! :)

retrolefty

Quote
Just got my relay, looks like the one from all electronics but it was from my local hobby shop.


Just be sure to check the relay coil current requirments. If it's more then 30ma or so you will have to use a switching transistor instead of directly driving it from an Arduino output pin.

Lefty

MarkT

And the relay's switching (load) current spec - if you overload it it will weld itself short-circuited.  Hopefully the router is low current.
[ I won't respond to messages, use the forum please ]

Senso

Even it the relay doesn't need more than 30ma direct driving it with the arduino is risk due the current spike generated by the relay.

TchnclFl

I agree.  I always use a transistor with my relays no matter what (paranoid, I know :P).

Catcher

sure, I can use a transistor as a switch rather than connecting it directly to the relay. I'm just putting things on a breadboard right now. This weekend it'll be operating.

TchnclFl

Oh, well I would still recommend a relay, but use a transistor to operate the relay (seems a bit redundant, I know).  It's using a switch to activate a bigger switch :).  Thus avoiding high current draw directly from an Arduino pin.

retrolefty

#12
Mar 30, 2010, 01:34 am Last Edit: Mar 30, 2010, 01:35 am by retrolefty Reason: 1
Quote
Even it the relay doesn't need more than 30ma direct driving it with the arduino is risk due the current spike generated by the relay.


That is the reason to always wire a reverse biased diode right across the relay coil terminals, no matter what voltage or device is driving the coil. I have had no problems driving low current (<30ma) relays directly from an Arduino output pin when properly protected by the transisent suppression diode installed across the relay coil.

Lefty

daveg360

As much as I love to see arduinos used.....
Surely this would do exactly what you need for a few $$$
If your system involves lethal voltages/life critical/flamable elements - you probably shouldn't need to ask.
The Arduino != PC.

TchnclFl

I didn't even think of that, daveg..that could work just as well if not better...

But still, I vote use the Arduino ^_^!

Go Up