電子工作78 – アルミ鍋と電気コンロを使う6種類の時間モード・タイマー付き室内加温・加湿システムの製作

Electronics Project 78 - Humidifying & Heating-up Room with Steam Generated from Aluminum Pot and Electric Stove Under Control of Presettable Timer

 

 

概要

   また冬がやって来た。部屋は冷えるし、乾燥する。そこで、部屋を温めると同時に加湿する目的で、アルミ鍋と電気コンロを使って暖房し加湿するシステムを作ることにした。鍋の水が全て蒸発した時に電気コンロへの通電を自動的に停止するために、前の電子工作51の簡易タイマーと温度センサーを組み合わせ、さらに、プログラムの一部を改良して使った。これで鍋の空焚きを気にせずにすむ。タイマーでは、30分、1、2、3、4、5時間の6つの時間モードが選択できる。

  Here in Tokyo, winter is cold and dry. To heat up and humidifying my room, I built a simple appliance system in which an aluminum pot and an electric stove are used to generate steam and heat, combined with the use of the presettable 6-time mode timer (Electronics Project 51 in Japanese). It was the key point how to stop the AC100V power supply to the electric stove when water in the pot is died up. To solve this problem, I installed a thermo sensor to the pot’s outer wall. When the wall temperature increases to a predetermined temperature (depending on a resistor value used), the output level of the thermo sensor turns from Low (0V) to High (5.0V) that is detected by 16F688, stopping the power supply to the stove. So, you have no worry about the overheating of both pot and stove.

 

回路図 Circuit Diagram

下に回路図を示す。 前の電子工作51のものとほぼ同じである。ただ、今回は温度センサー(TC622EPA)からの信号を取り込むために16F688のRA5(Pin2)が使われている。元々、このタイマーは6つの時間設定ができ、モードSWで“時間が来たらONだった出力をOFFにする”、または、“OFFだった出力を時間が来たらONにする”という機能のものである。鍋に取り付ける温度センサーが動作するのは“時間が来たらONだった出力をOFFにする”というモードの場合のみである。 

Following is the circuit diagram of the humidifying and heating-up system for my room. The presettable 6-time mode timer used here was built several years ago. This 6-time mode timer was built to turn off or turn on AC100V electric appliances after the end of one of the presettable times (30min, 1, 2, 3, 4, 5hrs). As the internal clock based software timers (Counting up and down of PicBasic’s Pause command) are used, initially they were thought to be not accurate. Later found they are surprisingly reasonably accurate as shown below:

Set time

30 min

1 hr

2 hrs

3 hrs

4 hrs

5 hrs

Measured time

29m 59s

60m 1s

1hrs 59m 57s

2hrs 59m 55s

3hrs 59m 46s

?

(Each data based on one measurement)

 

While a time mode is being selected, the corresponding LED indicator lights up. It is possible to change that time mode to any other time mode by turning the 100K VR knob. A new time counting up or down starts from there immediately. To detect the output level change of the thermo sensor, a minor modification is made for the original program.

(Fig.1)

 

 

温度調整出来る電気コンロ(1200W)の上にアルミ鍋(直径18cm、高さ9cm、容量1.7L)が載せてあり、その上部外壁に温度センサがセットしてある。そこから出ている3本線が下にある簡易タイマー(電子工作51で製作したもので、SSRの容量を25Aに大きくしてある)に接続してある。

An aluminum pot (diameter 18cm, height9cm, volume1.7L) containing water is heated to generate steam by an electric stove (max 1200W, with the control knob). When water is dried up, the temperature of the pot increases rapidly and the thermo sensor attached to the upper outer wall of the pot detects the temperature increased over its turnover temperature determined by a resistor value, sending the level change signal (Low to High) to 16F688 of the simple timer shown below. As a result, the system stops functioning while lighting up Flashing LED.

(Photo 1)

 

アルミ鍋の外側上部にセットして温度を検知する温度センサー、このICの上部が接触して温度を検知する。右の写真は使用する抵抗の値とこのICの出力が反転する温度の関係を示す。

Thermo sensor TC622EPA (–40 to +85 degree C); its upper surface directly contacts with the upper outer surface of aluminum pot for measurement. The right photo shows the relationship between resistor values used and temperatures at which the output level of the IC turns over (for example, 150K ohm to 65 degrees C).                                                                                       

                                                                                                                                                                  

                                                                                                                                                                 (Photo 3)

 (Photo 2)

 

 

 

 

上の写真では基板に載った8ピンの温度センサICが見える。その上部面がアルミ鍋の表面に直接接触する。下の写真はその裏側で検知温度を設定するための200K VRがあり、5V電源、GND、出力のための3本の線が出ていて16F688につながる。

The upper photo shows the thermo sensor mounted on the circuit board, of which upper surface contacts with the outer wall surface of the pot. The lower photo shows the back side of the board on which a 200K VR is mounted to set up a turnover temperature that determines the stoppage of the system.

(Photo 4)

 

基板に載った温度センサがプラスチック製のクリップでアルミ鍋の外壁に固く密着さえられている。ICの頭部が検温部になっている。

With a plastic clip, the upper part of thermo sensor mounted on circuit board is forced to evenly contact with the outer wall surface of aluminum pot.’s upper section.

(Photo 5)

 

結果&コメント

1)     ほぼ予想通り動作することが分かった。

2)     電子工作51のプログラムをちょっとだけ変えることによって温度センサーの入力を受け付けるようになった。

3)     時々温度センサーからの信号を検知しないことがあった。冷却ファンにキャパを入れたり、温度センサーまでのケーブルをまっすぐ伸ばしたりしている。外部からのノイズが問題のようだ。

4)     温度センサーで、ある温度(今回は150K ohmに設定)になったら検知して、その出力信号を利用するというのも目的の一つなので、実際にこのシステムを製作してみてハードとソフトのことが良くわかった。

5)     製作にでは家にあったものを使ったので、ほかに100円ショップでアルミ鍋を購入するぐらいで済んだ。

 

Results and Comments

1)     The system works well. It can humidify and warms up my room. Even I happens to fall in sleep, it will be safe because the timer stops the system when a set time period expires or the water in the pot dries up by evaporation, with help of thermo sensor attached to the wall of aluminum pot.

2)     It is my main interest to include the thermo sensor detecting function into the program of my old timer. With the inclusion of a couple of lines into the old program, my aim was achieved.

3)     The key components Thermo sensor (TC622EPA) and 16F688 only cost 90 and 120 yen, respectively.

 

プログラム

   今回のプログラムは、前の電子工作51の簡易タイマーのプログラムを温度センサーからの入力を受け入れることが出来るように一部変えたものである。具体的には“時間が来たらONだった出力をOFFにする”モードの6種類の時間の各カウントルーチンの中にIf Tempsensor=1 Then Finishing1 という1行を入れてある。アルミ鍋の水が全て蒸発して鍋壁に取り付けたある温度センサーがその設定温度を超えた時の出力のLowからHighへの変化を捉えてFinishing1へ飛ばしシステムを終了させる。なお、“OFFだった出力を時間が来たらONにする”モードでは温度センサーを検知する機能は持たせていない。

Program

This program was used in the previous Electronics Project 51 written in Japanese (its program: SimpleTimer16F688A.bas). The E..Proj. 51 is a simple presettable timer of which main functions: 1) You can set any one of 30min, 1, 2, 3, 4, 5hrs time periods at a time; 2) By changing Mode SW, you can select Turn OFF or ON mode in which the system turns off or on when a set time expires; 3) A time period (one of the described 6 time periods) chosen can be changed freely to any other time period by turning VR 100K knob while referring to 6 LED indicators, and then a new time counting starts immediately afterward; 4) If the system stops due to the end of time counting or the detection of a temperature higher than a preset one (depending on resistor value) by the thermo sensor, the flashing LED lights up to inform the stoppage of the system. To restart the system, simply press Reset SW.

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

'SimpleTimer16F688Ahumi.bas - 2015.1.20 modified for humidifier  works OK!

'Using Picbasic Pro V2.50A and 16F688

'Internal clock 4MHz used

'Timer - ON or OFF when time expires (30 min, 1, 2, 3, 4, 5 hours – 6 time settings)

'Thermo sensor was added to the system.

'********Pin connections************

'Pin 1: Vdd (5V)

'Pin 14: Vss (GND)

'Pin 2: PORTA.5: input - connected to temp. sensor (new 15.1.20)

'Pin 3: PORTA.4: output - connected to flashing LED via 1K

'Pin 4: PORTA.3: input - connected to MCLR

'Pin 5: PORTC.5: output - connected to LED1

'Pin 6: PORTC.4: output - connected to LED2

'Pin 7: PORTC.3: output - connected to LED3

'Pin 8: PORTC.2: output - connected to LED4

'Pin 9: PORTC.1: output - connected to LED5

'Pin 10: PORTC.0: output - connected to LED6

'Pin 11: PORTA.2: input - connected to Mode SW

'Pin 12: PORTA.1: output - connected to SSR

'Pin 13: PORTA.0: input - analogue input of 0-5.0V from VR 100K

'Power supply - AC adaptor 3.5 - 5.5V 200mA

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

Define ADC_BITS 10     '10-bit ADC used

Define ADC_CLOCK 3     'Internal clock used ?

Define ADC_SAMPLEUS 50 'Sample timing

ADCON0=%10000011 

'=131 (decimal) 'bit7=1(right justified),bit6=0(volt refer-Vdd),

'bit5-4=0(unimplemented),bit3-2=00(channel0-An0),

'bit1=1(starts right away),bit0=1(on operation)

ANSEL=%00000001   'AN0 of A/D used

CMCON0=7          'turns off comparator function

TRISA=%00101101   'A0 - 0-5.0V input from divider, A5 - input from temp. sensor

TRISC=%00000000   'all are outputs

Vin var word  'AD input value from VR 100K

ModeSWInput var PORTA.2 'Mode SW input from Mode SW (ON or OFF when time expires)

Tempsensor var PORTA.5  'Tempsensor - ON/OFF (two input modes) (new 15.1.13)

SSRSW var PORTA.1 'SSRSW - ON/OFF of SSR

FlashLED var PORTA.4  'flashing LED to indicate the expiring of time

 

LED1 var PORTC.5  'ON/OFF of LED1

LED2 var PORTC.4  'ON/OFF of LED2

LED3 var PORTC.3  'ON/OFF of LED3

LED4 var PORTC.2  'ON/OFF of LED4

LED5 var PORTC.1  'ON/OFF of LED5

LED6 var PORTC.0  'ON/OFF of LED6

m var word

n var byte

 

SSRSW=0

FlashLED=0

Tempsensor=0  '(new 15.1.13)

 

Loop:

Adcin 0, Vin

Pause 5  'Wait 5ms

 

'Selecting voltage range (5V - 1024/6 fractions=171)

If (171>=Vin) then LED1ON                 '171 - 5V - 30 min

If (171<Vin) and (Vin=<341) then LED2ON   '341 -

If (341<Vin) and (Vin=<512) then LED3ON   '512 -

If (512<Vin) and (Vin=<683) then LED4ON   '683 -

If (683<Vin) and (Vin=<854) then LED5ON   '854 -

If (854<Vin) then LED6ON                  '>854 - 0V - 5 hrs

 

'Indicating selected voltage ranges on LED1-6

LED1ON: High LED1: Low LED2: Low LED3: Low LED4: Low LED5: Low LED6

If ModeSWInput=0 then LED1Tcount

Goto LED1TcountDown

LED2ON: Low LED1: High LED2: Low LED3: Low LED4: Low LED5: Low LED6

If ModeSWInput=0 then LED2Tcount

Goto LED2TcountDown

LED3ON: Low LED1: Low LED2: High LED3: Low LED4: Low LED5: Low LED6

If ModeSWInput=0 then LED3Tcount

Goto LED3TcountDown

LED4ON: Low LED1: Low LED2: Low LED3: High LED4: Low LED5: Low LED6

If ModeSWInput=0 then LED4Tcount

Goto LED4TcountDown

LED5ON: Low LED1: Low LED2: Low LED3: Low LED4: High LED5: Low LED6

If ModeSWInput=0 then LED5Tcount

Goto LED5TcountDown

LED6ON: Low LED1: Low LED2: Low LED3: Low LED4: Low LED5: High LED6

If ModeSWInput=0 then LED6Tcount

Goto LED6TcountDown

 

'Counting time

LED1Tcount: '30 min  OFF when time expires

High SSRSW  'SSR -> ON     

For m=1 to 176  '30 min   adjusted after actual measurement (180 in theory)

For n=1 to 40       '10 sec

Adcin 0, Vin

Pause 5  'Wait 5ms

If (171>=Vin) then

Pause 250  '250 ms

Else

Goto Loop

Endif

IF Tempsensor=1 Then Finishing1 'If tem.sensor activates, jump to Finishing1 (new 15.1.20)

Next n

Next m

Low SSRSW  'SSR -> OFF

Goto Finishing

 

LED1TcountDown:   '30 min  Turning ON when time expires

Low SSRSW  'SSR -> OFF    

For m=1 to 176  '30 min  adjusted after actual measurement (180 in theory)

For n=1 to 40       '10 sec

Adcin 0, Vin

Pause 5  'Wait 5ms

If (171>=Vin) then

Pause 250  '250 ms

Else

Goto Loop

Endif

Next n

Next m

High SSRSW  'SSR -> ON

Goto Finishing

 

LED2Tcount: '1 hour

High SSRSW  'SSR -> ON

For m=1 to 352 '176 x 2

For n=1 to 40       '10 sec

Adcin 0, Vin

Pause 5  'Wait 5ms

If (171<Vin) and (Vin=<341) then

Pause 250  '250 ms

Else

Goto Loop

Endif

IF Tempsensor=1 Then Finishing1  '(new 15.1.20)

Next n

Next m

Low SSRSW  'SSR -> OFF

Goto Finishing

 

LED2TcountDown:   '1 hour 

Low SSRSW  'SSR -> OFF

For m=1 to 352      '1 hour

For n=1 to 40       '10 sec

Adcin 0, Vin

Pause 5  'Wait 5ms

If (171<Vin) and (Vin=<341) then

Pause 250  '250 ms

Else

Goto Loop

Endif

Next n

Next m

High SSRSW  'SSR -> ON

Goto Finishing

 

LED3Tcount: '2 hours

High SSRSW  'SSR -> ON

For m=1 to 704      ' 2 hours (352 x 2)

For n=1 to 40       '10 sec

Adcin 0, Vin

Pause 5  'Wait 5ms

If (341<Vin) and (Vin=<512) then

Pause 250  '250 ms

Else

Goto Loop

Endif

IF Tempsensor=1 Then Finishing1  '(new 15.1.20)

Next n

Next m

Low SSRSW  'SSR -> OFF

Goto Finishing

 

LED3TcountDown: '2 hours

low SSRSW  'SSR -> OFF

For m=1 to 704

For n=1 to 40       '10 sec

Adcin 0, Vin

Pause 5  'Wait 5ms

If (341<Vin) and (Vin=<512) then

Pause 250  '250 ms

Else

Goto Loop

Endif

Next n

Next m

High SSRSW  'SSR -> ON

Goto Finishing

 

LED4Tcount: '3 hours

High SSRSW  'SSR -> ON

For m=1 to 1056

For n=1 to 40       '10 sec

Adcin 0, Vin

Pause 5  'Wait 5ms

If (512<Vin) and (Vin=<683) then

Pause 250  '250 ms

Else

Goto Loop

Endif

IF Tempsensor=1 Then Finishing1  '(new 15.1.20)

Next n

Next m

Low SSRSW  'SSR -> OFF

Goto Finishing

 

LED4TcountDown: '3 hours

Low SSRSW  'SSR -> OFF

For m=1 to 1056

For n=1 to 40       '10 sec

Adcin 0, Vin

Pause 5  'Wait 5ms

If (512<Vin) and (Vin=<683) then

Pause 250  '250 ms

Else

Goto Loop

Endif

Next n

Next m

High SSRSW  'SSR -> ON

Goto Finishing

 

LED5Tcount: '4 hours

High SSRSW  'SSR -> ON

For m=1 to 1408

For n=1 to 40       '10 sec

Adcin 0, Vin

Pause 5  'Wait 5ms

If (683<Vin) and (Vin=<854) then

Pause 250  '250 ms

Else

Goto Loop

Endif

IF Tempsensor=1 Then Finishing1  '(new 15.1.20)

Next n

Next m

Low SSRSW  'SSR -> OFF

Goto Finishing

 

LED5TcountDown: '4 hours

Low SSRSW  'SSR -> OFF

For m=1 to 1408

For n=1 to 40       '10 sec

Adcin 0, Vin

Pause 5  'Wait 5ms

If (683<Vin) and (Vin=<854) then

Pause 250  '250 ms

Else

Goto Loop

Endif

Next n

Next m

High SSRSW  'SSR -> ON

Goto Finishing

 

LED6Tcount: '5 hours

High SSRSW  'SSR -> ON

For m=1 to 1760

For n=1 to 40       '10 sec

Adcin 0, Vin

Pause 5  'Wait 5ms

If (854<Vin) then

Pause 250  '250 ms

Else

Goto Loop

Endif

IF Tempsensor=1 Then Finishing1  '(new 15.1.20)

Next n

Next m

Low SSRSW  'SSR -> OFF

Goto Finishing

 

LED6TcountDown: '5 hours

Low SSRSW  'SSR -> OFF

For m=1 to 1760

For n=1 to 40       '10 sec

Adcin 0, Vin

Pause 5  'Wait 5ms

If (854<Vin) then

Pause 250  '250 ms

Else

Goto Loop

Endif

Next n

Next m

High SSRSW  'SSR -> ON

Goto Finishing

 

Finishing:       'Coming here when time counting expires and lighting up Flashing LED

High FlashLED

End

 

Finishing1:     'Coming here when the level-change signal from thermo sensor is detected

High FlashLED

LOW SSRSW

End

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

'Note:                                                                                             

   'melabs U2 Programmer's configurations: 16F688

'FOSC – INTOSCIO; WDTE - Enable; Power-up Timer – Enable;  'MCLRpin – Reset ; BODEN - Enable; Internal External Switch Over – Enable,

'Fail-Safe Clock Monitor – Enable, CD - Disable; Data EPPROM – Disable

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

 

Menu Page へ戻る (Return to Menu Page)

Top へ戻る        (Return to Top of Page)