Introduction: Intelligent Level Sensor Network

Project description

For further information about this project and the team see our GitHub.

The project proposes a wireless-level sensor network for the enhancement of essential urban services. By means of an ultrasonic sensor it is possible to determine the distance of an object/obstacle from the sensor. In this way the level of liquids or solids can be determined with the same sensor. Immediate applications are listed below:

  • Monitoring of water level in homes and buildings. In Brazil, there are regions where water supply is scarce (eg, northeast) and other regions with sporadic water crises (eg São Paulo 2014-2015). By knowing the level of the water reservoirs in a significant number of buildings it is possible to direct water to the most critical places, that is, to make an intelligent water management. In addition, the system can provide data to regulatory agencies and allow monitoring of the quality of the service, since the information disclosed by the sanitation companies does not always match what is reported by the population.
  • Level monitoring of water in rain and river galleries (urban drainage). Several Brazilian cities suffer from flooding points, which causes great damage to the government and individuals. Through the continuous monitoring of the water level of rivers and storm drainage systems, it is possible to identify flood risk, clogging points and bottleneck points in drainage. This makes possible the intelligent management of the urban drainage and management system.
  • Level monitoring of garbage in dumps or litter bins arranged in city streets. The collection of urban waste is an essential service for the control of diseases, for the well being of the population and for environmental management. Moving a collection team to empty dumps creates unnecessary cost; on the other hand, leaving a dump with waste for a long time causes problems due to the deterioration of the present materials. By knowing the filling state of the dumps, dump buckets and collection points, the person responsible for the collection can trace an efficient route and also ensure that the collection time is fulfilled. Efficient routes mean less spending on fuel, staff and fleet reduction.

Step 1: Components for This Project


  1. DragonBoard 410c
  2. DragonShield_v1.0 (the documentation is here)
  3. 12V battery pack
  4. oneRF_NIC_v05 (Radio Module)
  5. oneRF_Modem_v02 (3G Module)

Sensor Nodes:

  1. HCSR04 (ultrasonic sensor)
  2. oneRF_NIC_v05 (Radio Module)
  3. SensorNode_v1.1 (the documentation is here)
  4. 2 AA Battery holder

Step 2: Circuit Diagram and Connections

The documentation to make the SensorNode_v1.1 and DragonShield_v1.0 are avaliable in the GitHub.

With the PCBs assembled, just connect the modules with the radios and sensors.

Step 3: Install Linux in the DragonBoard

We decided to install the Debian Linux supplied from 96boards on our Dragonboard 410c. This Linux image is customized to this specific platform with all peripherals en driver working. The fact that this Linux distribution is available to this platform increases considerably the development speed in the Dragonboard.

Needed resources to execute this tutorial:

Computer with Linux MicroSP card with at least 4GB Dragonboard 410c with power supply

**Steps on the computer**

1 - Download the image

$ cd ~

$ mkdir Debian_SD_Card_Install_image

$ cd Debian_SD_Card_Install_image

$ wget*.zip

2 - Unzip the files

$ cd ~/Debian_SD_Card_Install_image

$ unzip

3 - Insert the microSD on your computer and check if it mounted

$ df -h

/dev/sdb1 7.4G 32K 7.4G 1% /media/3533-3737

4 - Unmount the microSD and burn the image

$ umount /dev/sdb1

$ sudo dd if=db410c_sd_install_debian.img of=/dev/sdb bs=4M oflag=sync status=noxfer

5 - Remove the microSD from you PC

**Steps on the Dragonboard**

1 - Turn off the board

2 - Let the switch S6 at the sequence 0-1-0-0 to boot from the microSD

3 - Insert the microSD

4 - Plug the keyboard and mouse in the USB port

5 - Connect a monitor in the HDMI port

6 - Turn on the board

7 - Select the option "install"

8 - The installation will run automatically. Wait until the end.

9 - Remove the microSD

10 - Let switch S6 at the sequence 0-0-0-0

11 - Click on "OK" to reboot

Step 4: Software

The level data collection, alarms, and parameterization of the WSN will be done through the protocol HTTP, using a REST (Representational State Transfer) architecture to access the sensor nodes with the following commands POST, GET, PUT and DELETE. We can schedule readings for the Concentrator or generate alarms if an abrupt level change happens, for example. A program was developed to collect data and display it in real time in a supervisor system. Because the data is available in HTTP, reading the measurements available on the network becomes extremely simple. In our implementation, a supervisory computer connects via WiFi to the concentrator (using the Dragonboard network) and acquires network state variables through the pages hosted on each node. The measurements are updated each 3-second intervals. This interval was determined in such a way that any level monitoring application was attended at the same time that the data traffic in the network was low and that the consumption of the sensor nodes was kept low. Both the sensor nodes and the concentrator have embedded HTTP servers to provide the information present in each of them. The concentrator node displays in the SensorNodes Vizinhos field what are the sensor nodes that are in the field of view of the 915MHz radio. Therefore, we can see that at the instant of the figure below, 3 sensor nodes were reaching the concentrator. In the Rotas field, the concentrated node displays the paths that the packets make from the sensor node to it. Because we have a mesh topology network, the nodes do not need to be connected directly to the concentrator if the signal level between them is low. Our system has a metric that takes into account the number of jumps, the level of signal between neighbors, the transit time of the packets and the available energy in each node to establish the best route. In the example below, we can see that two sensor nodes are connected to the concentrator via a jump by the third node that is only playing a repeater role.

Step 5: Run Interface Program Made in LabVIEW

All files where created with LabVIEW 2014.

If you DO HAVE LabVIEW you may be interested in running and looking at the source code, so go to Instruction 1.

If you DO NOT HAVE LabVIEW you can still run the executable, go to Instruction 2.

----- Instruction 1 -----

1) Download the source code from GitHub here.

The folder "/Source Codes" you just downloaded contains 3 files:

  • Interface
  • get values from html (SubVI).vi
  • Read_Website_HTML-modified

2) The main file is "Interface", double click it and run the vi.

3) Enter the sensor node URL of each sensor in the proper field. You shold see the readings updating.

----- Instruction 2 -----

1) Download the executable from GitHub here.

The folder "/Executable" contains 3 files:

  • interface.aliases
  • interface.exe
  • interface.ini

2) Download and install the LabVIEW Run-time engine from this [link]

3) Run "interface.exe"

4) Enter the sensor node URL of each sensor in the proper field. You shold see the readings updating.

Step 6: Thank You

We thanks Qualcomm team and Embarcados for creating and supporting "Inventando o Futuro com DragonBoard 410c" contest.