1. Software Installation
NI wireless sensor networks (WSNs) require a host controller to communicate with the WSN Ethernet gateway. The host controller can be a PC running a Windows Vista/XP or LabVIEW Real-Time OS host controller, such as NI CompactRIO. First follow these instructions:
- Close all other applications running on the host controller.
- Install NI LabVIEW and NI-WSN software, follow the on-screen instructions, and reboot when prompted.
- If you are using programmable WSN Measurement Nodes, also install the NI LabVIEW Wireless Sensor Network Module Pioneer, following the on-screen instructions.
With the NI LabVIEW WSN Module Pioneer, you can use graphical programming to customize the node's behavior, adding intelligence to extend battery life, increase analog and digital input performance, and interface with sensors. LabVIEW WSN applications can be downloaded over the air to NI WSN measurement nodes, allowing seamless updates to deployed nodes.
2. Hardware Setup
This tutorial helps you set up and configure the hardware contained in the NI Wireless Sensor Network (WSN) Starter Kit. This kit contains everything you need to set up an NI wireless sensor network quickly and easily, including the following:
- NI WSN-9791 Ethernet gateway
- NI WSN-3202 programmable +-10 V analog input node
- NI WSN-3212 programmable thermocouple input node
- LabVIEW WSN Pioneer evaluation CD
- NI LabVIEW evaluation CD
- Desktop power supply and U.S. power cord for the NI WSN-9791 Ethernet gateway
- Two sets of 4 AA batteries for NI WSN measurement nodes
- Ethernet cable
- J-type thermocouple (2)
To set up the NI WSN-9791 Ethernet gateway, follow these steps:
1. Attach the antenna to the NI WSN-9791.
2. Connect the Ethernet cable between the NI WSN-9791 and your network router. If you are connecting directly to the gateway from your PC and your network card does not support direct connections, you need to use an Ethernet crossover cable.
3. Connect the desktop power supply to your wall outlet, and the power cord between the desktop power supply and the 2-position power terminal on the NI WSN-9791.
4. Check LEDs for power and status information.
To set up the NI WSN measurement nodes, follow these steps:
1. Attach the antennae, 18-position screw-terminal connectors, and corresponding labels to the measurement nodes.
2. Connect the potentiometer and thermocouple to your measurement nodes. If you are not using the NI WSN Starter Kit, connect your sensors to the appropriate screw terminals on the WSN measurement nodes.
a. Connect the Signal and GND wires from the potentiometer to the AI0 and AI GND screw terminals on the NI WSN-3202 analog input node, respectively. Connect the Power wire to the SEN PWR terminal. This sensor power channel delivers up to 12 V and 20 mA of power to drive external sensors, so you can measure the voltage across the variable resistance using the NI WSN-3202 as you turn the knob on the potentiometer.
b. Connect the positive wire (white insulation) of your thermocouple to the TC0+ screw terminal on the NI WSN-3212 and the negative wire (red insulation) to the TC0- screw terminal.
3. Install the batteries and secure the battery compartment cover using the screwdriver. You also can use a 9 to 30 V external supply to power the measurement nodes.
3. Network Configuration
You must configure your NI WSN in MAX before using LabVIEW to take measurements from your WSN. MAX provides an intuitive user interface to view and configure all of the NI hardware and software installed on your system.
1. Launch MAX from the desktop or by selecting Start>>Programs>>National Instruments>>Measurement & Automation.
2. Expand Remote Systems to confirm that MAX has autodetected the NI WSN-9791. If you plugged the gateway into an Ethernet port on the local subnet or directly into the host controller, it should automatically appear under Remote Systems.
Note: If the gateway is not automatically detected, try adding it manually by right-clicking on Remote Systems and selecting Create New… and then WSN Gateway. Enter the default host name of the device, which is NI-WSN9791-0serial_number (for example, "NI-WSN9791-0140B2B1," where the serial number is 140B2B1). You can find your Ethernet gateway serial number on the bottom sticker of the device. You also can directly enter the IP address of your gateway, if known.
3. Select the Network Settings tab. Here you can confirm or change the default settings.
a. Select Obtain an IP address automatically if the gateway is connected to a DHCP server (recommended) or select Use the following IP address: and enter a static IP address for your gateway.
b. Configure other settings such as device name, comments, and the time server on your subnet.
c. Click Apply to save changes.
Figure 1. Configuring Network Settings
4. Select the WSN Nodes tab.
a. To add the NI WSN-3202 and NI WSN-3212 measurement nodes to your system, click the Add WSN Node button.
Figure 2. Adding Nodes to Your NI WSN
b. Enter the serial number for your NI WSN-3202 and an ID number and click Add Another. Select NI WSN-3212 for the node type and enter the serial number and ID number for your thermocouple input node. Continue this process for any other nodes in your system and then click Finish.
c. Click Apply to save changes and allow these devices to communicate with your WSN Ethernet gateway. Only the devices you add to your WSN in MAX are able to connect to the gateway.
d. Once the gateway shows the changes, hold down the signal strength button on each node for more than five seconds and then release. The LEDs then blink consecutively until a connection with the gateway is established.
e. You can select Refresh all on the WSN Nodes tab to view the last communication time, battery state, link quality, and network mode of your measurement nodes.
Figure 3. Updated Node Parameters
4. Extracting Measurement Data with LabVIEW and NI-WSN
Extracting measurement data from your NI wireless sensor network is easy with LabVIEW and NI-WSN software.
1. Start LabVIEW by selecting Start>>Programs>>National Instruments>>National Instruments LabVIEW 8.6. Click through the activation screen to bring up the Getting Started menu.
2. Select Empty Project to bring up a new Project Explorer window.
3. To add your NI WSN-9791 Ethernet gateway to the LabVIEW Project, right-click on the project name and select New>>Targets and Devices… Select Existing target or device and expand the WSN Gateway folder to choose the NI WSN-9791 that you configured in MAX.
Figure 4. Adding a New Gateway to the LabVIEW Project
4. The measurement nodes configured with your network are automatically added underneath the gateway in the LabVIEW Project, giving you instant access to their I/O variables and properties.
Figure 5. NI WSN Project Explorer Window
5. Create a host VI by right-clicking on My Computer and selecting New>>VI.
6. To monitor the potentiometer voltage and thermocouple temperature, drag the corresponding I/O variables to the LabVIEW block diagram, as shown in Figure 6. You can also monitor node attributes such as battery voltage and link quality by dragging the corresponding I/O variables to the block diagram.
Figure 6. Host VI Front Panel and Block Diagram
7. Add any other analysis or measurement functions that you wish to implement in your program and add indicators or charts to the LabVIEW front panel to view your data.
8. When you are finished building your Host Controller VI, click the Run button to instantly acquire measurements from your NI wireless sensor network.
LabVIEW and NI-WSN software make it easy to configure your network and extract measurement data. You can also use a LabVIEW Real-Time controller, such as NI CompactRIO, to control your wireless sensor network, and program your host VI using LabVIEW Real-Time, so you can incorporate wired and wireless measurements into one LabVIEW program. In addition, you can customize and enhance node behavior using the NI LabVIEW WSN Module Pioneer, which can be used to target and program the programmable nodes that ship with the NI WSN Starter Kit. This allows you to extend battery life, increase acquisition performance, respond to digital value change events, and interface with custom sensors. To learn more about node programmability, visit the NI LabVIEW WSN Module Pioneer white paper.