0
Offline
Full Member
Karma: 0
Posts: 167
Safety first.
|
 |
« on: March 28, 2010, 03:39:55 pm » |
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
|
|
|
|
|
Logged
|
|
|
|
|
Portugal
Offline
God Member
Karma: 5
Posts: 962
|
 |
« Reply #1 on: March 28, 2010, 04:23:47 pm » |
Use an relay to do that.
|
|
|
|
|
Logged
|
|
|
|
|
Global Moderator
Dallas
Online
Shannon Member
Karma: 129
Posts: 10376
|
 |
« Reply #2 on: March 28, 2010, 05:45:06 pm » |
Specifically, a relay that has "normally closed" contacts. When the relay is energized, the contacts are opened (the circuit is broken).
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 282
Posts: 15443
Measurement changes behavior
|
 |
« Reply #3 on: March 28, 2010, 07:04:33 pm » |
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
|
|
|
|
|
Logged
|
|
|
|
|
SE USA
Offline
Faraday Member
Karma: 35
Posts: 3650
@ssh0le
|
 |
« Reply #4 on: March 28, 2010, 07:08:08 pm » |
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
|
|
|
|
|
Logged
|
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 167
Safety first.
|
 |
« Reply #5 on: March 28, 2010, 07:27:21 pm » |
Just got my relay, looks like the one from all electronics but it was from my local hobby shop. Thanks for the hardware help! 
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 282
Posts: 15443
Measurement changes behavior
|
 |
« Reply #6 on: March 28, 2010, 09:09:52 pm » |
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
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 76
Posts: 6849
Arduino rocks
|
 |
« Reply #7 on: March 29, 2010, 02:18:50 am » |
And the relay's switching (load) current spec - if you overload it it will weld itself short-circuited. Hopefully the router is low current.
|
|
|
|
|
Logged
|
|
|
|
|
Portugal
Offline
God Member
Karma: 5
Posts: 962
|
 |
« Reply #8 on: March 29, 2010, 04:50:35 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
B0100111001000011, USA
Offline
Edison Member
Karma: 0
Posts: 1503
I'm confused. Wait, maybe not..
|
 |
« Reply #9 on: March 29, 2010, 04:58:53 pm » |
I agree. I always use a transistor with my relays no matter what (paranoid, I know  ).
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Full Member
Karma: 0
Posts: 167
Safety first.
|
 |
« Reply #10 on: March 29, 2010, 05:39:41 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
B0100111001000011, USA
Offline
Edison Member
Karma: 0
Posts: 1503
I'm confused. Wait, maybe not..
|
 |
« Reply #11 on: March 29, 2010, 06:03:28 pm » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
Left Coast, CA (USA)
Offline
Brattain Member
Karma: 282
Posts: 15443
Measurement changes behavior
|
 |
« Reply #12 on: March 29, 2010, 06:34:02 pm » |
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
|
|
|
|
« Last Edit: March 29, 2010, 06:35:05 pm by retrolefty »
|
Logged
|
|
|
|
|
Chester, UK
Offline
Sr. Member
Karma: 2
Posts: 489
Trying to return the love to none logic level MOSFETS
|
 |
« Reply #13 on: March 30, 2010, 02:20:46 am » |
As much as I love to see arduinos used..... Surely this would do exactly what you need for a few $$$ 
|
|
|
|
|
Logged
|
If your system involves lethal voltages/life critical/flamable elements - you probably shouldn't need to ask. The Arduino != PC.
|
|
|
|
B0100111001000011, USA
Offline
Edison Member
Karma: 0
Posts: 1503
I'm confused. Wait, maybe not..
|
 |
« Reply #14 on: March 30, 2010, 12:20:38 pm » |
I didn't even think of that, daveg..that could work just as well if not better... But still, I vote use the Arduino  !
|
|
|
|
|
Logged
|
|
|
|
|
|