電子工作82 – 冷蔵庫ドア閉め忘れ警報器

Electronics Project 82 – Fridgedoor Left Open Warning Device

 

概要    Introduction

   最近2ドアの冷蔵庫を購入した。ドアが確実に閉めたかどうか気になることがある。そこで簡単な閉め忘れ警報器を作ってみた。ドアが開いているとブザーが鳴って知らせてくれる。

 

This device simply beeps intermittently for about one hour if the fridgedoor is left open. The circuit diagram and program are shown below.

 

回路図   Circuit Diagram

下図 (Fig. 1) で、マイクロスイッチのレバーは通常冷蔵庫のドアに押されて12F629へ電流が流れない状態に保たれている。ドアを開けるとレバーが解放されて電流が12F629に供給され内蔵のプログラムが実行され、ブザーが鳴る。

 

In Fig. 1, the microswitch detects the open-or –close state of fridge. When the door is completely closed, no electricity from the coin battery is supplied to 12F629 but if the door is opened or left open, the electricity is supplied to 12F629, which then beeps the buzzer according to its built-in program. 

 

(Fig.1)

 

(Photo 1) 完成した警報器本体

Fridgedoor Left Open Warning Device assembled on board (size: 50x35mm)

 

(Photo 2) 冷蔵庫の最上部に両面テープで貼付けた警報器本体と、ドアに貼付けたレバーを押すための木片

左の写真はドアが閉じた状態、右の写真はドアが開いた状態。

 

   The left photo shows the fridgedoor's closed state while the right photo its opened state. The microswitch lever is pushed to the extreme right direction by the small wood block glued on the door, stopping the supply of electricity to 12F629. On the other hand, when the door is opened or left opened, the microswitch lever is released, supplying electricity to 12F629, which activates the buzzer.

 


結果とコメント

1)    考えられる最も簡単な回路と思っている。ブザーが鳴るとき約1mAの電流が流れる。ドアが閉じている時は全く電池の消耗はない。したがって、用いた3VのLi-ion (公称:160mAh)は通常の冷蔵庫のドアの開け閉めでは半年位はもつでしょう。

2)    マイクロスイッチは端子の3ピンが有効で、レバーが閉じて1つのピンが導通なら、別のピンは非導通になる。レバーが開いた場合は動作が逆になる。

3)    費用は全部で1000円以下。マイクロスイッチが一番高く170円ほど。秋葉原のマルツで入手可。両面テープにはダイソーのJIS Z1541という超強力タイブを使用。

4)    やっぱりマイクロコントローラ(12F629)を使うと便利。


Results and Comments

1)     This is the simplest circuit I can think of. The beeping of buzzer consumes about 1 mA. Since a 3V Li-ion coin battery’s capacity is said to be 160 mAh, it will last many months under the normal use. Of course, when the door is closed, no electricity is consumed at all.

2)     Microswitch’s three pins are all usable.

3)     The total cost is less than 1000 Yen.

 

プログラム       

   このプログラムでは、ドアを開けた時0.3秒間ブザーを鳴らし、LEDを点灯させる。そしてドアが開けたままの状態が続くと、ブザーが15秒間毎に0.2秒間隔で10回鳴り、この繰り返しが約1時間続く、やがてシステムは10時間の低電力消費のSleep状態(Watchdog TimerがEnableでないといけない)に入り終了する。

 

Program

In this program, when the door is opened, the buzzer beeps and LED lights up for 300 ms. If the door is left opened, after 15 seconds the buzzer beeps 10 times at an interval of 200 ms. This routine continues for about 3600 seconds or one hour. Then the system enters into the low-power consuming SLEEP state (Watchdog Timer needs to be Enable) for 10 hours before the END of the program.

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

'Fridgedoorwarning.bas 2015.10.5 Works OK!

'Electronic buzzer used.

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

'PicBasic Pro V2.50A used

'12F629, 4MHz Internal Clock used

'Pin 1: Vdd (5.0V)

'Pin 8: Vss (GND)

'Pin 3: GPIO.4: output- to buzzer

'Pin 4: GPIO.3: input - to MCLR via 10K resistor

'Pin 6: GPIO.1: NC

'Pin 7: GPIO.0: output to flashing LED

'Pin 2: GPIO.5: NC

'Pin 5: GPIO.2: NC

 

'*************** Main program ***********************

CMCON=7  'Comparator off

TRISIO=%001000  'all except GP3 are outputs.

 

LED var GPIO.0

Buzzer var GPIO.4

m var byte

n var Byte

 

LED=0

Buzzer=0

 

High LED:High Buzzer

Pause 300 '0.3 sec

Low LED:Low Buzzer

 

For m=1 to 190  'to become a total of approx. 3600 seconds or 1 hour

Pause 15000  '15 sec

 For n=1 to 10

 High Buzzer

 Pause 200

 Low Buzzer

 Pause 200

 Next n

Next m

 

Sleep 36000  '10 hours WDT must be set to ENABLE for reduced power consumption.

End

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

'Note:                                                                                             

   'melabs U2 Programmer's configurations  12F629

'FOSC – INTOSC; Watchdog Timer - Enable; Power-up Timer – Disable;  'MCLRpin – Reset ; Brown-out Detect - Enable;

'Code – Not Protected; Data EPPROM – Not Protected

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

 

Menu Pageへ戻る  (Return to Menu Page)

Topへ戻る  (Reurn to Top of Page)