Approach of Sensor Nodes for Auto-communication Establishment and Intrusion Detection

Since the private space security has always been an issue of great concern, the Infrared (IR) sensor is widely used as a safety monitoring equipment. This paper proposed a concept of IR sensor nodes which can communicate with each other automatically. In addition, the implemented sensor nodes achieve the intrusion detection at the same time.


Introduction
For monitoring our private space, the Infrared (IR) sensor is an ordinary means in the safety monitoring field.The astronomer William Herschel first discovered infrared radiation.He conducted an experiment in which he used a prism to refract light from the sun.Herschel was able to detect the presence of infrared radiation beyond the red part of the visible spectrum using a thermometer to measure an increase in temperature.In 1800 Herschel published his findings to the Royal Society of London (1) .Infrared is kind of invisible electromagnetic radiation between visible light and microwave radiation.Infrared (IR) sensors are used wide range of electronics from a simple IR remote TV controller to top-notch military equipment.In security industry.Infrared technologies with many advantages including low power consumption, invisible light, long range transmission distance and more, equipped with infrared sensor, they can be used to protect your home and business. (2)nfrared sensor mainly includes passive infrared detector (PIR) and active infrared detector (AIR).A passive infrared sensor (PIR sensor) is an electronic sensor that measures Infrared (IR) light radiating from objects in its field.PIR only has a single whole to monitor a limited area, when someone or something appearing in this area, the signal of the sensor will be changed to touch off the reminder, it is the principle of PIR working.There are some applications of PIR Sensors: All outdoor Lights; Lift Lobby; Multi Apartment Complexes (3) and so on.PIR sensors itself does not send any radiation, the device power consumption is small, and concealment is better.However, it has some disadvantages, the signal amplitude is low, easily affected by a variety of heat sources, light interference; Passive infrared penetration is weak, susceptible to radio frequency interference; therefore, it is often used inside of a home.
An active infrared sensor(AIR) consists of the sender which utilizing single or multiply active infrared beams and receiver which receive the IR beams from the sender.It can provide extra security protection through forming an invisible barrier around your premises.Therefore, it's ideal sensor for perimeter protection.Typically, traditional beam sensor consists of infrared transmitter and an infrared receiver (4) .Different from PIR sensor, AIR sensor can be used in long-distance monitoring, and they are mainly installed outside, due to it adopts transmitter and receiver theory for detection.It is important that the beam must go through the detection area and reach the receiver (5) .In this research, we chose the AIR sensor because of its long-distance monitoring, more stable working and outdoor using.Chapter 2 is an implementation of AIR sensor.
However, if many AIR sensors are working in the monitoring system, or when other AIR sensors which are not belonging to this monitoring system want to communicate the nodes of this network, how does the AIR sensors keep the normal working between this system's sensors?Chapter 3 is the approach to solve these problems.

Implementation of Infrared sensor 2.1 Preparation of research
The program editor is PSoC designer 5.4, PSoC Designer is a revolutionary Integrated Design Environment (IDE) that enables you to customize PSoC 1 devices to meet your application requirements.PSoC Designer accelerates system bring-up and time-to-market by providing a library of pre-characterized analog and digital peripherals, called User Modules.In a simple, drag-and-drop design environment.PSoC system helps in customizing your design by leveraging the dynamically generated API libraries of code (6) .The advantage of PSoC is that you can place and configure the user module peripherals on the target device.Instead of choosing a device for its fixed feature set, you can design your PSoC to fit your application, and redesign it at will without changing your hardware.We chose it because of its convenience and ease of use.PSoC designer is an IDE for the cypress chip programming, and we use the cy8c29466 which can be called starter chip.It is easy for the user and with enough functions.
AIR sensor includes sender and receiver, in this research, we chose the 5mm infrared LED, it is cheap and easy to use, and receiver is an infrared Receiver Module which frequency is 38 kHz having 3 pins.

Sender of Infrared sensor
The sender is an infrared LED, and in the PSoC, we need a user module called IrDATX which is an 8-bit serial half-duplex transmitter that implements the IrDA low-speed physical layer protocol for infrared communications (7).For generating a continuous pulse stream of the correct timing, width, and synchronization, the IrDATX User Module operates by logically combining serial data from an internal serial transmitter (TX) with a pulse-width modulator (BitTimer) (7) .We must know an important thing that the TX Output and the BitTimer Output pins are connected.

Receiver of Infrared sensor
The receiver is an Infrared Receiver Module because its frequency is 38 kHz, only when it receives the frequency of 38kHz, it will work.Here, we also need a user module which named IrDARX.The IrDARX User Module is an 8-bit serial half-duplex receiver that supports the IrDA data format using an infrared data link (8) .For receiving infrared single correctly, IrDARX requires TX and BitTimer cooperation just like IrDATX's.It is worth mentioning that the RX Input and the BitTimer Input pins are connected.

Operation on PSoC
The key to this research is the sending frequency; we need the 38kHz rate, so it needs us to adjust the global resource to reach the goal.
The BaudClk input signal must set to eight times the desired baud rate.If the BitTimerClk input signal is set to the same clock as the BaudClk, then an output pulse of 1/8 a bit period is generated.For example, when the BaudClk is 9600bps, the frequency equals 9600*8=76.8kHz.
TX/RX is the eight times of BaudClk so that we can get a formula: Clock Source÷8=BaudClk.Here we need a 38 kHz; the BaudClk can be set to 4800bps because of 4800*8=38.4kHz.Next step is setting the Clock Source to be 4800bps*8; we get the 24 MHz÷13÷6÷8=4800bps*8 through the calculation (the SysClk is 24 MHz).The Clock source can be used for both IrDATX and IrDARX.Following is the design diagram of the implementation of AIR sensor.

Fig. 1. Design Diagram
As we can see in Fig. 1, the frequency of TX and RX is about 38 kHz, which guarantees the sending and receiving of data.The TX can send the data to submit, because BitTimer divides the TX to many parts which every part with 38khz, only when the BitTimer with TX, receiver can receive this data.
There is a user module's API must be attended to this program, it is BitTimerSetup (BYTE bPeriod, BYTE bCmpVal), bPeriod is the Counter period, and bCmpVal is the Counter Compare Value.In our program, 1 bit of time is 6*8*8 of vc1; the result is about 380, so bPeriod in here is 380, and bCmpVal we can set it to 1 so that this program will run successfully.
To sum up, the consequent of this program is that the LED will always be illuminated, when something or someone across the Infrared sender and receiver, the LED will be out of work.After the experiment, we have

Approach
In this research, we regard the mutually independent sender and receiver of the sensor as a node and each node is the same one.

Interference between sensor nodes
When there are multiple nodes, we will be confronted with a problem, that is the IR beams may be across to each other causing interference transmission signal of every node's sender.
For solving the problem of mutual interference between the sensor nodes, my tentative idea is making every node to receive the data twice, the information which the receiver got at the first time can't be written into this node's data storage function, it just plays a reminder role.The second time received data will be written into the data storage function for the later data comparison.The specific operation we will mention in section 3.2.

Automatic communication establishment
Each sensor node is independent, same and there is no an entire system CPU to control this monitoring system, so another key problem is how the sensor nodes communicate automatically by themselves through the IR beams.
Figure 2 is the flowchart of the main function; the monitoring system of our research consists of multiple sensor nodes that loop it.
In the beginning, each sensor node is waiting for data, at the same time it also sends data irregularly within a specific time interval.When one of these nodes which we call it node1 receive data the earliest, this node stops sending data immediately, then to receive the complete data from the sender which we called node2's sender.To prevent data interference between sensor nodes (mentioned in section 3.1), we add the second receiving data to this main function.The second receiving data writes the received data to the array "getdata" as data storage function.If the waiting time longer than time interval limit, which means there is no data received, it will trigger the reminder.

Fig. 2. Flow chart of main function
When the receiver gets the data with ending sign, it means the sensor node2 has finished a period of sending data, and now the node1 returns to the beginning step: waiting for data, and start sending the acknowledgment data at the same time.Because node2 is at the interval of no sending data, the node2 will receive data from node1, if node2 receives the data, it will run like the node1 receiving data previously.
Owing to these sensor nodes are all the same, there is not the problem of sensor nodes' sequence, putting the random sensor nodes is ok.
When someone or something across this monitoring area, the receiver of this system will be interrupted, then the reminder is triggered.

Intrusion detection
For preventing the AIR sensor which does not belong to this monitoring system want to connect with the network forcibly, these sensor nodes of our system have specific sending data.Three different character codes are used to transmit in this system, for example, they are a, b, and c.The c is the end sign of one sending period.Figure 3 is the normal process between the sender and receiver, Fig. 4 is the process between intrusion node and normal receiver.From the two diagram, we can see if the function "checkdata()" finds the received data does not include a, b and c at the same time, it can trigger the reminder.In addition to, if the intrusion node sends data without c, after the receiver times out, the reminder also be triggered.

Conclusions
In this paper, we use the simpler equipment and fewer settings of PSoC designer so that this Infrared sensor is cheaper and easier to implement.The same sensor node can communicate automatically is an innovative point of the application of Infrared sensor, because of its novelty, there may be some problems that need to be verified experimentally in the future.
of Infrared Sensor Based on PSoC.