Wireless Sensor User Manual v0.2
Wireless Sensor User Manual v0.2
Manual
V0.2
Contents
Introduction 4
Introduction to RF Networks 4
Star Network 4
Multiple Star Networks 4
Redundant network 5
Point-to-point Communications 6
Wireless devices 7
Tech Specs 7
Features 7
Transmission basics 11
Modes of Operation 12
Base Station Mode 13
Sensor Mode 13
Message Format 13
Message Reference 13
Error Codes 16
Functional Reference 16
Base Station 16
Button Sensor 17
Thermistor Sensor 17
DS18B20 Temperature Sensor 18
DHT22 Temperature and Humidity Sensor 19
Analog Sensor 20
Relay switch 21
GPIO 21
Personal Area Networks 22
Connecting to a PC COM port using a USB cable 22
Startup 23
Recovering a dead device 23
Sleep Timer 23
Sleep Mode 23
Waking up a device 24
Introduction
Easy to use wireless data transmission modules where messages all the error checking, encoding,
packetisation and CRC done for you. Build prototypes in minutes. Require no programming and no
drivers. Long range communication up to 1 KM. Support point to multipoint, multipoint to point, multipoint
to multipoint or point to point networks. All devices have built in 128-bit AES encryption for secure over
the air transmissions.
The devices are configurable through the serial interface or over the air.
Introduction to RF Networks
Star Network
Any number of nodes transmitting and receiving data from one central hub. Sensor nodes can sleep to
conserve battery power. No direct communication between end devices.
Redundant network
You can install multiple base stations all on the same PanId to create a redundant network. All radio traffic
travels to all base stations so if you lose a base station then you have a hot backup. You can also install
additional base stations in a areas of poor reception to improve network coverage. Message deduplication
logic must be built either within the base station or further down in back end systems connected to the
network.
Figure 3 - Redundant network design
Point-to-point Communications
Two or more MCU’s can communicate directly with each other as shown in figure 4.
Tech Specs
● All devices are based on the high-performance RF transceiver based on the market-leading
CC1100 SOC
● Wide operating voltage range of 2-3.6V makes the devices suited for battery power
● Current consumption: RX: 16.2 mA , TX: 15.2 mA. Deep Sleep : 0.005Ma (0.5 µA)
● Up to 1KM line of sight. Short range (30M) penetration of walls and floors.
● 128-bit AES encryption security
Features
● Driverless installation
● Base station communicates through serial port (TTL UART)
● Communicates in ASCII clear text making it very easy to exchange data between devices over
the air
● Supports point to point, point to multipoint, multipoint to point and multipoint to multipoint
● Virtually unlimited amount of devices can be deployed. 99,999 Personal Area Network ID’s, 10
channels per frequency and 7,744 Device ID’s per network.
● Super low power consumption allows devices to be use with a coin cell battery for long periods of
time (up to 1 year depending on transmission rates).
● Supports 6 frequencies (433 MHZ, 915 MHZ (default US & Canada), 868.3 MHZ (default
Europe), 868 MHZ, 903 MHZ, 315 MHZ)
● 10 channels
● 4 pins for communicating with external microcontrollers like Raspberry Pi and Arduino : Tx, Rx,
GND, 3V3
● Battery monitor to keep track of power consumption
Introduction to the wireless devices
Installation Steps
Cycle
Indicates the sensor (refer message reference for TYPE) that the sensor will send values for when put
into a sleep cycle (refer message reference ot CYCLE). E.g. if a sensor is set as TYPE4 and put into a
sleep cycle, the sensor will transmit temperature readings from the DS18B20 sensor.
CC Ref
This is the mapping to the CC1100 chip. This can be used if you want to reprogram the device firmware
(outside the scope of this manual). Pins 1, 10, 2, 19 and 20 (3V3, GND, RESET, DATA, CLOCK) can be
use to connect the sensor to a Texas Instrument CC Debugger device for loading custom firmware.
Function
The function provides the pin reference for external devices. The various functions are explained in the
next section.
Pin
This is the Flex Pin number used to reference the pins on the Flex radio module.
RF Communication Basics
Following the above diagram the microcontroller (MCU) communicates with the base station through the
serial port and the base station converts serial to radio and radio back to serial. The base station wants to
send a “Hello” message to a sensor node. The Microcontroller sends “Hello” to the serial port (Tx) and the
base station receives the message through it’s serial port (Rx), then the base station transmits the “Hello”
message and the Sensor Node, on the right, receives the radio transmission and replies “Hi!”, which is
received by the Base Station and sent back to the Microcontroller through the serial port.
All the radio modules use a two character device id tag to identify themselves. A base station will process
all messages coming in over the air and pass them to the MCU with the device ID so that the MCU can
process accordingly. When a radio module receives a message that has a device id that matches its
device id it will processes the message and transmit a reply over the medium (radio or serial) it received
the message. If a base station receives a message that is not the same is its ID then it passes the
message through (either radio to serial or serial to radio).
As shown in the above diagram, messages can be received and sent either through a serial port (in the
case of the base station) or over the air. Messages are processed in the same manner regardless of
whether they arrived through the serial interface or over the air.
1. Sensor node sends a temperature reading to the base station every 5 minutes.
● Sensor node awakens from sleep by the internal timer
● Sensor node transmits a temperature reading
● Base station receives the temperature reading
● The Device ID of the message is not equal to the Device ID of the base station and therefore the
Base Station sends the data to the serial port for processing by the MCU
1.Modes of Operation
All of the RF modules can be configured to operate in different modes that determine the how the device
will operate.
2.Message Format
Each message is made up of 12 characters made up of three sections:
[a] - Message start indicator that is used to detect the start of a message
[id] - 2 charachter device ID identifying the device the message is intended for
[message] - 9 characters message content
5.Message Reference
1 - 433 MHZ
2 - 915 MHZ (default US &
Canada)
3 - 868.3 MHZ (default Europe)
4 - 868 MHZ
5 - 903 MHZ
6 - 315 MHZ
Default is 0.
Default is off.
Refer ATEA for the related
encryption key.
Default is 16 spaces.
ATID[5 num] A 5 digit numeric value that sets a99ATID99999
the PanID of the device. All
devices of the same PanID will
communicate with each other. A
reboot is required to apply the new
PanID.
Defaults is 23205.
Default is 0.
SLEEP Puts the device into Sleep Mode. a99STATEON/OFF (NOMSG times)
See Sleep Mode section for more a99SLEEPING-
details. This command only
applies to devices in sensor
mode..
* ‘9’ represents a number, e.g. 9.99 is a single digit number with two decimals, or 99 is a two digit number
without decimals.
Error Codes
a99ERR------ : Returned when a command is unrecognized or the message is not correctly
formatted as specified in the Message Reference.
6.Functional Reference
The RF modules are loaded with functionality typically required for building sensors and actuators
connected to the internet.
All of the devices can be configured either through the serial port or over the air from one device to
another. Refer the Message Processing section of this manual for more details. Normally one would
configure the Base Station through the serial port, because it is connected to a micro computer (e.g.
Raspberry Pi or Arduino) via the serial port, and a sensor over the air from the base station. Sensors
come pre configured but you may want to tailor your configuration depending on your needs.
Refer to the Command Reference in the manual for all the available configurations and command syntax.
The following section describes how to configure the RF modules to your needs:
1. Base Station
Using an RF module as a Base station connected to a Microcontroller (e.g. Raspberry Pi, Arduino,
BeagleBone etc…).
In order for the device to operate as a base station (and enable the serial port) it must be configured as a
TYPE2 sensor. The Flex is shipped as a TYPE2 and is ready to be connected to an external MCU. Take
note that devices that are not TYPE2 cannot be configured through their serial ports because the serial
port is only enabled once the device is set to TYPE2. In order to configure a device to TYPE 2 you need
to do it over the air from another base station. If you do not have another base station then it is possible to
configure any device within 5 seconds of being started up (see section on device recovery for more
details).
1 3V3 3V3 1
10 GND GND 6
15 Tx Rx 10
16 Rx Tx 8
*It is possible to convert a sensor mode into a base station, however your will need to solder wires or pins
to the board contacts labelled in the above table.
Baud : 9600
Data :8
Parity : None
Stop :1
2. Button Sensor
Using the RF Module as a door/windows sensor or to sense the opening/closing of any tactile switch.
Configurations:
● TYPE1 - configure the RF module as a TYPE1 sensor
● SLEEP - stets the sleep interval in between button state messages (refer sleep mode section for
more details)
● BUTTON - returns the state of a button (BUTTONON or BUTTONOFF)
● NOMSG - sets the number of messages to be sent with each trigger
● INTVL - sets the sleep interval
Pinouts:
● For sensor node RF modules there are two contacts labelled “BtnA” (refer the board layout in Low
Power Wireless Sensor Node section of this manual).
● For Flex modules use Pin 6 and Pin 10 to connect to the external switch.
Functionality:
● When the two button contacts are joined or separated (opened or closed) this action will trigger a
button switch message to be transmitted.
● When the switch goes from an open state to closed then BUTTONOFF is sent.When the switch
goes from a closed state to open then BUTTONON is sent.
● Opening or closing the switch will cause the device to come out of sleep mode, transmit a reading
and then go back to sleep.
3. Thermistor Sensor
A thermistor is an analog sensor for sensing temperature. We have configured the device for an external
10K thermistor (NTCLE100E3103JB0).
Configurations:
● TYPE1 configure the RF module as a TYPE1 sensor
● CYCLE - puts the device into a cyclic sleep waking every INTVL minutes to send a temperature
reading
● TEMP - sending the TEMP command to the device will cause it to transmit a temperature reading
● INTVL - sets the cycle interval
● NOMSG - sets the number of messages to be sent
Pinouts:
● For sensor node RF modules there are two contacts labelled “Tmp” (refer the board layout in Low
Power Wireless Sensor Node section of this manual). A 1k resistor must also be installed on the
PCB.
● For Flex module follow the following wiring diagram:
Functionality:
● A temperature reading can be requested from the module by sending it a TEMP command
● Set the device into a cyclic sleep using the INTVL and CYCLE configurations (see more details in
Cycle Mode section)
● Temperature is sent in the following format : TMPA999.99--
Configurations:
● TYPE4 - configure the RF module as a TYPE4 sensor
● CYCLE - puts the device into a cyclic sleep waking every INTVL minutes to send a temperature
reading
● TEMP3 - sending the TEMP3 command to the device will cause it to transmit a temperature
reading from the DS18B20 sensor
● INTVL - sets the cycle interval
● NOMSG - sets the number of messages to be sent
Pinouts:
● The DS18B20 pinout is not supported on the sensor node module
● For Flex module follow the following wiring table:
1 3V3
8 Data
10 GND
The DS18B20 usually required a 4.7k pull up resistor between 3V3 and Data pins but it is not required
with the Flex because it uses an internal pull-up resistor.
Functionality:
● A temperature reading can be requested from the module by sending it a TEMP3 command
● Set the device into a cyclic sleep using the INTVL and CYCLE configurations (see more details in
Cycle Mode section)
● Temperature is sent in the following format : TMPC99.99---
● Due to the power consumption of the DS18B20 sensor it is not recomended to use a coin cell
battery to power the sensor (even in sleep mode). We calculate a coin cell battery will last for
about a month sending readings every 5 minutes. Two AA batteries would be more appropriate.
5. DHT22 Temperature and Humidity Sensor
DHT22 is a digital temperature and humidity sensor. It is more accurate and has higher sensitivity than a
thermistor.
Configurations:
● TYPE3 - configure the RF module as a TYPE3 sensor
● CYCLE - puts the device into a cyclic sleep waking every INTVL minutes to send a temperature
reading
● TEMP2 - sending the TEMP2 command to the device will cause it to transmit a temperature
reading from the DHT22 sensor
● INTVL - sets the cycle interval
● NOMSG - sets the number of messages to be sent
Pinouts:
● The DHT22 pinout is not supported on the sensor node module
● For Flex module follow the following wiring table:
External 3.3V - 6V
Power
Source
7 Data
10 GND
The DHT22 usually required a 10k pull up resistor between 3V3 and Data pins but it is not required with
the Flex because it uses an internal pull-up resistor.
Functionality:
● A temperature and humidity reading can be requested from the module by sending it a TEMP2
command
● Set the device into a cyclic sleep using the INTVL and CYCLE configurations (see more details in
Cycle Mode section)
● Temperature is sent in the following format : TMPC99.99---
● Humidity is sent in the following format : HUM99.99---
● Due to the power consumption of the DS18B20 sensor it is not recomended to use a coin cell
battery to power the sensor (even in sleep mode). We calculate a coin cell battery will last for
about a month sending readings every 5 minutes. Two AA batteries would be more appropriate.
6. Analog Sensor
The Flex module has two analog input pins that will return values between 0 and 32767.
Configurations:
● TYPE5 - configure the RF module as a TYPE5 for analog sensor 5.
● TYPE6 - configure the RF module as a TYPE6 for analog sensor 6.
● CYCLE - puts the device into a cyclic sleep waking every INTVL minutes to send a temperature
reading
● ANAA - sending the ANAA command to the device will cause it to transmit the analog value for
pin analog sensor A
● ANAB - sending the ANAB command to the device will cause it to transmit the analog value for
pin analog sensor B
● INTVL - sets the cycle interval
● NOMSG - sets the number of messages to be sent
Pinouts:
● The analog sensor pinouts are not supported on the sensor node module
● For Flex module follow the following wiring diagram:
The size of the resistor depends on the analog sensor being used. Input voltage from Pin 12 is 3.3V.
Functionality:
● An analog reading can be requested from the module by sending it a ANAA or ANAB command
● Set the device into a cyclic sleep using the INTVL and CYCLE configurations (see more details in
Cycle Mode section). Only one analog device reading (either from sensor A or B depending on
the TYPE you set) can be sent when in a sleep cycle.
● The analog reading is a number between 0 and 32,767 and is sent in the following format :
ANAA99999--- or ANAB99999---
7. Relay switch
The sensor node and Flex module have two relay control pins that can be used to switch an external relay
switch.
Configurations:
● TYPE1 - configure the RF module as a TYPE1 for to use the relays switches.
● CYCLE - Not applicable
● SLEEP - Not applicable
● RELAYAON - switch relay A on
● RELAYAOFF - switch relay A off
● RELAYBON - switch relay B on
● RELAYBOFF - switch relay B off
● NOMSG - sets the number of messages to be sent
Pinouts:
Tx 15 Relay A IN
Rx 16 Relay B IN
GND 10 GND
The sensor node does support relay switching but wires or pins will need to be soldered to the Tx and Rx
through holes on the sensor node board.
Functionality:
● The RF module must be always awake for it to receive messages to switch the relay
● Send the device RELAYAON, RELAYBON, RELAYAOFF and RELAYBOFF messages to switch
RelayA and.or RelayB on/off.
8. GPIO
The Flex module has three GPIO pins configured for output that can be used to switch each GPIO on/off.
When on they supply 3.3V and when off they supply 0V. Useful for controlling LED’s.
Configurations:
● TYPE1 - configure the RF module as a TYPE1 for to use the GPIO outputs.
● CYCLE - Not applicable
● SLEEP - Not applicable
● GPIOAON - switch GPIO A on
● GPIOAOFF - switch GPIO A off
● GPIOBON - switch GPIO B on
● GPIOBOFF - switch GPIO B off
● GPIOCON - switch GPIO C on
● GPIOCOFF - switch GPIO C off
● NOMSG - Not applicable
Pinouts:
Flex External
Device/Circuit
5 +3.3V
4 +3.3V
3 +3.3V
10 GND
Functionality:
● Send the device GPIOAON, GPIOBON, GPIOCON, GPIOAOFF, GPIOBOFF and GPIOCOFF
messages to switch GPIO A,B or C high/low.
When changing the PanID from a base station to a sensor node make sure you change the
PanID of the sensor nodes before changing the PanID of the base station.
Caution!!! Make sure that the FTDI is set to 3V3 operation. Many FTDI converters are 5V or
have a 5V/3V3 dip switch to change voltage. A 5V FTDI can damage the RF module!!!
11. Startup
When a device is powered on, or after it reboots (refer REBOOT command), it enters into a startup
sequence which begins with sending STARTED-- 5 times. If the device has been configured for Sleep or
Cycle modes (refer Sleep Mode section of this manual) the device will stay awake for 5 seconds after
each restart allowing you time to cancel sleep mode if you wish. The device will also send STARTED-- to
the serial port on startup. Allow the device to complete the 5 second startup sequence before interacting
with the device.
The RESET command must be sent during the 5 second startup sequence. The RSET command does
not follow the a99AAAAAAAAA message format. Only send “RESET” to the serial port of the device
during startup and then the device will reset back to factory settings.
Use the CYCLE command to put a device to sleep in a cyclic temperature sleep mode. The device will
awaken every INTVL minutes and send a temperature reading and then go back to sleep.
You can also put the device to sleep using the SLEEP command. If the device was put to sleep using the
SLEEP command and INTVL is non zero then the device will awaken every INTVL minutes and transmit
the button state (STATEON-- or STATEOFF-) and then go back to sleep.
Regardless of how the device was put to sleep (CYCLE or SLEEP) it will awaken if the button switch is
triggered and it will transmit BUTTONON- or BUTTONOFF. This feature allows you to use a sensor node
as a temperature sens and a button sensor at the same time.
When a device is asleep then you cannot communicate with it as it will not accept incoming messages
from the radio.
Note: A sensor will only last 20 minutes on a coin cell battery when not asleep.
The device will transmit AWAKE when a device awakens.