A Unified Detection Method of Indoor Three Events by Dynamic Reconfiguration of Analog Circuit

Forgetting to turn off the tap of water, the lights and the gas cooker wastes money and leads to disasters such as fire. To inform them, individual sensor devices have been proposed and developed. But production costs and installation costs are high since each device has to be installed to each phenomenon. To tackle this problem, we proposes a single sensor device architecture using dynamic reconfiguration of analog circuits with optical sensors by each indoor three events in a time division fashion. For the water tap, an infrared LED and a photo-transistor are equipped face to face on tap. The infrared LED is blinking and the photo-transistor receives IR-ray across under the tap. When the water exists, weak IR-ray is received but not a strong IR-ray is received. By compared with two thresholds, what the tap is opened, or closed, or used can be detected. For the light, the photo-transistor received the waving IR-ray from the light. After this waving IR-ray is filtered and gained, a threshold voltage can detect whether the light is turned on/off. For the gas cooker, the photo-transistor is equipped into the body of the gas cooker toward to the fire feeder. By using the threshold voltage to the output of photo-transistor, whether the gas cooker is turned on or off can be detected. We develop a prototype system realizing our architecture. The experimental result indicates that our proposal can archive the correct detection of three events on a single device with analog circuit dynamic reconfiguration.


Introduction
In Japan, a tap water and a light, a gas cooker have been used in ordinary homes.There is some possibility of forgetting to turn off the tap and to switch the lights, to turn off the gas during our living.They cause the increase of water bill, fuel and light expenses.Also, disasters such as fire may occur.In fact, according to the 2016 White Paper on Fire Service, the number of fire gas cooker caused was 3497 incidents (1) .To prevent from them, some sensor devices have been proposed and developed to confirm three indoor events (2) .The past research shows that three indoor events could be detected by using one optical sensor and one pyroelectric sensor.Concretely the past research needs individual circuit devices to detect each event.This demerit is that production and installation costs are high if each device of each event is produced to use one device for one event.In this research, to solve problems as them, we propose the way that one device detects indoor three events by dynamic reconfiguration of correct analog circuits to each event.

Circuit for water tap
As the device supporting analog circuit dynamic reconfiguration, we employ PSoC microcomputer.Fig. 1 shows the structure of circuit detecting the tap water.
To detect forgetting to turn off the tap, an infrared sensor and a photo-transistor are used.This infrared sensor and this photo-transistor are installed face to face on tap as shown ① of Fig. 1.And the infrared sensor is produced 1 kHz pulse-wave, and the photo-transistor is received it.The output of the photo-transistor is sent to ②.
The circuit of ② cuts the direct-current.This waveform without DC is input to PSoC.The reason of cutting direct-current is to remove ambient light.Also the diode is used for preventing that the output of photodiode is negative, and the resistor is used for pulling out an electric charge of the condenser.And, at ③ , the output of the photo-transistor that direct-current is removed amplified and passed through a band-pass filter, and amplified again.
The circuit of ④ smooths the filtered and gained waveform.The smoothed voltage is dealing as level by that process.
Next, at ⑤, the level signal is passed through same size amplifier, and is did analog to digital conversion, the value of analog to digital conversion is compared with our setting value.In the case forgetting to turn off the tap, two threshold is set.One threshold is used to distinguish from the status that the tap is closed and it that it is opened.And another threshold is used to distinguish from the status that the tap is opened and it that it is used.By the compared result, it is distinguished that the tap is opened or closed or used.
Each level has a relation that the level of the tap's being closed is bigger than that of being opened.
If the tap is closed or used, the processor doesn't send a signal to LED.On the other hand, if it is opened, the processor sends to a signal.
The LED of ⑥ informs us whether the tap is closed, or opened, or used.So LED shows the tap is closed, or used when it is bright.

Circuit for light
Fig. 2 shows the structure of circuit detecting the light.The photo-diode is used, which is assigned under the light and receives IR-ray from the light.
The circuit of ② cuts the direct-current.This waveform without DC is input to PSoC.Also, the reason using other diode and resistor is same as 2.2.
At ③, the output of the photo-transistor that directcurrent is removed is amplified and passed through bandpass filter, and amplified again.
The circuit of ④ smooths the filtered and gained waveform.The smoothed voltage is dealing as level by that process.
At ⑤, the level signal is passed through same size amplifier, and is did analog to digital conversion, the value of analog to digital conversion is compared with our setting value.If the value doing analog to digital conversion is bigger than the threshold of my setting, the processor sends the signal to the LED of ⑥, so it is turned on.On the other hand, when its status is opposite, it doesn't send the signal to the LED of ⑥, so it is turned off.

Circuit for gas cooker
Fig. 3 shows the structure of circuit of detecting the gas cooker.
At ①, the photo-transistor is equipped into the body of the gas cooker toward to the feeder.It receives IR-ray from fire, and its output is sent to PSoC that indicates ②.
Next, at ② , the signal passes through same size amplifier, and does analog to digital conversion.Fig. 3 The structure of circuit of detecting the gas cooker Fig. 1 The structure of circuit of detecting the tap Fig. 2 The structure of circuit of detecting the light The value of analog to digital conversion is compared with our setting value.If the value of analog to digital conversion is bigger than the threshold of my setting, the processor judges that the gas cooker is turned on, and sends to a signal.So LED of ③ is turned on.On the other hand, when its status is opposite, the processor judges that the gas cooker is turned off, and sends to a signal.So LED of ③ is turned off.

The operation of system
In this research, we use Field Programmable Analog Array.By using it, one device detect indoor three events by dynamic reconfiguration with time division of analog interface of optical sensors by each indoor event.We explain about dynamic reconfiguration of analog circuits at PSoC.PSoC is provided with a function of analog blocks such as amplifier and band-pass-filter.Fig. 4 shows the schematic diagram of the system.In this research, we use the analog blocks of PGA and BPF2, ADC.Compared with the analog blocks of PSoC of three circuits of Fig. 4, amplification degree of PGA and frequency of BPF2 is changed.And when it is not used, it is disappeared.Also, PSoC can change value and pin by setting on software.
The operation of system is the following process.PSoC generates the tap's circuit to detect the tap, and the circuit operates as section 2.1.In the time forgetting to turn off the tap of the water, the tap's special LED is turned on.But in the time turning off the tap of water, its LED is turned off.
After detecting the tap, PSoC generates the circuit to detect the light, and the circuit operates as section 2.2.In the time forgetting to turn off the light, the light's special LED is turned on.But in the time turning off the light, its LED is turned off.
After detecting the light, PSoC generates the circuit to detect the gas cooker, and the circuit operates as section 2.3.
In the time forgetting to turn off the fire, the gas cooker's special LED is turned on.But in the time turning off the fire, its LED is turned off.

Threshold voltage about water tap
To distinguish whether the water tap is opened, closed or used, we perform the experiment to decide two thresholds.PSoC configures the analog circuit shown in Fig. 1.The output of the optical sensor and the input of A/D converter are measured when the water tap is opened, closed and used.
The result of three times measures is shown to Table 1.Also, Fig. 5 shows the optical sensor's output and the input of A/D converter.Fig. 5 (a The value distinguished between whether the water tap is closed or opened is set to 4.50V.The value distinguished between whether it is opened or used is set to 3.10V.

Threshold voltage about the light
To distinguish between whether the light is on or off, we perform the experiment to decide the threshold voltage.PSoC configures the analog circuit shown in Fig. 2. The output of the optical sensor and the input of A/D converter are measured when the light is on and off.
The result of three times measures is shown to Table 2. Also, Fig. 6 (a) shows the result of the sensor's output and the A/D converter's input when the light is on.Fig. 6 (b) depicts the result when it is off.
The value distinguished between whether the light is on or off is set to 3.42V.

Threshold voltage about the gas cooker
To distinguish whether the gas cooker is turned on or turned off, we perform the experiment to decide the threshold voltage.PSoC configures the analog circuit shown in Fig. 3.The output of the optical sensor and the input of the A/D converter are measured when the gas cooker is turned on and turned off.The result of three times measures is shown to Table3.Also, Fig. 7 shows the optical sensor's output.Fig. 7 (a) corresponds when the gas cooker is turned on.Fig. 7 (b) corresponds to when it is turned off.
From these results, we decide the threshold voltage of 0.90V to decide whether the gas cooker is turned on or turned off.

Confirming indoor three events and the result
Through the experiments mentioned from section 3.1 to 3.3, each circuit correctly operated on PSoC.So, we confirm that actually single PSoC can detect three events by dynamic reconfiguration of each circuit by LED blinking.
The experimental results are shown in Fig. 8. of tap and Fig. 9. of light, Fig. 10. of gas cooker.When water tap, light and gas cooker are turned on, the LED indicate they are turned on by lighting corresponding LED.When they are turned off, the corresponding LEDs are darken.So, we confirmed the detecting was correct.

Conclusion
This paper has proposed the unified detection method of indoor three events by using analog circuit dynamic reconfiguration.The prototype system we developed confirms our proposal can be realized practically.
As future work, we plan to combine our proposal with a human detection method to recognize the human forgetting situation clearly.Also, for the water tap, difference of the water flow affected to our system decision whether the tap is opened or closed.So, we will develop more robust detection method of the water tap closed / opened.
) shows the output of the sensor and the input of the A/D converter when the water tap is closed.Fig. 5 (b) depicts the output of the sensor and the input of A/D converter when the water tap is opened.Fig. 5 (c) indicates the output of the sensor and the input of A/D converter when the water tap is used.

Fig. 4 .
Fig. 4. The structure of PSoC's analog blocks Fig.5.Measurement result of Water tap Fig.7.Measurement result of Gas cooker References(1) T Fire and Disaster Management Agency : "The 2016 White Paper on Fire Service", p293, 2016 in Japanese (2) Ryo Imatsuchi, Yuji Ohta, Yuhki Kitazono, Makoto Miyauchi, Seiichi Serikawa : "Proposal of Detector of Forgetting to Tighten Faucet and to Turn Off Lighting and Stove", Kyushu-section joint convention record of the Institutes of Electrical and Related Engineers, p 34, 2009 in Japanese (a) Light is turned on (b) Light is turned off Fig.9.LED status about Light (a) Gas cooker is turned on (b) Gas cooker is turned off Fig.10.LED status about Gas cooker

Table 1 .
Result of the tap's each case

Table 3 .
Result of the gas cooker's each case