電子工作88 – 無線式リモートAC100Vラインスイッチの製作

Electronics Project 88 – Wireless AC100V Line Switch

 

概要    Introduction

   今回は市販の小型の無線送受信器モジュールセット(¥875)を使ってAC100VラインをON/OFFするスイッチを製作してみた。受信器モジュールには小さい機械式リレーが付いていて半導体リレー(SSR)を直接駆動することが可能であるが、接点の摩耗などの点から機械式リレーを長時間ON(閉じる)の状態にしたくない。そこで、途中に12F629(マイクロコントローラ)を入れて仕事を終えたらリレーの接点は元に戻って常にOpen(OFF)の状態に保たれるようにした。したがって、送信器のスイッチを押すとSSRがONの状態になり、もう一度同じスイッチを押すとSSRはOFFの状態になる。後はその繰り返し。簡単な内臓プログラムも作成した。

 

This time, using a set of a wireless transmitter and a wireless receiver module (costing 875 yen) I built a wireless remote control system capable of turning ON/OFF AC100V main line with the help of solid state relay (SSR). Though the relay of the receiver module can directly drive SSR, a 12F629 is introduced between the relay and the SSR in order to prevent a possible failure of the relay due to the long-time closure of its contacts. What this 12F629 does is to change the state of SSR output like ON ->OFF ->ON ->OFF … by detecting the momentary closure signal from the relay (normally open) that is activated by pressing a switch of the transmitter. Here, as the receiver is set to be in the momentary mode, its relay’s contacts close only when a SW is being pressed and it stays open when a SW is not being pressed.

 

回路図   Circuit Diagram

下に示す様に、送信器からのSW(スイッチ)入力信号をミニ受信器が受け取ると内蔵の機械式リレー(公称容量2A)の接点が閉じ、12F629 のGP0にHigh(5V)信号を送る。プログラムの中で処理された後、GP1からHigh信号を出してSSRをONにする。次のSW入力信号で、GP0からHigh信号を読み込むと12F629は2度目と判断してGP1からLow(0V)信号を出してSSRをOFFにする。あとはSWを押す毎に同じON->OFF―>ON->OFF….を繰返す。GP0とリレーの可動接点との間に4.7KでGNDにつなげてあるが誤動作を防止するためである。これが無いと接点がOpen時でも不安定な20−60mVの電圧がかかる。これが原因と考え抵抗を入れるとほぼ0Vと安定し誤動作が起こらなくなった。ミニ受信器は学習機能が備わっていて送信器を16台まで登録出来る。今回は、下の写真に示すように専用の2チャンネル送信器のキー「B」と前の電子工作87で製作した4キー付き送信器の「SW0」を登録させた。したがって、両者の送信器からミニ受信器を動作させることが出来る。

In the following circuit (Fig. 1), Mini Wireless Receiver activates its built-in mechanical relay (2A) when it receives a SW-ON signal from the transmitter, which then drives SSR to turn ON/OFF electrical appliances. As I chose the momentary mode for this receiver by soldering, the contacts of its built-in relay close only while a designated SW of the transmitter is being pressed, leaving the contacts kept open at all other times. A 4.7K resistor connected to one contact of the relay and GND is found essential, without it the system does not work.

 (Fig.1)

 

 (Photo 1) 実験中の受信部: 左上の赤いのがミニ受信器、裏側にリレーが付いている。その右の黒い素子はSSRで、5Vで動く。

An experiment is going on. The red-colored item on the board is Mini Wireless Receiver with a relay and the learning function (RX315-K1L4-5V). The black item next to the Receiver is SSR capable of turning ON/OFF AC100V electrical appliances. Below them, 12F629 is set on a zero-insertion force IC socket.

 

 

(Photo 2) 左の写真は2チャンネル送信器とミニ受信器(リレーが見える)、右の写真は前の電子工作87で製作した送信器。前者のキー「B」と後者のSW0」をミニ受信器の学習機能で登録した。つまり、いずれかを押すとミニ受信機が反応する。

The left photo shows 2-channel transmitter (315MHz/2CH, S-RC2260-2CH106) and the upper view of Mini Wireless Receiver with a relay (Entry-key "B" registered), while the right photo shows the transmitter prepared in the previous Electronics Project 87 in which "SW0" (leftmost SW) is registered to Mini Wireless Receiver using its learning function.

 

 


結果とコメント

1)    2種の送信器をミニ受信器の学習機能を使って登録し、2チャンネル送信器の「B」、または電子工作87で製作した送信器の「SW0」を押すことによってミニ受信器と通信しSSRを動かすことが出来るようになった。

2)    ミニ受信器内蔵のリレーが閉じて5VがGP0に入る時のL(V) -> H(5V)波形変化をオシロで観察したら、所謂、チャッタリング(Chattering)はほとんど見られなかった。0Vからほぼ垂直に5Vに立上がって、その状態を保持する。プログラムでは一応50msの間隔をおいて2回Hの状態であることを確認してから次のルーチンに進むようにしている。

3)    ミニ受信器ではLatchかMomentaryモードが選択できる。今回はハンダを盛ってMomentaryモードにした(送信器のSWを押している間だけ内蔵リレーが閉じる)

4)    ミニ受信器は待機時6mAほどの電流を消費、電源表示LED(R)が点灯時7mA、SSRが駆動されLED(Y)も点灯した時20mA消費する。内臓リレーが動作する時は一瞬35mA位の電流が流れる。

5)    2チャンネル送信器は内蔵の12V電池で駆動されていて、全アドレスは無接続(floating)の状態である。学習機能が備わっていて送信器16台まで登録可能。通信距離30−100mとある。

6)    ミニ受信器はそこそこ電流を消費するので(6−35mA)、実用機では電源として電池駆動は無理でDC5V のUSB ACアダプタあたりが適当と思われる。

7)  主要部品の購入費: ミニ受信器が375円、2チャンネル送信器が500円、SSRと12F629がそれぞれ150円ほどであった。前の2つは東京のaitendoで入手。

 


Results and Comments

1)      Mini Wireless Receiver has the learning function capable to register 16 transmitters. Two transmitters were registered to Receiver this time. One is Entry-key "B" of 2-channel Transmitter and the other is Entry-key "SW0" of Transmitter prepared in the previous Electronics Project 87.

2)      Mini Wireless Receiver has two modes, Latch and Momentary. For this, Momentary mode was chosen by soldering so that its built-in relay works (or closes its contacts) only while pressing an entry-key of transmitter.

3)      Mini Wireless Receiver consumes about 6mA (7mA with LED (R) ON) when it is waiting for a key-entry and about 20mA when driving SSR and lighting up LED (Y).  Therefore, it is not appropriate to use batteries as the power source for this system.

4)      Considering a possible occurrence of chattering when the contacts of the relay close, I measured the waveform with oscilloscope and found the chattering was very small.

5)      Total cost: approximately 1500 yen.

 

プログラム

このプログラムのあらすじ: 最初の送信器からのSW入力の信号(High 5V)をKeyEntry1ルーチンで待ち、50msの間隔をおいて2回Highの信号が確認されたら、確かにSW入力があったと理解してSSRをONにする。ついで1秒間待ってKeyEntry2のルーチンに入る。ここでは2回目のSW入力を待つ。もし入力があると、1回目と同じように2回信号がHighであるかどうかを調べ、もしそうならToggleでGP1の状態を反転せてSSRをOFFにする。ついで1秒間待って最初のKeyEntry1に戻って今までと同様なプロセスを繰り返す。

 

Program

In the program, the routine first checks the key-entry pulse from transmitter twice at an interval of 50ms to examine if the level of the pulse is High (5V) in both checks. If the result is YES, then SSR is turned ON. However, if it is NO, the routine returns to the start, repeating the key-entry waiting routine. In the case of YES, after 1-second pause (wait), the routine flow enters into the second key-entry routine that is the same as the first one. If the key-entry is confirmed, using the command Toggle turns OFF the SSR. After that, the routine flow returns to the start again. Through the flow of these routines, the ON/OFF of SSR will be repeated every time a key-entry occurs.

'*****************************************************

'WLRemoteACswitch.bas    2016.3.29 works OK!                                    

'Using 12F629 and PicBasic Pro V2.50A                                     

 '********Pin connection********

'Pin 1: Vdd (5V) USB AC adapter

'Pin 8: Vss (GND)

'Pin 7: GPIO.0 - 5V input when relay closes.

'Pin 6: GPIO.1 - Output for driving SSR and LED(Y) indicator

'Pin 5: GPIO.2 - NC

'Pin 4: GPIO.3 - Input for Reset

'Pin 3: GPIO.4 - NC

'Pin 2: GPIO.5 - NC

'********Program************

WLRelayIN var GPIO.0

SSRDriveOUT var GPIO.1

TRISIO=%001001

CMCON=7  'Comparator disabled

 

KeyEntry1:  'SSR turn-ON routine

WLRelayIN=0

Low SSRDriveOUT

If WLRelayIN=1 then

Pause 50  '50ms

Else

Goto KeyEntry1

Endif

If WLRelayIN=1 then

Pause 50

Else

Goto KeyEntry1

Endif

High SSRDriveOUT  'SSR -> ON

Pause 1000  'Wait 1 sec for the next KeyEntry2

 

KeyEntry2:  ''SSR turn-OFF routine

If WLRelayIN=1 then

Pause 50 '50ms

Else

Goto KeyEntry2

Endif

If WLRelayIN=1 then

Pause 50

Else

Goto KeyEntry2

Endif

Toggle SSRDriveOUT  'Toggle SSR (Change the present state of SSR)

Pause 1000  'Wait 1 sec for the next KeyEntry1

Goto KeyEntry1

 

End

'*****End of Program******

'Note:

'melabs U2 Programmer's configurations for 12F629:

'Oscillator - INTOSC, WDTE - Enable, PWRTE - Disable, MCLR - Reset, BODEN - Enable, CD - Disable, CDP - Disable

 

 

追加情報 (2016.4.8)

実用タイプの受信器の製作

  上記の実験をもとに実際に使える受信器を下の写真 (Photo 3)に示めすように製作した。100円ショップで購入した容量800mlのポリプロピレン容器(蓋はポリエチレン製)に収納した。ミニ受信器と12F629の電源として簡便な汎用のUSB 5Vアダプタを利用しようして、5種類ほどのUSBアダプタを試したが通信距離が2−3mと短かったり、全く動作しなかったり、と実用にならなかった。そこで、写真の左に示す元々Wife装置の電源として使われていたNETGEARのSwitching Power Supply (5V 2.8A)を用いたところ、通信距離も10m強出て確実に動作するようになった。媒体が電波なので障害になるノイズなどの問題に充分配慮してあると考えられるこのアダプタだけが実際に使えることが分かった。もう一つ分かったことは上記の2チャンネル送信器のアンテナをいっぱい伸ばし、更に近くの金属導体、例えば、電線、窓のサッシなどに、そのアンテナ先端を近づけると通信距離が伸びるということである。このボックスのAC100V入出力端子に最大2A(200W)までの電気機器をつないでON/OFFさせることが出来る。

 

追加情報 (2016.4.11)

1.   上記のミニ受信器の黒いコイルアンテナの基板接合点に約15cmのヨリ線を取付けたら通信距離(感度)が上がった (Photo 4).。 すなわち、今まで送信器のSWを押しても受信機が反応したり、しなかったりが確実に反応するようになった。

2.   上記写真Photo 2 の右側の4チャンネル送信器のコイン電池を1個(3V)から2個(6V)に増やしたところ通信距離(感度)が著しく上がった

 

Newly added information (2016.4.8)

Preparation of Working Model

   The Photo 3 shows the working model of the above experimental one installed in a plastic container (volume 800ml) capable of turning ON/OFF electrical appliances having a power up to AC100V, 2A (200W). As a DC5V power source, I initially tried to use a USB DC5V adapter due to its simplicity. But I found later that any of 5 different USB DC5V adapters I tested could not satisfy the basic requirements such as a minimum transmission distance of more than 5m and stability. Finally, I tried an adapter shown in the photo - NETGEAR Switching Power Supply (DC5V, 2.8A) that came with NETGEAR wifi equipment several years ago. With this adapter, 2-channel Transmitter mentioned above can stably communicate with the Mini Wireless Receiver box at a distance of about 10m. Various kinds of noise generated in those USB DC5V adapters seem to cause the unfavorable result. It was also found that moving the stretched antenna rod of the transmitter closer to nearby conductive objects such as metal wires, aluminum window frames, etc. could somewhat extend the transmission distance.

 

Newly added information (2016.4.11)

1.      Attaching a 15-cm long stranded wire to the point on the board where the black coil-shaped antenna was soldered has improved the transmission distance (sensitivity) considerably (See Photo 4).

2.      An addition of one more coin battery (3V Li-ion) to the 4-channel transmitter shown in the above Photo 2 (power supply voltage increases from 3V to 6V) has significantly increased the transmission distance (sensitivity).

 

(Photo 3)

 

(Photo 4) アンテナ線を追加、通信距離がかなり伸びた。

Addition of 15-cm long antenna wire increases the transmission distance considerably.

 

 

Menu Pageへ戻る     (Return to Menu Page)

Topへ戻る    (Return to Top of Page)