Waspmote Technical Guide
Waspmote Technical Guide
Technical Guide
Index
INDEX
1. Introduction........................................................................................................................... 6
2. Waspmote Kit......................................................................................................................... 7
2.1. General and safety information....................................................................................................... 7
2.2. Conditions of use............................................................................................................................... 8
2.3. Assembly........................................................................................................................................... 10
4. Hardware.............................................................................................................................. 52
4.1. Modular architecture....................................................................................................................... 52
4.2. Specifications.................................................................................................................................... 52
4.3. Block diagram................................................................................................................................... 53
4.4. Electrical data................................................................................................................................... 54
4.5. I/O ..................................................................................................................................................... 55
4.5.1. Analog pins............................................................................................................................56
4.5.2. Digital pins.............................................................................................................................56
-2- v7.2
Index
4.5.3. PWM.......................................................................................................................................56
4.5.4. UART......................................................................................................................................57
4.5.5. I2C..........................................................................................................................................57
4.5.6. SPI...........................................................................................................................................57
4.5.7. USB.........................................................................................................................................57
4.6. Real Time Clock - RTC...................................................................................................................... 57
4.7. LEDs................................................................................................................................................... 59
6. Interruptions........................................................................................................................ 63
7. Energy system...................................................................................................................... 64
7.1. Concepts........................................................................................................................................... 64
7.2. Sleep mode....................................................................................................................................... 65
7.3. Deep Sleep mode............................................................................................................................. 66
7.4. Hibernate mode............................................................................................................................... 66
8. Sensors.................................................................................................................................. 68
8.1. Accelerometer.................................................................................................................................. 68
8.2. Integration of new sensors............................................................................................................. 71
8.3. Sensor boards.................................................................................................................................. 72
8.4. Power................................................................................................................................................. 76
9. 802.15.4/ZigBee/RF modules............................................................................................... 77
9.1. XBee-PRO 802.15.4.......................................................................................................................... 77
9.2. XBee-PRO ZigBee............................................................................................................................. 80
9.3. XBee 868LP....................................................................................................................................... 81
9.4. XBee-PRO 900HP.............................................................................................................................. 83
9.5. XBee-PRO DigiMesh......................................................................................................................... 84
-3- v7.2
Index
18. 3G module........................................................................................................................... 97
19. 4G module........................................................................................................................... 98
-4- v7.2
Index
-5- v7.2
Introduction
1. Introduction
This guide explains the features related to our new product line Waspmote v15, released on October 2016.
If you are using previous versions of our products, please use the corresponding guides, available on our
Development website.
You can get more information about the generation change on the document “New generation of Libelium product
lines”.
-6- v7.2
Waspmote Kit
2. Waspmote Kit
Important:
•• All documents and any examples they contain are provided as-is and are subject to change without notice.
Except to the extent prohibited by law, Libelium makes no express or implied representation or warranty of
any kind with regard to the documents, and specifically disclaims the implied warranties and conditions of
merchantability and fitness for a particular purpose.
•• The information on Libelium’s websites has been included in good faith for general informational purposes
only. It should not be relied upon for any specific purpose and no representation or warranty is given as to
its accuracy or completeness.
DO NOT TRY TO RECHARGE THE NON-RECHARGEABLE BATTERY, IT MAY EXPLODE AND CAUSE INJURIES
AND DESTROY THE EQUIPMENT. USE NON-RECHARGEABLE BATTERIES ONLY WITH DEVICES PROPERLY
PREPARED. PLEASE DOUBLE CHECK THIS CONDITION BEFORE CONNECTING THE USB OR THE SOLAR
PANEL.
The document “General Conditions of Libelium Sale and Use” can be found at:
http://www.libelium.com/development/waspmote/technical_service
-7- v7.2
Waspmote Kit
•• 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 specified 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 specifications 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 fi-
nal product. This product must have an enclosure to protect it from dust, humidity and other environmental
interactions. If the product 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 perma-
nently damage it.
Specific:
•• Buttons and switches: 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. Connect with extreme care.
•• Mini-USB connection: Only use mini-USB, mod. B, compatible cables.
•• Solar panel connection: Only use the solar panels specified in the “Power supplies” section and always res-
pect polarity.
•• Lithium battery connection: Only use the connector specified 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. Li-
belium implements a special process to ensure the SD cards we provide will work fine with OTA. The only SD
cards that Libelium can assure that work correctly with Waspmote are the SD cards we distribute officially.
•• Micro SD card: Make sure Waspmote is switched off before inserting or removing the SD card. Otherwise,
the SD card could be damaged.
•• Micro SD card: Waspmote must not be switched off or reseted while there are ongoing read or write opera-
tions in the SD card. Otherwise, the SD card could be damaged and data could be lost.
•• XBee module connection: Waspmote allows the connection of any module from the XBee family, respect
polarity when connecting (see print).
•• Other modules connection: Only use the original modules created by Libelium.
•• 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 adapters.
•• USB voltage adapters: To power and charge the Waspmote battery, use only the original accessories distri-
buted by Libelium.
-8- v7.2
Waspmote Kit
The rechargeable, ion-lithium batteries, like the ones provided by Libelium (capacity of 6600 mA·h), 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 suffer 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 redu-
ced.
•• 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 particular:
-- discharge range = [-10, 60] ºC
-- charge range = [0, 45] ºC
Only use the non-rechargeable batteries with the Waspmote units specifically prepared for them (identified with a
pink sticker on them). The reason is, a regular Waspmote will try to inject current in the non-rechargeable battery
if the USB or the solar panel is connected. This is dangerous for the good working of a non-rechargeable battery.
It could be damaged or even damage Waspmote.
Libelium may provide the nodes with enclosures which are suitable to operate outdoors. The user, as final 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.
-9- v7.2
Waspmote Kit
2.3. Assembly
•• Connect the antenna to the wireless module
-10- v7.2
Waspmote Kit
-11- v7.2
Waspmote Kit
•• Switch it on
-12- v7.2
Waspmote Kit
Insert the pick on the slot of the battery connector and pull straight out.
Do not pull the battery cables.
-13- v7.2
Waspmote Kit
-14- v7.2
Waspmote Plug & Sense!
Note: For a complete reference guide download the “Waspmote Plug & Sense! Technical Guide” in the Development
section of the Libelium website.
3.1. Features
•• Robust waterproof IP65 enclosure
•• Add or change a sensor probe in seconds
•• Solar powered with internal and external panel options
•• Radios available: 802.15.4, 868 MHz, 900 MHz, WiFi, 4G, Sigfox and LoRaWAN
•• Over the air programming (OTAP) of multiple nodes at once (via WiFi or 4G radios)
•• Special holders and brackets ready for installation in street lights and building fronts
•• Graphical and intuitive interface Programming Cloud Service (coming in 2017)
•• Built-in, 3-axes accelerometer
•• External, contactless reset with magnet
•• Optional industrial protocols: RS-232, RS-485, Modbus, CAN Bus
•• Optional GPS receiver
•• External SIM connector for the 4G models
•• Fully certified: CE (Europe), FCC (USA), IC (Canada), ANATEL (Brazil), RCM (Australia), PTCRB (USA, cellular
connectivity), AT&T (USA, cellular connectivity)
-15- v7.2
Waspmote Plug & Sense!
3.2.1. Specifications
•• Material: polycarbonate
•• Sealing: polyurethane
•• Cover screws: stainless steel
•• Ingress protection: IP65
•• Impact resistance: IK08
•• Rated insulation voltage AC: 690 V
•• Rated insulation voltage DC: 1000 V
•• Heavy metals-free: Yes
•• Weatherproof: true - nach UL 746 C
•• Ambient temperature (min.): -10 °C
•• Ambient temperature (max.): 50 °C
•• Approximated weight: 800 g
In the pictures included below it is shown a general view of Waspmote Plug & Sense! main parts. Some elements
are dedicated to node control, others are designated to sensor connection and other parts are just identification
elements. All of them will be described along this guide.
164 mm
85 mm
124 mm
175 mm
122 mm
410 mm
160 mm
-16- v7.2
Waspmote Plug & Sense!
-17- v7.2
Waspmote Plug & Sense!
-18- v7.2
Waspmote Plug & Sense!
Important note: Do not handle black stickers seals of the enclosure (Warranty stickers). Their integrity is the proof
that Waspmote Plug & Sense! has not been opened. If they have been handled, damaged or broken, the warranty is
automatically void.
5 6
8
10
4 3
Figure: Waspmote Plug & Sense! accessories: 1 enclosure, 2 sensor probes, 3 external solar panel, 4 USB cable, 5 antenna, 6 cable ties,
7 mounting feet (screwed to the enclosure), 8 extension cord, 9 solar panel cable, 10 wall plugs & screws
-19- v7.2
Waspmote Plug & Sense!
3.2.3. Identification
Each Waspmote model is identified by stickers. Next figure shows front sticker.
Enclosure model
There are many configurations of Waspmote Plug & Sense! line, all of them identified by one unique sticker. Next
image shows all possibilities.
-20- v7.2
Waspmote Plug & Sense!
Moreover, Waspmote Plug & Sense! includes a back sticker where it is shown identification numbers, radio MAC
addresses, etc. It is highly recommended to annotate this information and save it for future maintenance. Next
figure shows it in detail.
Sensor probes are identified too by a sticker showing the measured parameter and the sensor manufacturer
reference.
Measure Sensor
parameter
CO - TGS2442 reference
-21- v7.2
Waspmote Plug & Sense!
Go to the Plug & Sense! Sensor Guide to know more about our sensor probes.
-22- v7.2
Waspmote Plug & Sense!
The external solar panel is mounted on a 45º holder which ensures the maximum performance of each outdoor
installation.
For the internal option, the solar panel is embedded on the front of the enclosure, perfect for use where space is
a major challenge.
-23- v7.2
Waspmote Plug & Sense!
-24- v7.2
Waspmote Plug & Sense!
The basic programming is done from the USB port. Just connect the USB to the specific external socket and then
to the computer to upload the new firmware.
Besides, Libelium is developing a graphical and intuitive programming interface, the Programming Cloud Service
(coming in 2017).
-25- v7.2
Waspmote Plug & Sense!
Over the Air Programming (OTAP) is also possible once the node has been installed (via WiFi or 4G radios). With
this technique you can reprogram, wireless, one or more Waspmote sensor nodes at the same time by using a
laptop and Meshlium.
-26- v7.2
Waspmote Plug & Sense!
LoRaWAN US LoRaWAN 900 MHz 18.5 dBm -136 dBm > 15 km FCC, IC
* Line of sight and Fresnel zone clearance with 5dBi dipole antenna.
-27- v7.2
Waspmote Plug & Sense!
The available Industrial Protocols are RS-232, RS-485, Modbus (software layer over RS-232 or RS-485) and CAN Bus.
This optional feature is accessible through an additional, dedicated socket on the antenna side of the enclosure.
-28- v7.2
Waspmote Plug & Sense!
Finally, the user can choose between 2 probes to connect the desired Industrial Protocol: A standard DB9 connector
and a waterproof terminal block junction box. These options make the connections on industrial environments or
outdoor applications easier.
-29- v7.2
Waspmote Plug & Sense!
3.6. GPS
Any Plug & Sense! node can incorporate a GPS receiver in order to implement real-time asset tracking applications.
The user can also take advantage of this accessory to geolocate data on a map. An external, waterproof antenna
is provided; its long cable enables better installation for maximum satellite visibility.
Antenna:
•• Cable length: 2 m
•• Connector: SMA
•• Gain: 26 dBi (active)
Available information: latitude, longitude, altitude, speed, direction, date&time and ephemeris management
-30- v7.2
Waspmote Plug & Sense!
3.7. Models
There are some defined configurations of Waspmote Plug & Sense! depending on which sensors are going to be
used. Waspmote Plug & Sense! configurations allow to connect up to six sensor probes at the same time.
Each model takes a different conditioning circuit to enable the sensor integration. For this reason each model
allows to connect just its specific sensors.
This section describes each model configuration 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 configuration to choose the best probe combination
for the application.
It is very important to remark that each socket is designed only for one specific sensor, so they are not
interchangeable. Always be sure you connected probes in the right socket, otherwise they can be damaged.
-31- v7.2
Waspmote Plug & Sense!
-32- v7.2
Waspmote Plug & Sense!
Note: For more technical information about each sensor probe go to the Development section on the Libelium website.
-33- v7.2
Waspmote Plug & Sense!
Calibrated gas sensors are manufactured once the order has been placed to ensure maximum durability of the
calibration feature. The manufacturing process and delivery may take from 4 to 6 weeks. The lifetime of calibrated
gas sensors is 6 months working at maximum accuracy. We strongly encourage our customers to buy extra gas
sensors to replace the original ones after that time to ensure maximum accuracy and performance.
Note: In March 2017, Smart Environment (which is the Plug & Sense! version for the Gases sensor board) was
discontinued. The Gases sensor board is now only available in the Waspmote OEM product line. Libelium currently
offers Gases PRO (Smart Environment PRO) and Smart Cities PRO for accurate measuring of gases.
-34- v7.2
Waspmote Plug & Sense!
Note: The probes attached in this photo could not match the final location. See next table for the correct configuration.
-35- v7.2
Waspmote Plug & Sense!
As we see in the figure below, thanks to the directional probe, the presence sensor probe (PIR) may be placed in
different positions. The sensor can be focused directly to the point we want.
Note: For more technical information about each sensor probe go to the Development section on the Libelium
website.
-36- v7.2
Waspmote Plug & Sense!
The Smart Water Ions line is complementary for these kinds of projects, enabling the control of concentration
of ions like Ammonium (NH4+), Bromide (Br-), Calcium (Ca2+), Chloride (Cl-), Cupric (Cu2+), Fluoride (F-), Iodide (I-),
Lithium (Li+), Magnesium (Mg2+), Nitrate (NO3-), Nitrite (NO2-), Perchlorate (ClO4-), Potassium (K+), Silver (Ag+), Sodium
(Na+) and pH. Take a look to the Smart Water Ions line in the next section.
-37- v7.2
Waspmote Plug & Sense!
Note: For more technical information about each sensor probe go to the Development section on the Libelium
website.
-38- v7.2
Waspmote Plug & Sense!
The Smart Water line is complementary for these kinds of projects, enabling the control of parameters like
turbidity, conductivity, oxidation-reduction potential and dissolved oxygen. Take a look to the Smart Water line in
the previous section. Refer to Libelium website for more information.
There are 3 variants for Smart Water Ions: Single, Double and PRO. This is related to the type of ion sensor that
each variant can integrate. Next section describes each configuration in detail.
-39- v7.2
Waspmote Plug & Sense!
3.7.4.1. Single
This variant includes a Single Junction Reference Probe, so it can read all the single type ion sensors.
Sensor sockets are configured as shown in the table below.
Figure: Sensor sockets configuration for Smart Water Ions model, single variant
Note: For more technical information about each sensor probe go to the Development section on the Libelium
website.
3.7.4.2. Double
This variant includes a Double Junction Reference Probe, so it can read all the double type ion sensors.
Sensor sockets are configured as shown in the table below.
Figure: Sensor sockets configuration for Smart Water Ions model, double variant
Note: For more technical information about each sensor probe go to the Development section on the Libelium
website.
-40- v7.2
Waspmote Plug & Sense!
3.7.4.3. Pro
This special variant integrates extreme quality sensors, with better performance than the Single or Double lines.
In this case, there is only one type of reference probe and up to 16 different ion parameters can be analyzed in 4
sockets.
Sensor sockets are configured as shown in the table below.
Figure: Sensor sockets configuration for Smart Water Ions model, PRO variant
Note: For more technical information about each sensor probe go to the Development section on the Libelium
website.
-41- v7.2
Waspmote Plug & Sense!
The node benefits from Sigfox and LoRaWAN technologies (868 and 900 MHz bands), getting ubiquitous coverage
with few base stations. The device is very optimized in terms of power consumption, resulting in a long battery life.
Its small size and the robust and surface-mount enclosure enables a fast installation, without the need of digging
a hole in the ground. Finally, the developer does not need to program the node, but just configure some key
parameters. Remote management and bidirectional communication allow to change parameters from the Cloud.
Note: There are specific documents for parking applications on the Libelium website. Refer to the Smart Parking
Technical Guide to see typical applications for this model and how to make a good installation.
-42- v7.2
Waspmote Plug & Sense!
The main applications for this Waspmote Plug & Sense! model are precision agriculture, irrigation systems,
greenhouses, weather stations, etc. Refer to Libelium website for more information.
Two variants are possible for this model, normal and PRO. Next section describes each configuration in detail.
-43- v7.2
Waspmote Plug & Sense!
3.7.6.1. Normal
Sensor sockets are configured as shown in the figure below.
Note: For more technical information about each sensor probe go to the Development section on the Libelium
website.
-44- v7.2
Waspmote Plug & Sense!
3.7.6.2. PRO
Sensor sockets are configured as shown in the figure below.
Note: For more technical information about each sensor probe go to the Development section on the Libelium
website.
-45- v7.2
Waspmote Plug & Sense!
-46- v7.2
Waspmote Plug & Sense!
As we see in the figure below, thanks to the directional probe, the Luminosity (Luxes accuracy) sensor probe may
be placed in different positions. The sensor can be focused directly to the light source we want to measure.
Note: For more technical information about each sensor probe go to the Development section on the Libelium
website.
-47- v7.2
Waspmote Plug & Sense!
-48- v7.2
Waspmote Plug & Sense!
Note: For more technical information about each sensor probe go to the Development section in Libelium website.
Calibrated gas sensors are manufactured once the order has been placed to ensure maximum durability of the
calibration feature. The manufacturing process and delivery may take from 4 to 6 weeks. The lifetime of calibrated
gas sensors is 6 months working at maximum accuracy. We strongly encourage our customers to buy extra gas
sensors to replace the original ones after that time to ensure maximum accuracy and performance.
-49- v7.2
Waspmote Plug & Sense!
Note: For more technical information about each sensor probe go to the Development section on the Libelium
website.
-50- v7.2
Waspmote Plug & Sense!
Note: For more technical information about each sensor probe go to the Development section on the Libelium website.
-51- v7.2
Hardware
4. Hardware
4.1. Modular architecture
Waspmote is based on a modular architecture. The idea is to integrate only the modules needed in each device.
These modules can be changed and expanded according to needs.
4.2. Specifications
•• Microcontroller: ATmega1281
•• Frequency: 14.7456 MHz
•• SRAM: 8 kB
•• EEPROM: 4 kB
•• FLASH: 128 kB
•• SD Card: 2 GB
•• Weight: 20 g
•• Dimensions: 73.5 x 51 x 13 mm
•• Temperature range: -10 ºC, +65 ºC]
-52- v7.2
Hardware
-53- v7.2
Hardware
Power signals:
-54- v7.2
Hardware
4.5. I/O
Waspmote can communicate with other external devices through the using different input/output ports.
Sensor connector:
-55- v7.2
Hardware
To obtain input values, the function analogRead(analog input) is used, the function’s input parameter will be the
name of the input to be read “ANALOG1, ANALOG2…” (see sensor connector figure). The value obtained from this
function will be an integer number between 0 and 1023, 0 corresponds to 0 V and 1023 to 3.3 V.
The analog input pins can also be used as digital input/output pins. If these pins are going to be used as digital
ones, the following correspondence list for pin names must be taken into account:
{
val = analogRead(ANALOG1);
}
{
// set DIGITAL3 pin as input and read its value
pinMode(DIGITAL3, INPUT);
val = digitalRead(DIGITAL3);
4.5.3. PWM
DIGITAL1 pin can also be used as output PWM (Pulse Width Modulation) with which an analog signal can be
“simulated”. It is actually a square wave between 0 V and 3.3 V for which the proportion of time when the signal
is high can be changed (its working cycle) from 0% to 100%, simulating a voltage of 0 V (0%) to 3.3 V (100%).The
resolution is 8 bit, so up to 255 values between 0-100% can be configured. The instruction to control the PWM
output is analogWrite(DIGITAL1, value); where value is the analog value (0-255).
{
analogWrite(DIGITAL1, 127);
}
-56- v7.2
Hardware
4.5.4. UART
There are 2 UARTs in Waspmote: UART0 and UART1. Besides, there are several ports which might be connected
to these UARTs through 2 different multiplexers, one for each UART.
•• UART0 is shared by the USB port and the Socket0. This socket is used for XBee modules, LoRaWAN module,
LoRa module, Sigfox module, RFID/NFC module, Bluetooth modules, WiFi module, RS-485 module, etc. The
multiplexer in this UART controls the data signal which by default is always switched to Socket0. When the
USB needs to send info through the UART0, the multiplexer is momentarily switched to the USB port and
set back again to Socket0 after printing.
•• UART1 is shared by 4 ports: Socket1, GPS socket, Auxiliar1 and Auxiliar2 sockets. It is possible to select in
the same program which of the 4 ports is connected to UART1 in the microcontroller. UART1 multiplexer
configuration is carried out using the following instructions:
{
Utils.setMuxAux1(); // set Auxiliar1 socket
Utils.setMuxAux2(); // set Auxiliar2 socket
Utils.setMuxGPS(); // set GPS socket
Utils.setMuxSocket1(); // set Socket1
}
4.5.5. I2C
The I2C communication bus is also used in Waspmote where several devices are connected in parallel: the
accelerometer, a crypto-authentication memory and the RTC. In all cases, the microcontroller acts as master while
the other devices connected to the bus are slaves.
4.5.6. SPI
The SPI port on the microcontroller is used for communication with the micro SD card. All operations using the bus
are performed clearly by the specific library. The SPI port is also available in the SPI/UART connector and Socket0.
4.5.7. USB
USB is used in Waspmote for communication with a computer or compatible USB devices. This communication
allows the microcontroller’s program to be loaded.
For USB communication, microcontroller’s UART0 is used. The FT232RL chip carries out the conversion to USB
standard.
“Sleep for 1h 20 min and 15sec, then wake up and perform the following action..”
“Wake on the 5th of next month at 00:20 and perform the following action..”
All RTC programming and control is done through the I2C bus.
Alarms:
Alarms can be programmed in the RTC specifying day/hour/minute/second. That allows total control about when
the mote wakes up to capture sensor values and perform actions programmed on it. This allows Waspmote to
be in the saving energy modes (Deep Sleep and Hibernate) and makes it wake up just at the required moment.
-57- v7.2
Hardware
As well as relative alarms, periodic alarms can be programmed by giving a time measurement, so that Waspmote
reprograms its alarm automatically each time one event is triggered.
The RTC chosen is the Maxim DS1337C, which operates at a frequency of 32.768 kHz (a second divisor value which
allows it to quantify and calculate time variations with high precision).
The RTC is powered by the battery. When the battery is connected, the RTC is powered on. However, the user must
keep in mind that if the battery is removed or out of load, then time data will be not maintained. This is the reason
we suggest to use RTC time as ‘relative’ and not ‘absolute’ (see Programming Guide for more info).
A coin or button battery is not needed. They have a limited life and therefore Waspmote can have a much longer
power life expectancy. This is so because the RTC is powered from the “main” battery which has a much bigger
charge.
The RTC is responsible for waking Waspmote up from sleep modes like Deep Sleep and Hibernate. This makes
possible to use its battery to just power the RTC in sleep modes. The RTC controls when the device has to wake
up and perform a particular action. This permits a consumption of 7 uA in the Hibernate mode. Please refer to
“Energy System” section for more information.
-58- v7.2
Hardware
4.7. LEDs
•• Charging battery LED indicator: A red LED indicating that there is a battery connected in Waspmote which
is being charged. The charging can be done through a mini-USB cable or through a solar panel connected to
Waspmote. Once the battery is completely charged, the LED switches off automatically.
•• LED0 (programmable LED): A green LED is connected to the microcontroller. It is totally programmable by
the user from the program code. In addition, the LED0 indicates when Waspmote resets, blinking each time
a reset on the board is carried out.
•• LED1 (programmable LED): A red LED is connected to the microcontroller. It is totally programmable by
the user from the program code.
•• USB Power LED indicator: A green LED which indicates when Waspmote is connected to a compatible USB
port either for battery charging or programming. When the LED is on, it indicates that the USB cable is con-
nected correctly. When the USB cable is removed, this LED will switch off automatically.
-59- v7.2
Architecture and system
When Waspmote is connected and starts the bootloader, there is a waiting time (62.5 ms) before beginning the
first instruction, this time is used to start loading new compiled programs updates. If a new program is received
from the USB during this time, it will be loaded into the FLASH memory (128 kB) substituting already existing
programs. Otherwise, if a new program is not received, the last program stored in the memory will start running.
The structure of the codes is divided into 2 basic parts: setup and loop. Both parts of the code have sequential
behaviour, executing instructions in the set order.
The setup is the first part of the code, which is only run once when the code is initialized. In this part it is
recommended to include the initialization of the modules which are going to be used, as well as the part of the
code which is only important when Waspmote is started.
The part named loop runs continuously, forming an infinite loop. Because of the behavior of this part of the code,
the use of interruptions is recommended to perform actions with Waspmote.
A common programming technique to save energy would be based on blocking the program (either keeping the
micro awake or asleep in particular cases) until any of the interruptions available in Waspmote show that an event
has occurred. This way, when an interruption is detected the associated function, which was previously stored in
an interruption vector, is executed.
To be able to detect the capture of interruptions during the execution of the code, a series of flags have been created
and will be activated to indicate the event which has generated the interruption (see chapters “Interruptions” and
“Energy system”).
When Waspmote is reset or switched on, the code starts again from the setup function and then the loop function.
By default, variable values declared in the code and modified in execution will be lost when a reset occurs or there
is no battery. To store values permanently, it is necessary to use the microcontroller’s EEPROM (4 kB) non-volatile
memory. EEPROM addresses from 0 to 1023 are used by Waspmote to save important data, so they must not be
over-written. Thus, the available storage addresses go from 1024 to 4095. Another option is to use of the high
capacity 2 GB SD card.
-60- v7.2
Architecture and system
5.2. Timers
Waspmote uses a quartz oscillator which works at a frequency of 14.7456 MHz as a system clock. In this way, every
125ns the microcontroller runs a low level (machine language) instruction. It must be taken into account that each
line of C++ code of a program compiled by Waspmote includes several instructions in machine language.
Waspmote is a device prepared for operation in adverse conditions with regards to noise and electromagnetic
contamination, for this reason, to ensure stable communication at all times with the different modules connected
through a serial line to the UARTs (communication modules and USB) a maximum transmission speed of 115200
bps has been set for the communication modules and the USB port, and 4800 for the GPS, so that the success
rate in received bits is 100%.
5.2.1. Watchdog
The ATmega1281 microcontroller has an internal Enhanced Watchdog Time – WDT. The WDT precisely counts
the clock cycles generated by a 128 kHz oscillator. The WDT generates an interruption signal when the counter
reaches the set value. This interruption signal can be used to wake the microcontroller from the Sleep mode or
to generate an internal alarm when it is running in on mode, which is very useful when developing programs with
timed interruptions.
The WDT allows the microcontroller to wake up from a low consumption Sleep mode by generating an interruption.
For this reason, this clock is used as a time-based alarm associated with the microcontroller’s Sleep mode. This
allows very precise control of small time intervals: 16 ms, 32 ms, 64 ms, 128 ms, 256 ms, 500 ms, 1 s, 2 s, 4 s, 8
s. For intervals over 8 s (Deep Sleep mode), the RTC is used and not the microcontroller.
More information about the interruptions generated by the Watchdog can be found in the “Energy system” chapter.
The Watchdog feature requires the physical watchdog switch to be put in “enable” position.
-61- v7.2
Architecture and system
All information about the RTC programming and operation can be found in the RTC Programming Guide.
All the documentation is located in the Development section in the Libelium website.
5.2.3. RTC
As shown in the “Hardware” chapter, Waspmote has a real time clock (RTC) running a 32.786 kHz which allows to
set an absolute time.
Alarms can be programmed in the RTC specifying day/hour/minute/second. This allows total control when the
mote wakes up to capture values and perform actions programmed on it. Also, the RTC allows Waspmote to
function in the maximum energy saving modes (Deep Sleep and Hibernate) and to wake up just at the required
moment.
The RTC allows the microcontroller to be woken from a low consumption state by generating an interruption. For
this reason, it has been associated to the microcontroller’s Deep Sleep and Hibernate modes, making it possible to
put the microcontroller to sleep, and wake it up by activating an alarm in the RTC. Sleeping intervals can go from
1 s to minutes, hours or even days.
More information about the interruptions generated by the RTC and Deep Sleep and Hibernate modes can be
found in the “Energy system” chapter.
All information about the RTC programming and operation can be found in the RTC Programming Guide.
All the documentation is located in the Development section in the Libelium website.
-62- v7.2
Interruptions
6. Interruptions
Interruptions are signals received by the microcontroller which indicate it must stop the task it is doing to handle
an event that has just happened. Interruption control frees the microcontroller from having to control sensors all
the time. It also makes the sensors warn Waspmote when a determined value (threshold) is reached.
•• Synchronous interruptions: They are scheduled by timers. They allow to program when we want them to
be triggered. There are 2 types of timer alarms: periodic and relative.
-- Periodic alarms are those to which we specify a particular moment in the future, for example: “Alarm
programmed for every 4th day of the month at 00:01 and 11 seconds”. They are controlled by the RTC.
-- Relative alarms are programmed taking into account the current moment, eg: “Alarm programmed
for 5 minutes and 10 seconds”. They are controlled through the RTC and the microcontroller’s internal
Watchdog.
•• Asynchronous Interruptions: These are not scheduled, so it is not known when they will be triggered.
Types:
-- Sensors: The sensor boards can be programmed so that an alarm is triggered when a sensor reaches a
certain threshold.
-- Accelerometer: Waspmote’s accelerometer can be programmed so that certain events such (as a fall or
change of direction) generate an interruption.
All interruptions, both synchronous and asynchronous can wake Waspmote up from the Sleep and the Deep
Sleep modes. However, only the synchronous interruption by the RTC is able to wake it up from the Hibernate
mode.
The Hibernate mode totally disconnects the Waspmote power, leaving only the battery powering the RTC to
wake Waspmote up when the time alarm is reached. Because of this disconnection, when the RTC generates the
corresponding alarm, the power in Waspmote is reconnected and the code starts again from the setup.
The way of detecting whether a reboot from the Hibernate mode has happened is to check whether the
corresponding flag has been activated. The activation of this flag happens when the ifHibernate() function is
called, which must be done at the beginning of the setup part of the code. This way, when Waspmote starts, it
tests if it is a normal start or if it is a start from the Hibernate mode.
All information about the programming and operation of interruptions can be found in the Interruption Programming
Guide.
-63- v7.2
Energy system
7. Energy system
7.1. Concepts
Waspmote has 4 operational modes:
On the other hand, each module (radio, sensor board, etc) might have up to several operation modes.
For complete information about interruption types and their handling, see the “Interruption” chapter.
All information about the programming and operation of interruptions can be found in the Interrupt Programming
Guide.
All the documentation is located in the Development section in the Libelium website.
Note: Before setting Waspmote to a low-power consumption mode, it is always recommended to switch any communication
module off.
-64- v7.2
Energy system
In this mode the microcontroller stops executing the main program. The program stack where all the variables and
log values are stored keep their value, so when Waspmote returns to on mode, the next instruction is executed
and the variable values are maintained.
The following example would set Waspmote in the Sleep mode for 32 ms. The microcontroller would be in a state
of minimum consumption waiting for the synchronous interruption from the Watchdog:
{
PWR.sleep(WTD_32MS, ALL_OFF);
}
-65- v7.2
Energy system
In this mode the microcontroller stops executing the main program. The program stack where all the variables and
log values are stored keep their value, so when Waspmote returns to on mode, the next instruction is executed
and the variable values are maintained.
In this mode the microcontroller does not store any values from variables or from the program stack. When
leaving the Hibernate state the microcontroller is reset, so the setup and loop routines are run as if the main
switch were activated.
-66- v7.2
Energy system
The Hibernate mode requires the physical Waspmote’s hibernate switch to be put in “enable” position. It is
necessary to follow the next steps when executing the program for the first time after uploading it to Waspmote:
The following example would set Waspmote in the Hibernate mode for 2 days, 1 hour and 30 minutes. The
microcontroller would be switched off waiting for the RTC to switch the device on again with a synchronous
interruption.
{
PWR.hibernate(“02:01:30:00”, RTC_OFFSET, RTC_ALM1_MODE2);
}
All information about the programming and operation of sleep modes can be found in the Interruption Programming
Guide.
All the documentation is located in the Development section in the Libelium website.
-67- v7.2
Sensors
8. Sensors
8.1. Accelerometer
Waspmote has a built-in acceleration sensor LIS3331LDH, by STMicroelectronics, which informs the mote of
acceleration variations experienced on each one of the 3 axes (X,Y, Z).
The integration of this sensor allows the measurement of acceleration on the 3 axes (X, Y, Z), establishing 4 kinds
of events: Free Fall, inertial wake up, 6D movement and 6D position which are explained in the Interruption
Programming Guide.
The LIS331DLH has dynamically user-selectable full scales of ±2g/±4g/±8g and it is capable of measuring
accelerations with output data rates from 0.5 Hz to 1 kHz.
The device features ultra low-power operational modes that allow advanced power saving and smart sleep to
wake-up functions.
The accelerometer has several power modes, the output data rate (ODR) will depend on the power mode selected.
The power modes and output data rates are shown in this table:
This accelerometer has an auto-test capability that allows the user to check the functioning of the sensor in the
final application. Its operational temperature range is between -40 ºC and +85 ºC.
-68- v7.2
Sensors
The accelerometer communicates with the microcontroller through the I2C interface. The pins that are used for
this task are the SCL pin and the SDA pin, as well as another interruption pin to generate the interruptions.
The accelerometer has 4 types of event which can generate an interrupt: free fall, inertial wake up, 6D movement
and 6D position.
To show the ease of programming, an extract of code about how to get the accelerometer values is included
below:
{
ACC.ON();
ACC.getX();
ACC.getY();
ACC.getZ();
}
Some figures with possible uses of the accelerometer are shown below:
-69- v7.2
Sensors
Crash:
More information about interruptions generated by the accelerometer can be found in the chapter “Interruptions”
and in the Interruption Programming Guide.
All information about their programming and operation can be found in the Accelerometer Programming Guide.
All the documentation is located in the Development section in the Libelium website.
-70- v7.2
Sensors
The management the 2 power lines (3.3 and 5 V) for the sensor boards (described in more depth in section
”Sensors” → Power) is carried out through 2 solid state switches which allow the continuous flow of a current of up
to 200 mA and whose control can be programmed using the functions included in the WaspPWR library, described
in the files WaspPWR.h and WaspPWR.cpp.
The input and output voltage values for both digital and analog pins will be between 0 V and 3.3 V, logic zero (‘0’)
being found in values less than 0.5 V and logic one (‘1’) in values higher than 2.30 V. To read analog signals, the
microcontroller has a 10-bit analog-to-digital converter which allows a resolution of 3 mV. Waspmote also has one
8-bit resolution PWM output pin for the generation of analog signals. Information on the libraries and instructions
used for reading and writing on these pins can be found in the API manual.
Waspmote includes 2 interruption pins, a low level (TXD1) one and a high level (RXD1) one, which offer an
alternative to reading the sensors by survey, allowing the microcontroller to be woken up when an event occurs
(such as exceeding a certain threshold in a comparator) which generates a change in a digital signal connected to
one of the above pins, facilitating the sensor reading only at the moments when a remarkable event occurs.
This option is especially recommended for low consumption sensors that may remain active for long periods of
time. Reading by survey (switched on and cyclical sensor reading after a set time) is more appropriate for those
that, in addition to showing greater consumption, do not require monitoring that generates an alarm signal.
The interruptions can be managed using the warning functions and vectors (flags) defined in the Winterruptions
library, file Winterruptions.c. More can be learnt about their use in the Interruption Programming Guide.
Sensors reading can generate 3 types of response: storage of collected data (on the SD card), wireless transmission
of data (via wireless module) or automatic activation through an actuator directly controlled by the microcontroller’s
output signals or through a switch or relay.
-71- v7.2
Sensors
• Security • Pressure/Weight
Hall effect (doors and windows), person • Hall Effect
detection PIR • Temperature, Humidity and
Pressure
• Emergencies
• Liquid Presence
Presence detection and water level
sensors, temperature • Liquid Level
• Liquid flow
• Control of goods in logistics
• Luminosity (Luxes)
• Presence (PIR)
• Ultrasound (distance
measurement)
-73- v7.2
Sensors
-74- v7.2
Sensors
-75- v7.2
Sensors
It is possible to find more detailed information in the manual for each board at:
http://www.libelium.com/development/waspmote/documentation
8.4. Power
In the sensor connector there are also several power pins, specifically GND, 3.3 V and 5 V.
•• 3V3 SENSOR POWER: 3.3 V power voltage (200 mA maximum) which is controlled from the Waspmote exe-
cution code.
•• 5V SENSOR POWER: 5 V power voltage (200 mA maximum) which is controlled from the Waspmote execu-
tion code.
-76- v7.2
802.15.4/ZigBee/RF modules
9. 802.15.4/ZigBee/RF modules
Waspmote integrates the Digi’s XBee modules for communication in the ISM (Industrial Scientific Medical) bands.
These modules communicate with the microcontroller using the UART0 or UART1 at 115200 bps.
There are several possible XBee modules distributed by Libelium for integration in Waspmote.
* To determine your range, perform a range test under your operating conditions
* To determine your range, perform a range test under your operating conditions
-77- v7.2
802.15.4/ZigBee/RF modules
The frequency used is the free band of 2.4 GHz, using 12 channels with a bandwidth of 5 MHz per channel.
The XBee-PRO 802.15.4 modules comply with the standard IEEE 802.15.4 which defines the physical level and the
link level (MAC layer). The XBee modules add certain functionalities to those contributed by the standard, such as:
•• Node discovery: certain information has been added to the packet headers so that they can discover other
nodes on the same network. It allows a node discovery message to be sent, so that the rest of the network
nodes respond indicating their data (Node Identifier, @MAC, @16 bits, RSSI).
•• Duplicated packet detection: This functionality is not set out in the standard and is added by the XBee
modules.
-78- v7.2
802.15.4/ZigBee/RF modules
The classic topology of this type of network is a star topology, as the nodes establish point to point connections
with brother nodes through the use of parameters such as the MAC or network address.
Regarding the transmission power, it can be adjusted to several values depending on the radio version:
-79- v7.2
802.15.4/ZigBee/RF modules
* To determine your range, perform a range test under your operating conditions
As the ZigBee standard is supported in the IEEE 802.15.5 link layer, it uses the same channels as described in the
previous section, with the peculiarity that the XBee-PRO ZigBee model limits the number of channels to 13.
The XBee-PRO ZigBee modules comply with the ZigBee-PRO v2007 standard. These modules add certain
functionalities to those contributed by ZigBee, such as:
•• Node discovery: some headings are added so that other nodes within the same network can be discove-
red. It allows a node discovery message to be sent, so that the rest of the network nodes respond indicating
their specific information (Node Identifier, @MAC, @16 bits, RSSI).
•• Duplicated packet detection: This functionality is not set out in the standard and is added by the XBee
modules.
The topologies in which these modules can be used are: star and tree.
-80- v7.2
802.15.4/ZigBee/RF modules
Regarding the transmission power, it cannot be adjusted because it is always set to 17 dBm.
* To determine your range, perform a range test under your operating conditions
Note: The XBee 868 MHz module is provided with 4.5dBi antenna, which enables maximum range.
-81- v7.2
802.15.4/ZigBee/RF modules
The frequency used is the 868 MHz band, using 30 software selectable channels. Channels are spaced 100 kHz
apart. The transmission rate is 10 kbps.
The classic topology for this type of network is a star topology, as the nodes can establish point-to-point
connections with brother nodes through the use of the MAC address.
All information about their programming and operation can be found in the 868 Networking Guide.
All the documentation is located in the Development section in the Libelium website.
-82- v7.2
802.15.4/ZigBee/RF modules
* To determine your range, perform a range test under your operating conditions
The frequency used is the 900 MHz band, using 64 software selectable channels. Channels are spaced 400 kHz
apart. The transmission rate is 10 kbps. There are different versions of the XBee 900HP: USA & Canada, Brazil and
Australia.
The different versions differ mainly in the available channels, which are hard-coded in the XBee. Be aware that it is
not possible to change from one version to other with just a firmware change. According to the country where
the user is located, a different version must be chosen.
The classic topology for this type of network is a star topology, as the nodes can establish point-to-point connections
with brother nodes through the use of parameters such as the MAC address or that of the network.
-83- v7.2
802.15.4/ZigBee/RF modules
* To determine your range, perform a range test under your operating conditions
The XBee-PRO 802.15.4 modules can use an optional firmware called DigiMesh. So the modules can create mesh
networks instead of the usual point-to-point topology. This firmware has been developed by Digi in order to
allow the modules to sleep, synchronize themselves and work on equal terms, avoiding the use of node routers
or coordinators that have to be permanently powered on. Characteristics of the implemented protocol:
•• Self healing: any node can join or leave the network at any moment.
•• All nodes are equal: there are no father-son relationships.
•• Silent protocol: reduced routing heading due to using a reactive protocol similar to AODV (Ad hoc On-
Demand Vector Routing).
•• Route discovery: instead of keeping a route map, routes are discovered when they are needed.
•• Selective ACKs: only the recipient responds to route messages.
•• Reliability: the use of ACKs ensures data transmission reliability.
•• Sleep modes: low energy consumption modes with synchronization to wake at the same time.
The classic topology of this type of network is mesh, as the nodes can establish point-to-point connections with
brother nodes through the use the MAC address doing multi-hop connections when it is necessary.
The XBee DigiMesh modules share the hardware module with the XBee-PRO 802.15.4. So it is possible to change
the firmware of this kind of modules from one to another and vice versa (this can be done with a Gateway). For
this reason, the characteristics related to the hardware are the same.
The XBee DigiMesh modules are based on the standard IEEE 802.15.4 that supports functionalities enabling mesh
topology use.
-84- v7.2
LoRaWAN modules
LoRaWAN network architecture is typically laid out in a star-of-stars topology in which gateways is a transparent
bridge relaying messages between end-devices and a central network server in the back-end. Gateways
are connected to the network server via standard IP connections while end-devices use single-hop wireless
communication to one or many gateways.
Communication between end-devices and gateways is spread out on different frequency channels and data rates.
The selection of the data rate is a trade-off between communication range and message duration. Due to the
spread spectrum technology, communications with different data rates do not interfere with each other and
create a set of “virtual” channels increasing the capacity of the gateway. To maximize both battery life of the end-
devices and overall network capacity, the LoRaWAN network server is managing the data rate and RF output for
each end-device individually by means of an adaptive data rate (ADR) scheme.
National wide networks targeting Internet of Things such as critical infrastructure, confidential personal data or
critical functions for the society has a special need for secure communication. This has been solved by several
layer of encryption.
-85- v7.2
LoRaWAN modules
-86- v7.2
LoRa module
Note: The LoRa module is provided with a 4.5 dBi antenna, which enables maximum range.
This radio module provides an optimum range performance, thanks to the excellent receiver sensitivity that the
LoRa™ technology offers. Besides, Libelium developed a library which enables addressable, reliable and robust
communications with ACK, re-tries or time-outs strategies.
The user can set any frequency in the 868 and 900 MHz bands, with pre-defined channels. The use of this module
is allowed in virtually any country.
Encryption is implemented in the application level, thanks to the Waspmote’s AES library. The payload inside the
wireless packet is encrypted so only nodes knowing the key can read the content. The encryption activation is as
simple as running one of our LoRa with AES encryption examples.
The topology for this type of network is a star topology, as the nodes can establish point-to-point connections
with brother nodes, normally with the central one.
-87- v7.2
Sigfox modules
So Sigfox is similar to cellular (GSM-GPRS-3G-4G) but is more energy-efficient, and the annual fees are lower.
Sigfox uses a UNB (Ultra Narrow Band) based radio technology to connect devices to its global network. The use
of UNB is key to providing a scalable, high-capacity network, with very low energy consumption, while maintaining
a simple and easy to rollout star-based cell infrastructure.
•• Frequency
-- Sigfox EU module: ISM 868 MHz
-- Sigfox US module: ISM 900 MHz
•• TX power
-- Sigfox EU module: up to 16 dBm
-- Sigfox US module: up to 24 dBm
•• ETSI limitation: 140 messages of 12 bytes, per module per day
•• Range: Typically, each base station covers some km. Check the Sigfox network.
Figure: Sigfox module
•• Chipset consumption
-- Sigfox EU module: TX 51 mA @ 14 dBm
-- Sigfox US module: TX 230 mA @ 24 dBm
•• Radio data rate: 100 bps
•• Receive sensitivity: -126 dBm
•• Sigfox certificate: Class 0u (the highest level)
The network operates in the globally available ISM bands (license-free frequency bands) and co-exists in these
frequencies with other radio technologies, but without any risk of collisions or capacity problems.
Sigfox is being rolled out worldwide. It is the responsibility of the system integrator to consult the catalog of SNOs
(Sigfox Network Operators) for checking coverage in the deployment area.
The Sigfox back-end provides a web application interface for device management and configuration of data
integration, as well as standards based web APIs to automate the device management and implement the data
integration.
-88- v7.2
WiFi PRO module
The WiFi PRO module supports the SSL3/TLS1 protocol for secure sockets. On the WLAN interface it supports WEP,
WPA and WPA2 WiFi encryption.
The WiFi PRO module may connect to any standard router which is configured as Access Point (AP) and then send
data to other devices in the same network such as laptops and smart phones. Besides, they can send data directly
to a web server located on the Internet.
Instead of using a standard WiFi router as AP, the connection may be performed using a Meshlium device as
AP. Meshlium is the multiprotocol router designed by Libelium which is specially recommended for outdoor
applications as it is designed to resist the hardest conditions in real field deployments. For more information
about Meshlium go to:
http://www.libelium.com/meshlium.
All information about their programming and operation can be found in the WiFi Networking Guide.
All the documentation is located in the Development section in the Libelium website.
-89- v7.2
Bluetooth Pro module
Bluetooth uses 79 channels with a bandwidth of 1 MHz per channel. In addition, Adaptive Frequency Hopping
(AFH) is used to enhance the transmissions.
The Bluetooth radio module has been specifically designed in order to scan up to 250 devices in a single inquiry
(smart phones, tablets, computers, etc). The main purpose is to be able to detect as many Bluetooth users as
possible in the surrounding area.
-90- v7.2
Bluetooth Pro module
All information on their programming can be found in document: Bluetooth Networking Guide.
All the documentation is located in the Development section in the Libelium website.
Note: If you want to detect iPhone and Android devices using the WiFi interface as well as the Bluetooth radio go
to the “Smartphone Detection” section in the Meshlium website: http://www.libelium.com/meshlium
-91- v7.2
Bluetooth Low Energy module
BLE modules use the 2.4 GHz band (2402 MHz – 2480 MHz). It has 37 data channels and 3 advertisement channels,
with a 2MHz spacing.
-92- v7.2
Bluetooth Low Energy module
In the same way as Bluetooth classic modules, other BLE modules can be identified by their MAC address and
public name. Also, the RSSI is provided to show the quality of each link.
All information on their programming can be found in document: Bluetooth Low Energy Networking Guide.
All the documentation is located in the Development section in the Libelium website.
-93- v7.2
GPRS module
•• Making/Receiving calls
•• Making ‘x’-second lost calls
•• Sending/Receiving SMS
•• Single connection and multiple connections TCP/IP and UDP/IP clients
•• TCP/IP server
•• HTTP service
•• FTP service (downloading and uploading files)
This model uses the UART1 at a baudrate of 57600 bps speed to communicate with the microcontroller.
Related API libraries: WaspGPRS_Pro.h, WaspGPRS_Pro.cpp , WaspGPRS_Pro_core.h and WaspGPRS_Pro_core.
cpp
All information about their programming and operation can be found in the GPRS Programming Guide.
All the documentation is located in the Development section in the Libelium website.
Note: A rechargeable battery must be always connected when using this module (USB power supply is not enough).
-94- v7.2
GPRS+GPS module
GPRS features:
GPS features:
•• Time-To-First-Fix: 30 s (typ.)
•• Sensitivity:
-- Tracking: -160 dBm
-- Acquisition: -147 dBm
•• Accuracy horizontal position : <2.5 m CEP
-95- v7.2
GPRS+GPS module
•• Making/Receiving calls
•• Making ‘x’-second lost calls
•• Sending/Receiving SMS
•• Single connection and multiple connections TCP/IP and UDP/IP clients
•• TCP/IP server
•• HTTP service
•• FTP Service (downloading and uploading files)
•• GPS receiver
This model uses the UART1 at a baudrate of 57600bps speed to communicate with the microcontroller.
All information about their programming and operation can be found in the GPRS+GPS Programming Guide.
All the documentation is located in the Development section in the Libelium website.
Note: A rechargeable battery must be always connected when using this module (USB power supply is not enough).
-96- v7.2
3G module
18. 3G module
Waspmote can integrate a UMTS (Universal Mobile Telecommunication System based in WCDMA technology) /
GPRS (General Packet Radio Service) module to enable communication using the 3G/GPRS mobile telephone
network.
This model uses the UART1 at a baudrate of 115200 bps to communicate with the microcontroller.
All information about programming and operation can be found in the 3G/GPRS Networking Guide.
Note: A rechargeable battery must be always connected when using this module (USB power supply is not enough).
-97- v7.2
4G module
19. 4G module
The 4G module enables the connectivity to high speed LTE, HSPA+, WCDMA cellular networks in order to make
possible the creation of the next level of worldwide compatible projects inside the new “Internet of Things” era.
This communication module is specially oriented to work with Internet servers, implementing internally several
application layer protocols, which make easier to send the information to the cloud. We can make HTTP navigation,
downloading and uploading content to a web server. We can also set secure connections using SSL certificates
and setting TCP/IP private sockets. In the same way, the FTP protocol is also available which is really useful when
your application requires handling files.
The module includes a GPS/GLONASS receiver, able to perform geolocation services using NMEA sentences,
offering information such as latitude, longitude, altitude and speed; that makes it perfect to perform tracking
applications.
The 4G module offers the maximum performance of the 4G network as it uses 2 different antennas (normal +
diversity) for reception (MIMO DL 2x2), choosing the best received signal at any time and getting a maximum
download speed of 100 Mbps.
We chose the LE910 chipset family from Telit as it comprises the most complete 4G/LTE set of variants released
up to date. It counts with many different models, each one specifically designed for one market but all of them
with the same footprint:
Europe/Brazil version:
•• 2G: 900/1800 MHz
•• WCDMA: 850/900/2100 MHz
•• LTE: 800/1800/2600 MHz
America version:
•• 2G: 850/1900 MHz
•• WCDMA: 850/1900 MHz
•• LTE: 700/850/1700/1900 MHz
Australia version:
•• 4G: 700/1800/2600 MHz Figure: 4G module
LTE (downlink):
•• Europe/Brazil version up to 100 Mbps
•• America version up to 100 Mbps
•• Australia version up to 150 Mbps
-98- v7.2
4G module
TX power:
•• Europe/Brazil:
-- Class 4 (2 W, 33 dBm) @ GSM 900
-- Class 1 (1 W, 30 dBm) @ GSM 1800
-- Class E2 (0.5 W, 27 dBm) @ EDGE 900
-- Class E2 (0.4 W, 26 dBm) @ EDGE 1800
-- Class 3 (0.25 W, 24 dBm) @ UMTS
-- Class 3 (0.2 W, 23 dBm) @ LTE
•• America:
-- Class 4 (2 W, 33 dBm) @ GSM 900
-- Class 1 (1 W, 30 dBm) @ GSM 1800
-- Class E2 (0.5 W, 27 dBm) @ EDGE 900
-- Class E2 (0.4 W, 26 dBm) @ EDGE 1800
-- Class 3 (0.25 W, 24 dBm) @ UMTS
-- Class 3 (0.2 W, 23 dBm) @ LTE
•• Australia:
-- Class 3(0.2W, 23 dBm) @ LTE
Antenna connector:
•• U.FL for main antenna
•• U.FL for cellular diversity antenna
•• U.FL for GPS antenna (only for Europe/Brazil and America modules)
Certifications:
•• LE910-EUG (Europe / Brazil): CE, GCF, ANATEL
•• LE910-NAG (US / Canada): FCC, IC, PTCRB, AT&T approved
•• LE910-AU V2 (Australia): RCM, Telstra approved
•• LE910-SKG (South Korea): KCC, SK Telecom approved
•• LE910-JN V2 / LE910-JK V2 (Japan): NTT DoCoMo, KDDi
••
This model uses the UART1 at a baudrate of 115200 bps to communicate with the microcontroller.
Related API libraries: Wasp4G.h, Wasp4G.cpp
All information about programming and operation can be found in the 4G Networking Guide.
All the documentation is located in the Development section of Libelium website.
Note: A rechargeable battery must be always connected when using this module (USB power supply is not enough).
-99- v7.2
RFID/NFC module
Applications:
-100- v7.2
RFID/NFC module
-101- v7.2
Industrial Protocols
-102- v7.2
Industrial Protocols
-103- v7.2
Industrial Protocols
Applications:
•• Industrial Equipment
•• Machine to Machine (M2M) communications
•• Industrial Control Systems, including the most common versions of Modbus and Profibus
•• Programmable logic controllers
•• RS485 is also used in building automation
•• Interconnect security control panels and devices
•• Wasp485.h, Wasp485.cpp
•• ModbusMaster.h, ModbusMaster.cpp
•• ModbusSlave.h, ModbusSlave.cpp
All information about their programming and operation can be found in the RS-485 Communication Guide and the
Modbus Communication Guide.
All the documentation is located in the Development section in the Libelium website.
-104- v7.2
Industrial Protocols
Applications:
•• Dialup modems
•• GPS receivers (typically NMEA 0183 at 4,800 bit/s)
•• Bar code scanners and other point of sale devices
•• LED and LCD text displays
•• Satellite phones, lowspeed satellite modems and other satellite based transceiver devices
•• Flatscreen (LCD and Plasma) monitors to control screen functions by external computer, other AV compo-
nents or remotes
•• Test and measuring equipment such as digital multimeters and weighing systems
•• Updating Firmware on various consumer devices.
•• Some CNC controllers
•• Uninterruptible power supply
•• Stenography or Stenotype machines
•• Software debuggers that run on a 2nd computer
•• Industrial field buses
•• Wasp232.h, Wasp232.cpp
•• ModbusMaster.h, ModbusMaster.cpp
•• ModbusSlave.h, ModbusSlave.cpp
All information about their programming and operation can be found in the RS-232 Communication Guide and the
Modbus Communication Guide.
All the documentation is located in the Development section in the Libelium website.
-105- v7.2
Industrial Protocols
Applications:
•• Automotive applications
•• Home automation
•• Industrial Networking
•• Factory automation
•• Marine electronics
•• Medical equipment
•• Military uses
•• WaspCAN.h, WaspCAN.cpp
All information about their programming and operation can be found in the CAN Bus Communication Guide.
All the documentation is located in the Development section in the Libelium website.
-106- v7.2
Industrial Protocols
21.5. Modbus
The Modbus is a software library that can be operated physically on the RS-485 and RS-232 modules. Thus, Modbus
is a software layer which provides with interesting services.
Technical details:
•• Protocol: Modbus
•• Data area: Up to 255 bytes per job
•• Interface: Layer 7 of the ISO-OSI reference model
•• Connector: DB9 (RS-485 / RS-232 modules)
•• Number of possible connections: up to 32 in multi point systems
•• Frame format: RTU
Figure: RS-485 module
Applications:
•• Multiple master-slave applications
•• Sensors and Instruments
•• Industrial Networking
•• Building and infrastructure
•• Transportation and energy applications
All information about their programming and operation can be found in the RS-232 Communication Guide, RS-485
Communication Guide and Modbus Communication Guide.
All the documentation is located in the Development section in the Libelium website.
-107- v7.2
Expansion Radio Board
Applications:
-108- v7.2
Over the Air Programming (OTA)
Libelium provides an OTA method based on FTP transmissions to be used with GPRS, GPRS+GPS, 3G, 4G and WiFi
modules.
The Waspmote reprogramming is done using an FTP server and an FTP client (which is Waspmote itself). The FTP
server can be configured by Meshlium. Otherwise, the user will have to setup an FTP server.
-109- v7.2
Over the Air Programming (OTA)
•• Step 1: Waspmote requests a special text file which gives information about the program to update: pro-
gram name, version, size, etc.
•• Step 2: If the information given is correct, Waspmote queries the FTP server for a new program binary file
and it updates its flash memory in order to run the new program.
-110- v7.2
Encryption libraries
•• Link Layer: In the first one all the nodes of the network share a common preshared key which is used to en-
crypt the information using AES 128. This process is carried out by specific hardware integrated in the same
802.15.4/ZigBee radio, allowing the maximum efficiency of the sensor nodes energy consumption. This first
security layer ensures no third party devices will be able to even connect to the network (access control).
•• Secure Web Server Connection: The second security technique is carried out in Meshlium -the Gateway-
where HTTPS and SSH connections are used to send the information to the Cloud server located on the
Internet.
A third optional encryption layer allows each node to encrypt the information using the Public key of the Cloud
server. Thus, the information will be kept confidentially all the way from the sensor device to the web or data base
server on the Internet.
•• WaspAES.h, WaspAES.cpp
•• WaspRSA.h, WaspRSA.cpp
•• WaspHash.h, WaspHash.cpp
All information about their programming and operation can be found in the Encryption Programming Guide.
All the documentation is located in the Development section in the Libelium website.
-111- v7.2
GPS
25. GPS
Any Plug & Sense! node can incorporate a GPS receiver in order to implement real-time asset tracking applications.
The user can also take advantage of this accessory to geolocate data on a map. An external, waterproof antenna
is provided; its long cable enables better installation for maximum satellite visibility.
Antenna:
•• Cable length: 2 m
•• Connector: SMA
•• Gain: 26 dBi (active)
-112- v7.2
GPS
•• latitude
•• longitude
•• altitude
•• speed
•• direction
•• date/time
•• ephemeris
The functions implemented in the API allow this information to be extracted simply, calling functions such as:
{
GPS.getAltitude();
GPS.getSpeed();
GPS.getLongitude();
GPS.getLatitude();
}
The GPS receiver uses the UART_1 to communicate with the microcontroller, sharing this UART with the GPRS,
GPRS+GPS, 3G or 4G modules. As up to 2 modules share this UART, a multiplexer has been enabled in order to
select the module with which we wish to communicate at any time. This is not a problem; since all actions are
sequential, in practice there is parallel availability of both devices.
The GPS starts up by default at 4800 bps. This speed can be increased using the library functions that have been
designed for controlling and managing the module.
The GPS receiver has 2 operational modes: NMEA (National Marine Electronic Association) mode and binary
mode. NMEA mode uses statements from this standard to obtain location, time and date. The binary mode is
based on the sending of structured frames to establish communication between the microcontroller and the GPS
receiver, i.e. to read/set ephemeris.
The different types of NMEA statements that the Waspmote’s built-in GPS receiver supports are:
The most important NMEA statements are the GGA statements which provide a validity indicator of the measurement
carried out, the RMC statement which provides location, speed and date/time and the GSA statement which
provides information about the status of the satellites the GPS receiver has been connected to.
(To obtain more information about the NMEA standard and the NMEA statements, visit the website:
http://www.gpsinformation.org/dale/nmea.htm)
-113- v7.2
GPS
The GPS receiver needs time to obtain and structure the information that the satellites send. This time can be
reduced if there is certain prior information. This information is stored in the almanacs and ephemeris. The
information that can be found out is relative to the current position of the satellites (ephemeris) and the trajectory
they are going to follow over the next days (almanacs). The almanacs indicate the trajectory that the satellites are
going to follow during the next days, having a validity of some 2-3 months. The ephemeris indicate the current
position of the satellites and have a validity of some 3-5 hours.
Depending on the information that the GPS receiver has, the start ups can be divided into these types:
•• Hot start: once the time and date are established and the ephemeris and valid almanacs are in the me-
mory. Time: <1 s.
•• Cold start: without having established the time, date, almanacs or ephemeris. Time: <35 s.
As can be observed, the start up time reduces greatly, particularly when ephemeris are stored. For this reason
a series of functions have been created in the libraries to store ephemeris on the SD card and enable them to
be loaded later.
All information about their programming and operation can be found in the document: GPS Programming Guide.
All the documentation is located in the Development section in the Libelium website.
-114- v7.2
SD memory card
Micro-SD card
Waspmote uses the FAT16 file system and can support cards up to 2 GB. The information that Waspmote stores
in files on the SD can be accessed from different operating systems such as Linux, Windows or Mac-OS.
To communicate with the SD module we use the SPI bus. This bus is a communication standard used to transfer
information between electronic devices which accept clock regulated bit flow.
The SD card is powered through a digital pin from the microcontroller. It is not therefore necessary to use a
switch to cut the power, putting a low pin value is enough to set the SD consumption to 0 μA.
To get an idea of the capacity of information that can be stored in a 2 GB card, simply divide its size by the average
for what a sensor frame in Waspmote usually occupies (approx. 100 bytes):
The limit in files and directories creation per level is 256 files per directory and up to 256 sub-directories in each
directory. There is no limit in the number of nested levels.
All information about their programming and operation can be found in the SD Card Programming Guide.
All the documentation is located in the Development section in the Libelium website.
Note: Make sure Waspmote is switched off before inserting or removing the SD card. Otherwise, the SD card could be
damaged.
Note: Waspmote must not be switched off 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.
-115- v7.2
Energy Consumption
XBee
SENDING RECEIVING
XBee-PRO 802.15.4 250 mA 55 mA
XBee-PRO ZigBee 295 mA 45 mA
XBee 868LP 48 mA 27 mA
XBee-PRO 900HP 215 mA 29 mA
Bluetooth modules
On Off Sleep Scanning Sending Receiving
Bluetooth Pro 14 mA 0 mA <0,5 mA 40 mA 34 mA 20 mA
Bluetooth Low 8 mA 0 mA 0.4 μA 36 mA 36 mA 36 mA
Energy
GPS
On (tracking) 32 mA
Off (Waspmote switch) 0 μA
GPRS Pro
Connecting ~100 mA
Calling ~100 mA
Receiving calls ~100 mA
Transmitting GPRS ~100 mA
Sleep 1 mA
Off ~0 μA
-116- v7.2
Energy Consumption
GPRS+GPS
Connecting ~100 mA
Calling ~100 mA
Receiving calls ~100 mA
Transmitting GPRS ~100 mA
Sleep 1 mA
Off ~0 μA
GPS acquisition mode 72 mA
GPS tracking mode 67 mA
3G/GPRS
Connecting ~100 mA
Transmitting/Receiving ~100 mA (1.2A – 2 A during transmission slot every
GPRS 4.7ms )
Transmitting/Receiving 3G ~300 mA - 500 mA
Sleep 1 mA
Off ~0 μA
SD
On 0.14 mA
Reading 0.2 mA
Writing 0.2 mA
Off 0 μA
Accelerometer
Sleep 0,08 mA
Hibernate 0,65 mA
Off ~0 μA
-117- v7.2
Power supplies
Waspmote has a control and safety circuit which makes sure the battery charge current is always adequate.
Battery connection
The figure below shows the connector in which the battery is to be connected. The position of the battery connector
is unique, therefore it will always be connected correctly (unless the connector is forced).
-118- v7.2
Power supplies
Battery discharging
Warning: Batteries with voltage over 3.7 V could irreparably damage Waspmote.
Incorrect battery connection could irreparably damage Waspmote.
DO NOT TRY TO RECHARGE THE NON-RECHARGEABLE BATTERY, IT MAY EXPLODE AND CAUSE INJURIES
AND DESTROY THE EQUIPMENT. USE NON-RECHARGEABLE BATTERIES ONLY WITH DEVICES PROPERLY
PREPARED. PLEASE DOUBLE CHECK THIS CONDITION BEFORE CONNECTING THE USB OR THE SOLAR
PANEL.
-119- v7.2
Power supplies
Both the mini USB connector and the solar panel connector allow only one connection position which must be
respected without being forced into the incorrect position. In this way connection polarity is respected.
Solar panels up to 12 V are allowed. The maximum charging current through the solar panel is 330 mA.
-120- v7.2
Power supplies
-121- v7.2
Power supplies
28.3. USB
•• USB to PC connection
•• USB to 220 V connection
•• USB to vehicle connector connection
-122- v7.2
Power supplies
-123- v7.2
Working environment
All information about the IDE installation and operation can be found in the IDE User Guide.
All the documentation is located in the Development section in the Libelium website.
-124- v7.2
Interacting with Waspmote
The receiving equipment can be a PC with Linux, Windows or Mac-OS, or any device compatible with standard
USB connectivity. The gateway offers a male USB A connector, so the receiving device has to have a female USB
A connector.
Once the Gateway is correctly installed, a new communication serial port connecting directly to the XBee module’s
UART appears in the receiving equipment, which allows the XBee to communicate directly with the device, being
able to both receive data packets from the sensor network as well as modify and/or consult the XBee’s configuration
parameters.
Another important function worth pointing out is the possibility of updating or changing the XBee module’s
firmware.
-125- v7.2
Interacting with Waspmote
LEDs
•• USB power LED: indicates that the board is powered through the USB port
•• RX LED: indicates that the board is receiving data from the USB port
•• TX LED: Indicates that the board is sending data to the USB port
•• I/O 5 configurable LED: associate
The configurable LED connected to the XBee’s I/O 5 pin can be configured either as the XBee’s digital output or as
the XBee’s indicator of association to the sensor network.
Buttons
All the buttons connect each one of its corresponding data lines with GND with when pressed. None of these have
pull-up resistance so it may be necessary to activate any of the XBee’s internal pull-up resistances depending on
the required use.
Once the application is launched, the speed and the USB where Waspmote has been connected must be configured.
The speed that must be selected is 115200 bps which is the standard speed set up for Waspmote.
The USB where Waspmote has been connected must be added the first time this application is run, adding USB0,
USB1, etc (up to the USB number of each computer) according to where Waspmote has been connected. For this,
the ‘Device’ window must be modified so that if Waspmote is connected to USB0, this window contains ‘/dev/
ttyUSB0’.
Once these parameters are configured, capture is started by pressing the ‘Open Device’ button.
-126- v7.2
Interacting with Waspmote
Linux Sniffer
As well as using the terminal to see the sensor information, an application which allows this captured data to be
dumped to a file or passed to another program to be used or checked has been developed.
File:
“sniffer.c”
Compilation on Linux:
Examples of use:
Note: The speed used for the example is 19200 bps. The final speed will depend on the speed the XBee module has been
configured with (default value 115200).
Code:
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
-127- v7.2
Interacting with Waspmote
#include <stdlib.h>
#include <termios.h> /* Terminal control library (POSIX) */
if(argc!=2)
{
fprintf(stderr,”Usage: %s [port]\nValid ports: (S0, S1, USB0, USB1)\n”,argv[0], serial-
Port);
exit(0);
}
if (!strcmp(argv[1], s0))
{
fprintf(stderr,”ttyS0 chosen\n...”);
serialPort = serialPort0;
}
if (!strcmp(argv[1], s1))
{
fprintf(stderr,”ttyS1 chosen\n...”);
serialPort = serialPort1;
}
if (!strcmp(argv[1], u0))
{
fprintf(stderr,”ttyUSB0 chosen\n...”);
serialPort = USBserialPort0;
}
if (!strcmp(argv[1], u1))
{
fprintf(stderr,”ttyUSB1 chosen\n...”);
serialPort=USBserialPort1;
}
if (!strcmp(serialPort, ””))
{
fprintf(stderr, ”Choose a valid port (S0, S1, USB0, USB1)\n”, serialPort);
exit(0);
}
-128- v7.2
Interacting with Waspmote
else
{
if (!sd)
{
sd = open(serialPort, O_RDWR | O_NOCTTY | O_NDELAY);
}
//fprintf(stderr,”Serial Port open at: %i\n”, sd);
fcntl(sd, F_SETFL, 0);
}
tcgetattr(sd, &opciones);
cfsetispeed(&opciones, B19200);
cfsetospeed(&opciones, B19200);
opciones.c_cflag |= (CLOCAL | CREAD);
/*No parity*/
// We start filling the string until the end of line char arrives
// or we reach the end of the string. Then we write it on the screen.
if ((c==’\n’) || (j==(MAX-1)))
{
int x;
for (x=0; x<j; x++)
{
write(2, &valor[x], 1);
valor[x] = ’\0’;
}
j = 0;
}
}
close(sd);
}
-129- v7.2
Interacting with Waspmote
Once this application is launched the connection must be configured. The first step is to give it a name:
The next step is to specify the port on which Waspmote has been connected, in this case the system recognizes it
as ‘COM9’, (this will vary on each computer):
-130- v7.2
Interacting with Waspmote
Once these steps have been performed connection with Waspmote has been established, and listening to the serial
port begins.
-131- v7.2
Interacting with Waspmote
This application is configured automatically, establishing the USB on which Waspmote has been connected and
the speed.
The following image shows this application capturing Waspmote’s output, while the example code ‘Waspmote
Accelerator Basic Example’ is run.
-132- v7.2
Meshlium - The IoT Gateway
The sensor data gathered by the Waspmote Plug & Sense! nodes is sent to the Cloud by Meshlium, the IoT gateway
router specially designed to connect Waspmote sensor networks to the Internet via Ethernet and 4G/3G/2G
interfaces.
-133- v7.2
Meshlium - The IoT Gateway
All the networking options can be controlled from the Manager System, a web interface which comes with
Meshlium. It allows to control all the interfaces and system options in a secure, easy and quick way.
All information about Meshlium can be found in the Meshlium Technical Guide.
All the Meshlium documentation is located in the Development section in the Libelium website.
-134- v7.2
Meshlium - The IoT Gateway
-135- v7.2
Meshlium - The IoT Gateway
-136- v7.2
Certifications
32. Certifications
Libelium offers 2 types of IoT sensor platforms, Waspmote OEM and Plug & Sense!:
•• Waspmote OEM is intended to be used for research purposes or as part of a major product so it needs final
certification on the client side. More info at: www.libelium.com/products/waspmote
•• Plug & Sense! is the line ready to be used out-of-the-box. It includes market certifications. See below the
specific list of regulations passed. More info at: www.libelium.com/products/plug-sense
Besides, Meshlium, our multiprotocol router for the IoT, is also certified with the certifications below. Get more
info at:
www.libelium.com/products/meshlium
•• CE (Europe)
•• FCC (US)
•• IC (Canada)
•• ANATEL (Brazil)
•• RCM (Australia)
•• PTCRB (cellular certification for the US)
•• AT&T (cellular certification for the US)
www.libelium.com/certifications
-137- v7.2
Maintenance
33. Maintenance
•• In this section, the term “Waspmote” encompasses both the Waspmote device itself as well as its modules
and sensor boards.
•• Take care when handling Waspmote, do not let it fall, knock it or move it suddenly.
•• Avoid having the devices in high temperature areas as it could damage the electronic components.
•• The antennas should be connected carefully. Do not force them when fitting them as the connectors could
be damaged.
•• Do not use any type of paint on the device, it could harm the operation of the connections and closing me-
chanisms.
-138- v7.2
Disposal and recycling
-139- v7.2
Documentation changelog
•• Added references to the integration of Industrial Protocols for Plug & Sense!
-140- v7.2