.

Thursday, April 4, 2019

Mobile Sensor Network for Indoor Environment

Mobile Sensor Network for interior Environment4 lymph gland demodulator network without collisions.Update of separately sensor reading in the network at least once per spot (available from all in all nodes).Single frequency channel (i.e. no frequency multiplexing permitted).Error labeling (CRC) included to (Measure at least 2 parameters (e.g. temp, light..)Data presented on attendant I/O port in a format that is easily readable on a text terminal.1. Background knowledge1.1. body expressionThe aim of this coursework is to rule a alert sensor network for an indoor environment, communicating with a 2.4 GHz wireless link (IEEE 802.15.4). All the sensor nodes fuck build entropy link, which means each board can get differents information. All the sensor boards cede the function of receiver link to the computer, and can present the sensor info (for all nodes in the network) to the serial publication I/O port in a format which is easily to be understand on a text terminal. If the nod which connected to pc is broken, the other 3 nodes can re deposit it and realize the function of receiver. Each sensor node allow include a number of sensors port wined to a microprocessor (for our root temperature, sounds, feel and light). The microprocessor will gather sensor selective information, communicate with other sensor nodes via a wireless transceiver, lend oneself a network protocol and provide a PC interface via a serial I/O port for data display. The structure of whole system is as followFigure 1 Architecture of piano tuner Sensor Network1.2. Basic hardw atomic number 18The principle hardware exampled in this project is the PICDEM Z 3 information board from Microchip Technology Inc. There is a PIC18F4620 micro swanler on every node board and every group has 4 board available. The PICDEM Z has a prototyping area which essential not be used for circuit construction. First, we need veroboard to construct a circuit, t hence interface it to the aim J6. The adjacent general anatomy shows the structure of the board.Figure 1 The structure of the boardAnd we also have other devices can use in this course1. 9V DC power socket (J1) for operation from chief(prenominal)s adaptor.2. 9V battery terminal (BT1) for mobile operation.3. ICD connector (J5) for connection to MPLAB ICD3 in-system programmer/debugger cable.4. RS232 serial port connector (P1) for connection to PC COM port.5. Microchip MRF24J40 2.4GHz transceiver staff connected to J2.6. LEDS RA0 and RA1 for indication.7. Push buttons RB4 and RB5 for simple logic input.8. Header J6 giving access to analog and digital I/O pins Vcc (3.3V) and GND. This may be used to interface additional sensors.1.3. Microchip MRF24J40 2.4GHzThe MRF24J40 wireless transceiver 5 provides the physical floor for your wireless communication network. This is a 2.4GHz (IEEE 802.15.4 compliant) device which transmits data rates up to 250kbps and is connected to the PIC via SPI bus, as well as a small numb er of digital I/O pins. The picture of Wireless transceiver is as follow.1.4. MPLAB-ICDMPLAB-ICD is an inexpensive development tool for MICROCHIPs PIC16F87X series MCU. MPLAB-ICD is an online debugger, and a programmer. It works in the MPLAB-IDE integrated development environment, and use online serial programming technology of MICROCHIP (In-Circuit Serial Programming), the monitoring program is embedded to come through real- judgment of conviction simulation in the simulation of the MCU (PIC16F87X). The simulation head is directly connected to the MCU socket of the application system, rail the users application as a PIC16F87X. The picture of MPLAB-ICD is as follow.1.5. Wireless sensor networkWireless Networks use radio waves, infrared, or any other wireless media to link to any devices. It can secrecy a large area, in which study it will be called a Wireless WAN, or it can coer an area or some floor of building, such as school, hospital and railway station, in that case Wireles s LAN (WLAN) appear and describe the situation4. It appears a large number of wireless communication standards nowadays, including ZigBee, Wi-Fi, WiMax, GSM (Global System for Mobile Communications) et al.Wireless sensor network (background) became a more and more popular way to lick the problems of large-scale tracking and monitoring applications because it has low-data-rate, low-energy-consumption, and short-range link network 1. It give raft a recover to monitor and control the physical world in a more simple way. WSN applications include some ways in our life, such as industrial monitoring, security, electronics industry, military sensing, asset tracking and home automation. WSNs inquiry has mainly pay attention to energy consumption, routing and data transmission, particularly focusing on collecting and data summary in specific networks with an associated sink node, called a WSN gateway 1.Some research has carried out the interface of different sensor networks for a singl e or complex applications. Wireless sensor networks is aimed to monitor and control the physical data of environmental conditions at remove locations and it can collect their data to a main location and send their control command to achieve the end of remote control.A WSN includes plenty nodes, ranging from a few to hundreds and thousands, in addition each node may be linked to one or more other nodes. One node can be designed for carrying out one or more different sensors which have versatile functions and we can also design combined sensors choice to sweep through complex use or exchange data with some other network4. A node for sensing is called a sensor node, everyone can collect the data of other sensor node. As a result, any place with a sensor node can get all the data with a very refrain speed at any epoch.1.6. Error espial Cyclic Redundancy CheckError detection segment is necessary in a data transmitting system since the correctness and efficiency of data transmitti ng must(prenominal) be ensured. In this project, there are 3 approaches which can be utilize to misconduct detection parity point, check sum and cyclic redundancy check (CRC).Parity bit is also know as check bit, the function of which is to judge whether a number of 1-bits in the guide is even or odd by adding a bit to a pull back of binary code. The actualization is that the bits with value 1 is counted for even parity while the coding reverses for odd parity. Although parity bit is aristocratic to implement, the shortcoming is apparent that only when there are 1, 3, 5, bit(s) errors can the error be detected.The principle for check sum is to coiffe a string with a small size with designed algorithm of calculating, and the result of the calculations of before and after the transmitting will be different even the data changes slightly so the error could be detected in this way. Similar to parity bits, the disadvantage of check sum is that error cant be detected under some circumstances.Cyclic redundancy check (CRC) is a method of error detection that is easyto be implemented by shift register and look-up table in S/W. The process is shown in figure1.In this project the value of P(z) is 0x91 (11001 in reversed binary) which is known as root multinomial and the divider. Assuming that the data needed to be transmitted is 110011000, then we have the message polynomial D(z). C(z) is the remainder which is calculated by D(z) divided by P(z). The realization of division operation is by XOR. nevertheless when the least significant bit of 1 byte of the message is 1 will it XOR with CRC polynomial, then we should shift it to the near bit and repeat the XOR. At the transmitter, the string of CRC depends on the whole frame on a piecemeal basis with binary division. And at the receiver, the received bit string is again divided by the akin bit-by-bit basis with a serial shift register. The resultant CRC result should be all zeros at the end of the frame, or there must be errors in the process of data transmitting. Grahame Smillie, 10 touch error detection and correction, In Analogue and Digital Communication Techniques, Butterworth-Heinemann, Oxford, 1999, Pages 185-230, ISBN 9780340731253, http//dx.doi.org/10.1016/B978-034073125-3/50012-7.2. System Design2.1. Sensor design and calibration and Analogic digital converter ADCIn our group 4 kinds of sensor are designed to light upon the requirement, and they are temperature sensor, light sensor, touch sensor and sound sensor. In order to obtain data from all the 4 sensors in the wireless network, a PCB board is required to connect to the sensor node board. In the lab, a breadboard is available for testing the circuit. When finishing the circuit on the breadboard, it can be interfaced to PC to have a preliminary test. If done, a PCB board will be used to finish the final exam product which can connect to node board.The method of calibration is to get the value of light, sound, temperatu re or touch that is detected using physical measurement. For example, if the temperature of the environment T0 and the result of the ADC conversion D0 that stash away by the sensor in the same testing environment are known, we can derive the proportional function of temperature and ADC data with another pair of coordinate (T1, D1), which is obtained by changing the temperature of testing. Then the code that controlling display of temperature value should be modified so that by the time the temperature of the environment changes, the displaying value on the PC is exactly the temperature. statute for this part is shown as following2.1.1. Temperature sensorNegative Temperature Coefficient (NTC) thermistors are temperature sensitive semiconductor resistors which decrease in resistance value when absolute temperature increasing. Change in the resistance of NTC thermistor can be brought somewhat either by a change in the ambient temperature or internally by self-heating resulting from afoot(predicate) flowing through the device. (NTC Thermistor Discs and Chips Ametherm, Ametherm, 2017. Online. Available http//www.ametherm.com/thermistor/disc-and-chip-ntc-thermistors. irritateed 07- Jan- 2017.)Most of the practical applications of NTC thermistors are based on these material characteristics. Time and temperature are two of the most frequently measured variables. There are various ways to measure temperature electronically, most normal is by thermocouples and negative temperature coefficient (NTC) thermistors. In addition, NTC temperature sensors can operate over a wide temperature range (-55 to +300C). They are stable throughout a long time, and are small and cheaper than other kind. 3Figure 1 circuit of Temperature SensorIt can be seen in the figure 1 that temperature Sensor is a more complex circuit design. On the left part It=Vcc/(R1+Rt) and Vt=Vcc*Rt/(Rt+R1), then connect the line to the positive side of the LM358 amplifier to amplify circuit and Vt becomes t he input of the amplifier. After that, use statuteV0 = Vt*(1+R3/R2) to get the potential value of v0. From this formula we can know, the value of V0 depends on R3 and R2, so R3 and R2 are both(prenominal) simply chosen 10 Ohm. Then the voltage value of V0 is exactly twice as much(prenominal) as that of Vt.Next use formula to transfer ADC data to temperature, when it comes to the lab temperature (23 degrees Celsius), ADC data is 613. While it comes to the people body temperature (abort 38 degrees Celsius), ADC data become 530. Finally, we can calculate the linear parameters by these two sets of data.2.1.2. agility sensorThe Light Sensor is a passive devices that transfer light energy visible or invisible into a output of voltage signal. Thus Light sensors are more commonly known as Photoelectric Devices or Photo Sensors 2.Photoelectric devices can be classified into two main categories, those which generate electricity when illuminated, such as Photo-voltaics or Photo-emissives e tc, and those can change their electrical data (voltage) in some way such as Photo-resistors or Photo-conductors. 2Light sensor is the easiest sensor of our 4 sensor, so we also use the simplest structure, when luminance become strong, the value of photosensitive resistance become larger. Thus the voltage of Vt increase which result in the raise ADC data.Then use formula to transfer ADC data to luminance, when it is persistent (lux 0), ADC data is 30. While it comes to the lab light (about 330 lux), ADC data become 895. Finally, We can calculate the linear parameters by these two sets of data2.1.3. Sound sensor2.1.4. Touch sensorThe MPR121 is the second-generation sensor controller after the initial release of the MPR03x series devices. The MPR121 will feature increased internal intelligence in addition to Freescales second generation capacitance detection engine. Some of the major additions include an increased electrode count, a hardware configurable I 2Caddress, an expanded filt ering system with debounce, and completely independent electrodes with auto-configuration built in. The device also features a 13th assumed electrode that represents the simultaneous charging of all the electrodes connected together to allow for increased proximity detection in a touch panel or touch screen array 5.2.3. Time Division Multiple Access TDMAIt is required that there are at least 4 nodes of sensor without collision in a wireless transmitting network based on a certain channel. Each sensor must be ensured to be able to receive and transmit, in other words, each node can operate as both a receiver and a transmitter. The node which connects to the PC is responsible for the display of the data that collected by each sensor and each sensor is supposed to send the data string to the chosen node within 1 second.There will be collision with the four nodes if we dont define the order of the data transmitting and receiving or just simply define by applying time delay, hence TDM A is necessary to meet requirements above. TDMA is a method of communication technique that derived from the P2S (parallel to serial) conversion. In the process of TDMA of this project, receivers obtain a same signal at the same time but only the appointed receiver reacts and does the nigh action, which is then transmitting and serving as newborn transmitter, and the new transmitter will wait for the next appointment without doing nothing unless it is appointed once again, which means it gets the same order in a new loop. The process repeats and there will not be data collision in the transmitting and receiving.As is illustrated in figure2, there are 4 nodes so 4 slots are needed in 1 second according to the requirement, hence each slot takes up 0.25 second, during which time of period each node should finish data transmitting, so the calculation of the time that is needed for sending and receiving is necessary.2.3.1. Data packet structure2.3.2. TimersWe apply timer0 to control th e time of running, different initial values have been given to timer0 in each slot so that transmitting and receiving within 1 second without collision can be ensured. In this case, node 4 is the main node which connects to the PC. The start of the process is the transmitting of node 4, and by the time other 3 nodes receive data from node 4, the text packet ID of the transmitter will be checked and only node 3, which is the transmitted ID 4 minus 1, will display the data that collected by node 4 and transmit its own data collected by its sensor. Following actions will be carried out by node 2, and node 1 within a certain time of period, like shown in figure3.Figure34. IoT Data Service and Visualisation

No comments:

Post a Comment