定時插座 讓電腦自動開機?
Turn On Your PC Using a Programmable Outlet Timer?


大多數電腦主機板都支援定時開機功能,常見於 BIOS / UEFI 的「電源管理」設定中。假設你恰好只需要電腦每天(或每個月的某天)在特定時間自行啟動,而尤其重要的是,這個時間設定不需經常變更的話,那麼是很夠用了。但若你需要以較複雜的排程自動開機,或者需要經常變更排程設定,那麼定時插座似乎會比較好用,特別是那種可以設定星期、多組排程功能的機種。但定時插座僅僅控制交流電的定時通、斷,而正常情況下,供電,並不能打開電腦。因此我們得設法讓「有電」變成一個開啟電腦的觸發信號,就像有人按下電腦主機上的電源鈕一樣。

Most computer MBs support the "Wakeup on RTC alarm" function, which is typically found in the Power Management section of the BIOS / UEFI set-up screen.   It would be adequate enough if you happen to require your computer to be turned on automatically at a specific time every day (or on a certain day every month) and, most importantly, you don't need to change the alarm setting every now and then.   However, if you need to have your computer wake up on a more complicated schedule or if the schedule needs to be modified frequently, a programmable digital outlet timer appears more preferable, especially those 7-day multi-program ones.   An outlet timer is merely a timer controlling the on and off of its AC power out-put.   Yet, the presence of AC power doesn't normally turns on a computer.   So we need to figure out a way to make the "power-on" serve as a trigger for the computer to boot, as if someone presses the power button of the computer.

   


熟悉電腦組裝的人應該能找到主機板上的 "Front Panel" 插針位置,其中有兩根是用來接電腦機殼上的電源開關的。若將這 2-pin 針腳短路(接通)一下下,就能讓電腦開機。平常機殼上的電源鈕被按下時,真正發生的事,正是這二根針腳的瞬間短接。那麼是不是能給這 2-pin Power Switch 針腳再另外接兩條電線,只要定時插座一供電,就使這兩條電線瞬時導通一下子(以便打開電腦)呢?這時候,繼電器就能派上用場了!一顆時間繼電器,搭配一顆供電繼電器,再加上簡單的接線就能辦到了。

PC DIY veterans would know where to find the Front Panel header on a computer's motherboard.   On the header, there are 2 pins for the Power Switch connector of the computer's case.   By short-circuiting these 2 pins momentarily, you can turn on the PC; this is exactly what happens when you push the power switch on the computer's case.   Is it possible to connect another pair of wires to these 2 PWR SW pins so that once the outlet timer turns on, the pair of wires will also be shorted abruptly (turning on the computer)?   This is where relays come in handy!   A time relay plus a power relay and some simple wiring will do the job.

此處適用的時間繼電器,以約莫 0.1 秒或 0.5 秒的短暫延時為宜。譬如我們用一顆延時範圍為 1 秒的延時通電繼電器,將它的延時時間調到大約 0.35 秒。如下圖所示,整個構思是:當時間繼電器尚未取得供電時,什麼也沒發生。一旦開始供電,On-Delay 繼電器的常閉腳 1 和 4 立刻得電,於是啟動了右方的繼電器(Power Relay),並使其腳3 和 腳5 導通(從而使主機板上的電源開關針腳短路)。但 0.35 秒之後,延時繼電器開始作動,使其腳 1 和 腳 4 失去電力,導致 Power Relay 上的腳 3 和 腳 5 斷開。結果就是電腦主板上的 PWR SW 針腳被短路了片刻(0.35 秒),如同有人按了機殼上的電源鈕一樣。

A short period of time delay, for example, 0.1 sec or 0.5 sec, would be appropriate for the time relay employed for this task.   Let's say we use an on-delay with a time range of 1 sec, on which we adjust the time delay to somewhere around 0.35 sec.   As the diagram below shows, the plot is:  Before the time relay is triggered by AC voltage, nothing happens.   Upon application of AC voltage, the Normally Closed pins 1 and 4 of the On-Delay Relay get power instantly, which initiates the Power Relay and shorts its pins 3 and 5 (hence, shorting the PWR SW pins on the computer's MB).   But 0.35 seconds later, the On-Delay Relay will be triggered, making its pins 1 and 4 lose power and, subsequently, the pins 3 and 5 on the Power Relay be opened.   As a result, the PWR SW pins on the PC's MB are short-circuited for a moment (0.35 sec) as if someone's pushed the power switch on its case.


值得一提的是:在上述規畫中,電腦本身不必由定時插座供電。實際上,我的 PC 電源線是插在另一個獨立插座上,而不是插在定時插座上。我用定時插座供電給數據機和路由器,而非電腦。

One thing worth mentioning is:   In the plot shown above, the computer is not necessarily powered by the outlet timer.   In my case, actually, the power cord of my PC is plugged into a stand-alone socket instead of the outlet timer.   My outlet timer supplies power for my modem and router, but not my computer.




另有一種效果近似的作法,是啟用 BIOS 中的「掉電重啟」功能(BIOS 裡可能用 Resume on Power Loss 或 AC Back 之類的名稱)。這種方法不需要使用繼電器,也省了在主板上跨接 SW 針腳的麻煩。但要知道,如果採用這種方法,電腦就必須由定時插座供電。決定這樣做之前,最好先弄清楚:

  1. 你的定時插座有沒有真正接地?
  2. 電腦既然要由定時插座按排程供電,那麼你確定每次都能在預約斷電的時間到來之前將電腦關機嗎?(你可不希望電腦仍在運轉的情況下被突然斷電吧!)
以我的狀況而言,以上二題答案都是否定的,所以不會採用此法。不過,此法或許蠻適合那些排程相對固定的伺服器電腦的開關機管理工作。

An alternative way to achieve the similar goal is to enable the "Resume on Power Loss" function in BIOS. (Some BIOS's may say "AC Back")   This method doesn't require relays and the trouble of tapping into the front panel header on the MB.   But keep in mind that your computer has to be plugged into the outlet timer if you choose to make use of this "AC Back" BIOS feature.   And before making the decision, you may want to think about:

  1. Does the outlet timer provide a true grounded socket for your PC?
  2. Now that your PC is powered by a programmable timer, can you make sure to shutdown the computer every time before the timer is planned to turn off?   (You don't want the power to be cut off while the computer is still running, do you?)

In my case, the answers to these 2 questions are both negative; so I won't take this method into use.   Nevertheless, it might be ideal for those who administrate server computers working on a relatively constant daily schedule.




至於如何讓電腦在指定的時間自動關機,雖然無關本文主旨,但可順帶一指:
As for how to have the computer shut down at a specific time, although it's no concern of this article, here's a brief hint:



返回  Layman's Playground