Development of Wireless Monitoring Device for Window Security using Light Sensor

When a thief tries to enter an empty home, the window in general is targeted. To prevent such situations, we have proposed the method that same light sensors with similar circuits detect the three events on the window. However, any real device has never been developed. Also, it has been assumed that the light sensors normally are turned on without consideration of the power consumption. This paper shows the modified detecting methods to meet the capability of the low-end microcontroller and to make the power consumption efficient by intermittent action. Then we demonstrate the practical execution by using a prototype real hardware.


Introduction
When a thief tries to enter an empty house, the window in general is targeted (1) .To prevent such crime, we have to lock the key of the window at least.However, the empty home will be robbed by forgetting locking the key.Unfortunately if we have forgotten closing the window, it cannot be even fake such as the key is locked.Although we have certainly closed the window and locked the key, the thief will break the window and enter the empty home.
For the window security, many products with sensors to monitor the window status have been developed (2) .For example, a magnetic sensor is used to detect that the window and key are opened or closed.An impact sensor detects that the thief hits the window.
Instead of using the multiple different sensors, we have proposed the method that same light sensors with similar circuits detect the three events on the window in order to reduce the development cost by volume discount and installation cost (3) .The three events are that the window is opened / closed, the window is shocked, and the key is locked / unlocked.Although we indicated that the light sensor can generate the dedicated wave forms specifying the three events individually, any real device has never been developed.Also, we assumed that the light sensors normally are turned without consideration of the power consumption.
This paper shows the modified detecting methods to meet the capability of the low-end microcontroller and to make the power consumption efficient by intermittent action.Then we demonstrate the practical execution by using a prototype real hardware.
The rest of paper is organized as follows.Section 2 shows a wireless sensor node architecture employing our proposal and describes the modified detecting methods for three events on the window by using the same light sensors.Section 3 depicts the prototype hardware to verify the practical use of our proposal.Section 4 shows the experimental results and discuss them.Finally, Section 5 concludes this paper and indicates the future work.

2.
Organization and Method

Sensor Node Overview
The proposed window monitor shown in Fig. 1 has the two light sensors consisting of an infrared LED and an infrared photo transistor.One is for detecting the status of the window.Another is for detecting the status of the key.The former irradiates the infrared light to a plate attached to the window.The latter irradiates to the key handle.The reflected lights from the plate or the key handle are received by the photo transistors.The outputs of the photo transistors are gained by the amps.The gained waves are captured by the microcontroller.The microcontroller decides the status of the window and the key by decision methods mentioned in 2.2 to 2.4 using the gained waves.The result of decisions is sent to the wireless sensor network via a wireless module.
For the window, a plate to hide the light sensors from an ambient light like sunshine is attached to.Since sunshine has much infrared light, it badly affects the output of the photo transistor regardless of the irradiation from the LED.Thus, sunshine must be reduced as much as possible.The size of the plate has to be large enough to make the shadow completely covering all light sensors.The plate has the light absorbed part pained by black to the LED.This is because the open of the window must be detected even if the window is little bit opened while the plate size has to be large to make a shadow to the light sensors.

Window Open / Close
Fig. 2 shows the concept of the detecting method of the window opened / closed.Commonly, the microcontroller generates a pulse to turn on the infrared LED.The reflected light is received by the photo transistor.The output of transistor passes through a DC cut condenser to eliminate the bias inserted by ambient light.The DC cut waveform is gained by an amp.The microcontroller decides whether the gained waveform exceeds a threshold voltage (V TH ) or not.If the waveform exceeds the V TH , the window is closed.Otherwise, the window is opened.
When the window is closed as shown in Fig. 2 (a), the irradiated pulsed light is reflected by the plate (1).The reflected light may include some bias due to the ambient light.Since the plate reduces the effect of the ambient light by its shadow, the received light can make the obvious pulse on the output of the photo transistor as (2).The received pulse reaches the amp whose bias eliminated by the DC cut condenser as (3).Finally, the microcontroller gets the waveform gained by the amp exceeding the V TH as (4).
When the window is little bit opened as shown in Fig. 2  (b), the infrared light is reflected by the light absorbed part on the palate.Thus, the reflected light becomes weaker.As a result, the output of the photo transistor cannot show the obvious pulse as ( 2) and ( 3).The microcontroller cannot get the waveform exceeding V TH as (4).
When the window is opened in the day time as shown in Fig. 2 (c), the photo transistor is saturated by sunshine.Thus, the obvious pulse cannot be observed as ( 2) and (3).As a result, the microcontroller cannot acquire the waveform exceeding the V TH .When the windows is opened in the night time as shown in Fig. 2 (d), the infrared light is reflected by  3).The waveform exceeding V TH never reaches the microcontroller as (4).

Window Vibration
Fig. 3 shows the concept of the detecting method for the window vibration by a thief hitting the window.We think that the window vibration is checked only when the window and key is closed and locked.The thief may confirm whether the window and the key is opened or not at first.Finally, the thief reluctantly tries to break the glass to unlock the key.This is because breaking the window may make a loud sound and take a time that can bring significant risk to the thief.Thus, we check the open/close of the window and key at first.Then the window vibration is check at last when the window and key are closed.
To detect the window vibration, the infrared LED is turned on with a relative long period like second order as (1)  shown in Fig. 3 (a).Constantly, the light filed is formed between the infrared LED and the photo transistor as (2).When turning on the LED, the DC cut condenser shows some impulse due to the through current across the condenser as (3).The microcontroller makes some delay after driving the LED to skip this impulse noise and starts to check the output voltage of the amp as (4).
When a thief hits the window and the window is vibrated as shown in Fig. 3 (b), some oscillatory waveform appears on the constant output of the photo transistor as ( 2) and (3).The some waveforms gained by the amp will exceed the threshold voltage (V TH ) as (4).The microcontroller counts those exceed points during the period irradiating the LED.If the number of counts is larger than the threshold, the microcontroller decides that the thief hits the window.

Key Locked / Unlocked
Fig. 4 shows the concept of the detecting method of the key locked / unlocked.This is mainly for avoiding to forget locking the key when the users make their own house empty.
The methodology is almost similar to that of the window opened / closed.The light path is optimized so that the LED can irradiate the top of the key handle and the photo transistor can receive the reflected light at maximum when the key is locked.Thus, the microcontroller can get the gained waveform exceeding the threshold voltage as (4) shown in Fig. 4 (a) when the key is locked.In contrast, when the key is unlocked and the top of the key handle does not exist on the optimized light path, the microcontroller cannot acquire the waveform exceeding the threshold voltage as (4) shown in Fig. 4 (b).

Hardware Organization
Fig. 5 is the block diagram of the prototype hardware.This organization is similar to that shown in Fig. 1.
The infrared LEDs used are OS15LA5113A.The photo ).All parameters such as the capacitors, the gain of the amps, and registers were selected through the preliminary experiments.Fig. 6 is the picture of the developed prototype hardware.We attached this device to the window in our laboratory.The window faces to the south side.The corrugated paper as the plate shown in Fig. 1 is stuck to the window whose area is in front of the key.We decided the size of the plate and its light absorbed part through the preliminary experiments.

Processing Flow
To reduce the power consumption, we have developed the processing flow on the ATmega32u4 using the sleep of the ATmega32u4 and XBEE S1.To reduce the sleep power as much as possible, we selected the power down mode when sleeping for the ATmega32u4.For XBEE S1, we make it sleeps by asserting the sleep request pin.Fig. 7 shows the main processing flow.In the main function shown in the left side of Fig. 7, the microcontroller sets XBEE S1 to the sleep mode.Then the microcontroller initializes its own watch dog timer (WDT) with 0.5s interval.The microcontroller goes to the power down mode to reduce the power consumption.When the WDT interruption occurs, Fig. 8 (c) is the processing flow to detect the window vibration.The microcontroller turns on LED and waits for 100ms.The first rising edge of the LED pulse makes some voltage on the output of the DC cut condenser.This delay of 100ms is needed to avoid this unexpected wave.After the photo transistor makes the stable output due to the constant light irradiation and the DC cut condenser eliminates the DC bias completely, the microcontroller begins to check the window vibration by sampling the AD value every 10ms.When the AD value exceeds the threshold voltage (V VTH ), the microcontroller increments the software counter (cnt).After the period of 500ms with sampling every 10ms, the value of the counter is compared with the number of samples exceeding the V VTH .When the count number exceeds the threshold value previously set (NUM), the function returns 1 indicating that the window vibration occurs.

Experiment
In the experiment, we set the parameters in Fig. 8 to the values as shown in Tab. 1. Fig. 9, Fig. 10 and Fig. 11 show the experimental results.The experiments were performed in the daytime at about 13:00.It was fine weather with much infrared light from sunshine.
As shown in Fig. 9, when the window is closed, the photo transistor can make large output by receiving the reflected light.As a result, the microcontroller indicates the window is closed by negating the alert flag because the AD input exceeds V WTH .When the window is being opened, the LED irradiates the light absorbed part or the glass.Thus, the photo transistor cannot make large difference into the output voltage because the reflected light is buried in sunshine or becomes weak by the glass.As a result, the microcontroller cannot acquire the AD value exceeding the V WTH and indicates the window is opened by asserting the alert flag.
For the key shown in Fig. 10, the behavior is similar to that of Fig. 9.When the key is locked as the left side of Fig. 10, the infrared light reflected by the top of the key handle reaches the photo transistor with enough power.Thus, the photo transistor can generates larger waveform than the threshold, V KTH .As a result, the microcontroller indicates that the key is locked by negating the alert flag.In contrast, when the key is unlocked as the right side of Fig. 10, the AD input never exceeds the V KTH and the microcontroller alerts the key unlocked by asserting the alert flag.
As shown in Fig. 11, the first rising edge of the LED lighting to make light field generates the larger pulse than V VTH .As mentioned in 3.2, we ignore this period by the delay of 100ms.The upper figure of Fig .11 shows that the window vibration makes some weak waves on the constant output of photo transistor.The gained wave input to the AD exceeds V VTH at some points more than 2. Thus, the microcontroller can alert the window vibration as setting a flag to 1.

Conclusions
When a thief tries to enter an empty home, the window in general is targeted.To prevent such situations, we have proposed the method that same light sensors with similar circuits detect the three events on the window, which are the window opened/closed, the key locked/unlocked, and the window vibration.
This paper shows the modified detecting methods compared with the conventional methods to meet the capability of the low-end microcontroller and to make the power consumption efficient by intermittent action.Though the experiment on the prototype hardware, we have confirmed the practical execution of our proposal.
As future work, we will introduce the zero standby power mechanism we have proposed (4) to the proposed sensor node to reduce power consumption significantly.