Libelium Waspmote Quick start guide

Waspmote
Technical Guide

-2- v6.3
Document version: v6.3 - 07/2016
© Libelium Comunicaciones Distribuidas S.L.
Index
INDEX
1. Waspmote Kit....................................................................................................................................... 6
1.1. General and safety information..............................................................................................................................................6
1.2. Conditions of use .........................................................................................................................................................................7
1.3. Assembly.........................................................................................................................................................................................9
2. Waspmote Plug & Sense! - Encapsulated Line................................................................................. 14
2.1. Quick Overview .........................................................................................................................................................................14
2.1.1. Features .........................................................................................................................................................................14
2.1.2. Sensor Probes..............................................................................................................................................................14
2.1.3. Solar Powered..............................................................................................................................................................15
2.1.4. Programming the Nodes.........................................................................................................................................16
2.1.5. Radio Interfaces ..........................................................................................................................................................17
2.1.6. Program in minutes...................................................................................................................................................18
2.1.7. Data to the Cloud.......................................................................................................................................................18
2.1.8. Models............................................................................................................................................................................19
2.1.8.1. Smart Environment ...................................................................................................................................20
2.1.8.2. Smart Environment PRO..........................................................................................................................22
2.1.8.3. Smart Security.............................................................................................................................................24
2.1.8.4. Smart Water..................................................................................................................................................26
2.1.8.5. Smart Water Ions ........................................................................................................................................28
2.1.8.6. Smart Cities ..................................................................................................................................................32
2.1.8.7. Smart Parking..............................................................................................................................................34
2.1.8.8. Smart Agriculture.......................................................................................................................................35
2.1.8.9. Ambient Control.........................................................................................................................................37
2.1.8.10. Radiation Control.....................................................................................................................................39
3. Hardware............................................................................................................................................ 40
3.1. Modular Architecture ..............................................................................................................................................................40
3.2. Specications .............................................................................................................................................................................40
3.3. Block Diagram............................................................................................................................................................................41
3.4. Electrical Data.............................................................................................................................................................................42
3.5. I/O ..................................................................................................................................................................................................43
3.5.1. Analog............................................................................................................................................................................44
3.5.2. Digital .............................................................................................................................................................................44
3.5.3. PWM................................................................................................................................................................................44
3.5.4. UART................................................................................................................................................................................45
3.5.5. I2C....................................................................................................................................................................................45
3.5.6. SPI ....................................................................................................................................................................................45
3.5.7. USB ..................................................................................................................................................................................45

-3- v6.3
Index
3.6. Real Time Clock - RTC...............................................................................................................................................................45
3.7. LEDs ............................................................................................................................................................................................... 47
4. Architecture and System................................................................................................................... 48
4.1. Concepts ......................................................................................................................................................................................48
4.2. Timers............................................................................................................................................................................................49
4.2.1. Watchdog......................................................................................................................................................................49
4.2.2. RTC...................................................................................................................................................................................49
5. Interruptions...................................................................................................................................... 50
6. Energy System ................................................................................................................................... 52
6.1. Concepts ......................................................................................................................................................................................52
6.2. Sleep mode .................................................................................................................................................................................53
6.3. Deep Sleep mode .....................................................................................................................................................................54
6.4. Hibernate mode ........................................................................................................................................................................54
7. Sensors ............................................................................................................................................... 56
7.1. Sensors in Waspmote .............................................................................................................................................................. 56
7.1.1. Temperature.................................................................................................................................................................56
7.1.2. Accelerometer .............................................................................................................................................................57
7.2. Integration of new sensors....................................................................................................................................................61
7.3. Sensor Boards............................................................................................................................................................................. 62
7.4. Power.............................................................................................................................................................................................66
8. 802.15.4/ZigBee................................................................................................................................. 67
8.1. XBee-802.15.4.............................................................................................................................................................................67
8.2. XBee - ZigBee..............................................................................................................................................................................70
8.3. XBee - 868....................................................................................................................................................................................72
8.4. XBee - 900....................................................................................................................................................................................74
8.5. XBee-DigiMesh ..........................................................................................................................................................................75
9. LoRaWAN............................................................................................................................................ 77
10. LoRa .................................................................................................................................................. 78
10.1. RSSI ..............................................................................................................................................................................................80
11. Sigfox................................................................................................................................................ 81
12. WiFi ................................................................................................................................................... 82
12.1. WiFi Topologies........................................................................................................................................................................82
12.1.1. Access Point...............................................................................................................................................................82
12.1.2. When is recommended to use Meshlium instead a standard WiFi router?.........................................84

-4- v6.3
Index
13. Bluetooth Pro................................................................................................................................... 85
13.1. Technical specications........................................................................................................................................................ 85
13.2. Bluetooth module for device discovery .........................................................................................................................87
14. Bluetooth Low Energy..................................................................................................................... 89
14.1. Technical specications: ......................................................................................................................................................89
15. GSM/GPRS ........................................................................................................................................ 91
16. GPRS+GPS ....................................................................................................................................... 93
17. 3G + GPRS......................................................................................................................................... 95
18. RFID/NFC .......................................................................................................................................... 97
19. Industrial Protocols ......................................................................................................................... 99
19.1. Introduction ............................................................................................................................................................................99
19.2. RS-485 / Modbus module..................................................................................................................................................100
19.3. RS-232 Serial / Modbus module......................................................................................................................................101
19.4. CAN Bus module...................................................................................................................................................................102
19.5. Modbus ....................................................................................................................................................................................103
19.6. Operating with the modules............................................................................................................................................103
20. Expansion Radio Board................................................................................................................. 105
21. Over the Air Programming (OTA) ................................................................................................. 106
21.1. Overview..................................................................................................................................................................................106
21.2. Benets.....................................................................................................................................................................................106
21.3. Concepts..................................................................................................................................................................................107
21.3.1. OTA with 802.15.4/ZigBee modules...............................................................................................................107
21.3.2. OTA with 3G/GPRS/WiFi modules via FTP....................................................................................................108
21.4. OTA with 802.15.4/ZigBee modules ..............................................................................................................................109
21.4.1. OTA Step by Step...................................................................................................................................................109
21.4.2. OTA Shell..................................................................................................................................................................112
21.5. OTA with 3G/GPRS/WiFi modules via FTP....................................................................................................................112
21.5.1. Procedure ................................................................................................................................................................112
21.5.2. Setting the FTP server conguration.............................................................................................................113
22. Encryption Libraries...................................................................................................................... 114
22.1. Transmission of sensor data..............................................................................................................................................114
23. SD Memory Card............................................................................................................................ 116
24. Energy Consumption..................................................................................................................... 118
24.1. Consumption tables............................................................................................................................................................118

-5- v6.3
Index
25. Power supplies............................................................................................................................... 120
25.1. Battery ......................................................................................................................................................................................120
25.2. Solar Panel...............................................................................................................................................................................123
25.3. USB.............................................................................................................................................................................................125
26. Working environment ................................................................................................................... 127
26.1. First steps.................................................................................................................................................................................127
26.2. Compilation............................................................................................................................................................................128
26.3. API..............................................................................................................................................................................................130
26.3.1. Cores folder............................................................................................................................................................. 130
26.3.2. Libraries folder.......................................................................................................................................................131
26.4. Updating the libraries.........................................................................................................................................................134
27. Interacting with Waspmote .......................................................................................................... 135
27.1. Receiving XBee frames with Waspmote Gateway ....................................................................................................135
27.1.1. Waspmote Gateway.............................................................................................................................................135
27.1.2. Linux receiver .........................................................................................................................................................136
27.1.3. Windows receiver..................................................................................................................................................140
27.1.4. Mac-OS receiver .................................................................................................................................................... 142
27.2. Meshlium.................................................................................................................................................................................143
27.2.1. What can I do with Meshlium?.........................................................................................................................143
27.2.2. How do they work together?............................................................................................................................144
27.2.2.1. Meshlium Storage Options ...............................................................................................................144
27.2.2.2. Meshlium Connection Options .......................................................................................................144
27.2.3. Capturing and storing sensor data in Meshlium from a Waspmote sensor network .................. 145
27.2.4. Capturer logs ......................................................................................................................................................... 159
27.2.5. Sensors .....................................................................................................................................................................160
27.2.6. Sending XBee frames from Meshlium to Waspmote............................................................................... 161
27.2.7. Interacting with 3rd party Cloud platforms................................................................................................ 162
28. Documentation Changelog .......................................................................................................... 163
29. Certications.................................................................................................................................. 166
29.1. CE................................................................................................................................................................................................166
29.2. FCC.............................................................................................................................................................................................167
29.3. IC ................................................................................................................................................................................................168
29.4. Use of equipment characteristics...................................................................................................................................168
29.5. Limitations of use .................................................................................................................................................................168
30. Maintenance .................................................................................................................................. 170
31. Disposal and recycling .................................................................................................................. 171

-6- v6.3
Waspmote Kit
1. Waspmote Kit
1.1. General and safety information
• In this section, the term “Waspmote” encompasses both the Waspmote device itself and its modules and sensor boards.
• Please read carefully through the document“General Conditions of Libelium Sale and Use”.
• Do not let the electronic parts come into contact with any steel elements, to avoid injuries and burns.
• NEVER submerge the device in any liquid.
• Keep the device in a dry place and away from any liquids that might spill.
• Waspmote contains electronic components that are highly sensitive and can be accessed from outside; handle the devi-
ce with great care and avoid hitting or scratching any of the surfaces.
• Check the product specications section for the maximum allowed power voltage and amperage range and always use
current transformers and batteries that work within that range. Libelium will not be responsible for any malfunctions
caused by using the device with any batteries, power supplies or chargers other than those supplied by Libelium.
• Keep the device within the range of temperatures stated in the specications section.
• Do not connect or power the device with damaged cables or batteries.
• Place the device in a location that can only be accessed by maintenance operatives (restricted area).
• In any case, keep children away from the device at all times.
• If there is an electrical failure, disconnect the main switch immediately and disconnect the battery or any other power
supply that is being used.
• If using a car lighter as a power supply, be sure to respect the voltage and current levels specied in the“Power Supplies”
section.
• When using a battery as the power supply, whether in combination with a solar panel or not, be sure to use the voltage
and current levels specied in the“Power supplies” section.
• If a software or hardware failure occurs, consult the Libelium Web Development section
• Check that the frequencies and power levels of the radio communication modules and the integrated antennas are ap-
propriate for the location in which you intend to use the device.
• The Waspmote device should be mounted in a protective enclosure, to protect it from environmental conditions such
as light, dust, humidity or sudden changes in temperature. The board should not be denitively installed “as is”, because
the electronic components would be left exposed to the open-air and could become damaged. For a ready-to-install
product, we advise our Plug & Sense! line.
DO NOT TRY TO RECHARGE THE NON-RECHARGEABLE BATTERY. IT MAY EXPLODE AND CAUSE INJURIES AND
DESTROY THE EQUIPMENT. DEVICES WITH NON-RECHARGEABLE BATTERIES MUST BE PROGRAMMED THROUGH
THE USB CABLE WITHOUT THE BATTERIES CONNECTED. PLEASE DOUBLE CHECK THIS CONDITION BEFORE
CONNECTING THE USB. DO NOT CONNECT EITHER UNDER ANY CIRCUMSTANCE THE SOLAR PANEL TO A DEVICE
WITH A NON-RECHARGEABLE BATTERY AS IT MAY EXPLODE AND CAUSE INJURIES AND DESTROY THE EQUIPMENT.
The document “General Conditions of Libelium Sale and Use” can be found at:
http://www.libelium.com/development/waspmote/technical_service

-7- v6.3
Waspmote Kit
1.2. Conditions of use
General:
• Read the “General and Safety Information” section carefully and keep the manual for future reference.
• Read carefully the “General Conditions of Sale and Use of Libelium”. This document can be found at:
http://www.libelium.com/development/waspmote/technical_service. As specied in the Warranty document, the client
has 7 days from the day the order is received to detect any failure and report that to Libelium. Any other failure reported
after these 7 days may not be considered under warranty.
• Use Waspmote in accordance with the electrical specications and in the environments described in the“Electrical Data”
section of this manual.
• Waspmote and its components and modules are supplied as electronic boards to be integrated within a nal product.
This product must have an enclosure to protect it from dust, humidity and other environmental interactions. If the pro-
duct is to be used outside, the enclosure must have an IP-65 rating, at the minimum. For a ready-to-install product, we
advise our Plug & Sense! line.
• Do not place Waspmote in contact with metallic surfaces; they could cause short-circuits which will permanently dama-
ge it.
Specic:
• Reset and ON/OFF button: Handle with care, do not force activation or use tools (pliers, screwdrivers, etc) to handle it.
• Battery: Only use the original lithium battery provided with Waspmote.
• Mini USB connection: Only use mini USB, mod. B, compatible cables.
• Solar panel connection: Only use the connector specied in the Power supplies section and always respect polarity.
• Lithium battery connection: Only use the connector specied in the Battery section and always respect polarity.
• Micro SD card connection: Only use 2GB maximum micro SD cards. HC cards are not compatible. There are many SD
card models; any of them has defective blocks, which are ignored when using the Waspmote’s SD library. However,
when using OTA, those SD blocks cannot be avoided, so that the execution could crash. Libelium implements a special
process to ensure the SD cards we provide will work ne with OTA. The only SD cards that Libelium can assure that
work correctly with Waspmote are the SD cards we distribute ocially.
• Micro SD card: Make sure Waspmote is switched o before inserting or removing the SD card. Otherwise, the SD card
could be damaged.
• Micro SD card: Waspmote must not be switched o or reseted while there are ongoing read or write operations in the
SD card. Otherwise, the SD card could be damaged and data could be lost.
• GSM/GPRS board connection: Only use the original Waspmote GSM/GPRS board.
• 3G/GPRS board connection: Only use the original Waspmote 3G/GPRS board.
• XBee module connection: Waspmote allows the connection of any module from the XBee family, respect polarity when
connecting (see print).
• Antenna connections: Each of the antennas that can be connected to Waspmote (or to its boards) must be connected
using the correct type of antenna and connector in each case, or using the correct adaptors.
• USB voltage adaptors: To power and charge the Waspmote battery, use only the original accessories: 220V AC – USB
adaptor and 12V DC (car cigarette lighter) – USB adaptor

-8- v6.3
Waspmote Kit
Usage and storage recommendations for the batteries:
The rechargeable, ion-lithium batteries, like the ones provided by Libelium (capacity of 6600 mAh), have certain characteristics
which must be taken into account:
• Charge the batteries for 24 hours before a deployment. The aim is to have the charge of the batteries at 100% of their
capacity before a long period in which they must supply current, but it is not necessary to improve the performance.
• It is not advised to let the charge of the batteries go below 20% of capacity, since they suer stress. Thus, it is not advised
to wait for the battery to be at 0% to charge it.
• Any battery self-discharges: connected to Waspmote or not, the battery loses charges by itself.
• Maximum capacity loss: as the charge and discharge cycles happen, the maximum charge capacity is reduced.
• Batteries work better in cool environments: their performance is better at 10 ºC than at 30 ºC.
• At temperatures below 0 ºC, batteries can supply current (discharge), but the charge process cannot be done. In parti-
cular:
- discharge range = [-10, 60] ºC
- charge range = [0, 45] ºC
It is not reccommended to have the non-rechargeable batteries (13000, 26000, 52000 mA·h) connected to Waspmote when the
USB cable is conneted too. The reason is, Waspmote will try to inject current in them if the USB is connected. This is dangerous
for the good working of a non-rechargeable battery. It could be damaged or even damage Waspmote. That is to say, when you
need to upload code to Waspmote via USB, disconnect the battery if it is non-rechargeable. That applies to Waspmote OEM, but
not to the Plug & Sense! line, since its hardware is modied to avoid this.
Plug & Sense! line:
Libelium may provide the nodes with enclosures which are suitable to operate outdoors. The user, as nal installer, must take
great care when handling the product. We advise to read the Plug & Sense! Technical Guide to enlarge the life of your devices.
Remember that inappropriate use or handling of Waspmote will immediately invalidate the warranty.
For further information, please visit http://www.libelium.com/development/waspmote

-9- v6.3
Waspmote Kit
1.3. Assembly
•Connect the antenna to the wireless module
•Place the wireless module in Waspmote
•Place the wireless module in Waspmote Gateway

-10- v6.3
Waspmote Kit
•Connect the antenna in the GSM/GPRS module
•Place the GSM/GPRS module in Waspmote
•Place the SD card in Waspmote

-11- v6.3
Waspmote Kit
•Connect the battery in Waspmote
•Connect the sensor board
•Switch it on

-12- v6.3
Waspmote Kit
•Waspmote battery disconnection
Use the pick supplied by Libelium in order to disconnect Waspmote battery.
Insert the pick on the slot of the battery connector and pull straight out.
Do not pull the battery cables.

-13- v6.3
Waspmote Kit
•Battery handling instructions
In order to prevent from cable breaking, avoid leaving battery freely suspended.
Use a nylon clamp in order to attach battery to Waspmote.

-14- v6.3
Waspmote Plug & Sense! - Encapsulated Line
2. Waspmote Plug & Sense! - Encapsulated Line
Waspmote is the original line in which developers have a total control over the hardware device. You can physically access to the
board and connect new sensors or even embed it in your own products as an electronic sensor device.
The Waspmote Plug & Sense! line allows developers to forget about electronics and focus on services and applications. You can
deploy wireless sensor networks in an easy and scalable way ensuring minimum maintenance costs. The platform consists of
a robust waterproof enclosure with specic external sockets to connect the sensors, the solar panel, the antenna and even the
USB cable in order to reprogram the node. It has been specially designed to be scalable, easy to deploy and maintain.
Note: For a complete reference guide download the “Waspmote Plug & Sense! Technical Guide” in the Development section of the
Libelium website.
2.1. Quick Overview
2.1.1. Features
• Robust waterproof IP65 enclosure
• Add or change a sensor probe in seconds
• Solar powered with internal and external panel options
• Radios available: ZigBee, 802.15.4, WiFi, 868MHz, 900MHz, LoRaWAN, LoRa, Sigfox, 3G/GPRS and Bluetooth Low Energy
• Over the air programming (OTAP) of multiple nodes at once
• Special holders and brackets ready for installation in street lights and building fronts
• Graphical and intuitive programming interface
• External, contactless reset with magnet
• External SIM connector for GPRS or 3G models
2.1.2. Sensor Probes
Sensor probes can be easily attached by just screwing them into the bottom sockets. This allows you to add new sensing
capabilities to existing networks just in minutes. In the same way, sensor probes may be easily replaced in order to ensure the
lowest maintenance cost of the sensor network.
Figure: Connecting a sensor probe to Waspmote Plug & Sense!

-15- v6.3
Waspmote Plug & Sense! - Encapsulated Line
2.1.3. Solar Powered
Battery can be recharged using the internal or external solar panel options.
The external solar panel is mounted on a 45º holder which ensures the maximum performance of each outdoor installation.
Figure: Waspmote Plug & Sense! powered by an external solar panel
For the internal option, the solar panel is embedded on the front of the enclosure, perfect for use where space is a major
challenge.
Figure: Internal solar panel

-16- v6.3
Waspmote Plug & Sense! - Encapsulated Line
Figure: Waspmote Plug & Sense! powered by an internal solar panel
2.1.4. Programming the Nodes
Waspmote Plug & Sense! can be reprogrammed in two ways:
The basic programming is done from the USB port. Just connect the USB to the specic external socket and then to the computer
to upload the new rmware.
Figure: Programming a node

-17- v6.3
Waspmote Plug & Sense! - Encapsulated Line
Over the Air Programming is also possible once the node has been installed. With this technique you can reprogram wirelessly
one or more Waspmote sensor nodes at the same time by using a laptop and the Waspmote Gateway.
Figure: Typical OTAP process
2.1.5. Radio Interfaces
Model Protocol Frequency txPower Sensitivity Range *
XBee-802.15.4-Pro 802.15.4 2.4GHz 100mW -100dBm 7000m
XBee-ZB-Pro ZigBee-Pro 2.4GHz 50mW -102dBm 7000m
XBee-868 RF 868MHz 315mW -112dBm 12km
XBee-900 RF 900MHz 50mW -100dBm 10Km
LoRaWAN LoRaWAN 868, 900 and 433 MHz
bands up to 18.5 dBm -136dBm
- km - Typical
base station
range
LoRa RF 868 and 900 MHz 14 dBm -137dBm 21+Km
Sigfox Sigfox 868MHz 14 dBm -126dBm
- km - Typical
base station
range
WiFi 802.11b/g 2.4GHz 0dBm - 12dBm -83dBm 50m-500m
GPRS Pro and GPRS+GPS - 850MHz/900MHz/
1800MHz/1900MHz
2W(Class4) 850MHz/900MHz,
1W(Class1) 1800MHz/1900MHz -109dBm - Km - Typical
carrier range
3G/GPRS -
Europe version: Dual-
band UMTS, tri-band
GSM/GPRS/EDGE
America/Australia
version: Dual-Band:
UMTS, quad-Band GSM/
GPRS/EDGE
UMTS 0.25 W,
GSM 2 W,
DCS/PCS 1 W
-106dBm - Km - Typical
carrier range
Bluetooth Low Energy Bluetooth v.4.0 /
Bluetooth Smart 2.4GHz 3dBm -103dBm 100m
* Line of sight, Fresnel zone clearance and 5dBi dipole antenna.

-18- v6.3
Waspmote Plug & Sense! - Encapsulated Line
2.1.6. Program in minutes
In order to program the nodes an intuitive graphic interface has been developed. Developers just need to ll a web form in
order to obtain the complete source code for the sensor nodes. This means the complete program for an specic application
can be generated just in minutes. Check the Code Generator to see how easy it is at:
http://www.libelium.com/development/plug_&_sense/sdk_and_applications/code_generator
Figure: Code Generator
2.1.7. Data to the Cloud
The Sensor data gathered by the Waspmote Plug & Sense! nodes is sent to the Cloud by Meshlium, the Gateway router specially
designed to connect Waspmote sensor networks to the Internet via Ethernet, WiFi and 3G interfaces.
Thanks to Meshlium’s new feature, the Sensor Parser, now it is easier to receive any frame, parse it and store the data into a local
or external Data Base.
Figure: Meshlium

-19- v6.3
Waspmote Plug & Sense! - Encapsulated Line
2.1.8. Models
There are some dened congurations of Waspmote Plug & Sense! depending on which sensors are going to be used.Waspmote
Plug & Sense! congurations allows connecting up to six sensor probes at the same time.
Each model takes a dierent conditioning circuit to enable the sensor integration. For this reason each model allows to connect
just its specic sensors.
This section describes each model conguration in detail, showing the sensors which can be used in each case and how to
connect them to Waspmote. In many cases, the sensor sockets accept the connection of more than one sensor probe. See the
compatibility table for each model conguration to choose the best probe combination for the application.
It is very important to remark that each socket is designed only for one specic sensor, so they are not interchangeable.
Always be sure you connected probes in the right socket, otherwise they can be damaged.
Figure: Identification of sensor sockets

-20- v6.3
Waspmote Plug & Sense! - Encapsulated Line
2.1.8.1. Smart Environment
Smart Environment model is designed to monitor environmental parameters such as temperature, humidity, atmospheric
pressure and some types of gases. The main applications for this Waspmote Plug & Sense! conguration are city pollution
measurement, emissions from farms and hatcheries, control of chemical and industrial processes, forest res, etc. Sensors are
calibrated for more accurate measurements. Go to the Applications section in the Libelium website for a complete list of services.
Figure: Smart Environment Waspmote Plug & Sense! model
Other manuals for Waspmote
4
Table of contents
Other Libelium Accessories manuals