Fanstel SE840F User manual

SE840F/X, SE832AF Open Source Wireless Sensors Draft Ver 0.50 June 2019
OpenSource with Market Ready Enclosure!
SE840F/X sensors support Bluetooth 5, Thread, or Zigbee
radio protocols. They are in market ready enclosure and
pre-certified. OpenSource codes are available to expedite
your firmware development.
BT840F is designed to have minimum production cost. A
Tag Connect cable is required for programming. A
development kit (DK) shall be used for development. DKs
are recommended for low volume deployment.
SE832AF-210 BLE 5 Sensor!
SE832AF integrates BT832AF
Bluetooth 5 module with AMS
ENS210 temperature and humidity
sensor. It is a low power, low cost,
long range sensor.m
SE840F-210 BLE 5, Thread, Zigbee Sensor!
SE840F integrates a long-range module BT840F with AMS
ENS210 humidity and temperature sensor.
SE840X-210 BLE 5, Thread, Zigbee Sensor!
Using BT840X with +22.9 dBm TX, BLG832X can
penetrate multiple walls or be used in wide area mesh
applications. Range between 2 BT840X is more than 4500
meters at 125 Kbps.
An AC adapter is included. SE840X is a perfect device to
be used as a long range relay in mesh network.
Miscellaneous!
• Sensor size: 60x60x22 mm.
• Includes a wall mount bracket.
Development Kit!
A Development Kit (DK) includes a 10-pin J-Link
connector and cable. Loading program into a DK is
much easier. We recommend using DKs for small
volume deployment.
Nordic nRF52 Development Environment!
Nordic nRF52 development environment is used to develop
BT832AF, BT840F/X codes. Open source codes are
available
http://www.fanstel.com/download-opensource/
Wireless Sensor Summaries!
SE840F-210
SE840X-210
SE832AF-210
BLE module
BT840F
BT840X
BT832AF
Radio protocols
Bluetooth, Thread, Zigbee
Bluetooth, Thread, Zigbee
Bluetooth
Power supply
2AAA, not included
AC adapter, included
2AAA, not included
FCC
Industrial Canada
QDID
108621
108621
97989
Development kit
SE840F-DK
SE840X-DK
SE832AF-DK
!1

SE840F/X, SE832AF Open Source Wireless Sensors Draft Ver 0.50 June 2019
Table Of Contents
1. Introduction 3........................................................................................................................................................
2. Hardware Description 4........................................................................................................................................
SE832AF-210 4....................................................................................................................................................
SE840F-210 4......................................................................................................................................................
SE840X-210 5......................................................................................................................................................
Development Kit 5................................................................................................................................................
3. Firmware Development and Testing 6..................................................................................................................
Preloaded Firmware 6..........................................................................................................................................
Set up for Programming DK-SE840F 9...............................................................................................................
Set up for Programming SE840F Sensor 9..........................................................................................................
Nordic Development Environment 10...................................................................................................................
Firmware to Control Power Amplifier in SE840X 11.............................................................................................
Revision History 14..................................................................................................................................................
Contact Us 15..........................................................................................................................................................
!2

SE840F/X, SE832AF Open Source Wireless Sensors Draft Ver 0.50 June 2019
1. Introduction
SE840F Series wireless sensors Fanstel long range wireless module BT840F, BT840X, or BT832AF and an AMS
ENS210 temperature and humidity sensors. All products are referred as SE840F Series in this user’s manual.
SE840F integrates BT840F (nRF52840) module with 2300 meter range at 125 Kbps. SE840X integrates BT840X
(nRF52840 + SKY66112 PA) with >4500 meter range at 125 Kbps.
SE832AF uses long range lost cost module, BT832AF. It supports Bluetooth 5 radio protocol but not Thread or
Zigbee.
!3

SE840F/X, SE832AF Open Source Wireless Sensors Draft Ver 0.50 June 2019
2. Hardware Description
The same host board design is used for all wireless sensors and development kits. Additional connector is
installed. 10-pin J-Link cable is included for connection to a Nordic development Kit.
You can load codes into SE840F by using a Tag Connect cable.
You can download DK-SE840F development kit schematics from this webpage.
https://www.fanstel.com/download-opensource
SE840F, SE840X, and SE832AF use the same enclosure and host PCB. The only difference is Bluetooth 5 module
installed. Sensor can be desk mounted. A wall mount bracket in included for wall mounting.
Additional external hardwire features:
• A battery compartment for 2 AAA batteries.
• Two user definable LED indicators, red and blue.
• A micro USB connector for powering sensor
• A push button for OTA DFU.
Size of gateway is 60x60x22mm.
SE832AF-210
SE832AF-210 contains an nRF52810 BLE 5 module BT832AF and an AMS ENS210 temperature and humidity
sensor. It can be powered by 2 AAA batteries (not included). A wall mount bracket is included.
SE840F-210
SE840F-210 contains an nRF52840 BLE 5, Thread, Zigbee module BT840F and an AMS ENS210 temperature
and humidity sensor. It can be powered by 2 AAA batteries (not included). A wall mount bracket is included.
!4

SE840F/X, SE832AF Open Source Wireless Sensors Draft Ver 0.50 June 2019
SE840X-210
SE840X-210 contains an nRF52840 with power amplifier BLE 5, Thread, Zigbee module BT840X and an AMS
ENS210 temperature and humidity sensor. It can be powered by an AC adapter (included). A wall mount bracket is
included.Development Kit Hardware
Development Kit
All development kits AC adapter, USB cable, 10 pin cable, and 10-pin J-link connector. It can be connected easily
with a Nordic DK for programming.
!5

SE840F/X, SE832AF Open Source Wireless Sensors Draft Ver 0.50 June 2019
3. Firmware Development and Testing
Preloaded Firmware
SE840F-210 included temperature and humidity sensor ENS210. The device is preloaded with ENS210 driver.
After powering up, the device advertises name “Bsensor”.
• Use nRF Connect APP with the device.
• The APP will receive sensor data every 5 seconds in HEX format.
• The following screenshot shows temperature is 24 degrees(byte 12, 0X18 = 24) and humidity is 60 (byte 14,
0X3C = 60).
!6

SE840F/X, SE832AF Open Source Wireless Sensors Draft Ver 0.50 June 2019
SE840F-210 supports thermistor thermometer. Thermistor data are not sent out via the BLE.
User can check the data by RTT viewer.
!7

SE840F/X, SE832AF Open Source Wireless Sensors Draft Ver 0.50 June 2019
When the sensor connected the Fanstel gateway BLG840F or BWG832F, BWG840F.
The gateway will upload the raw data to Fanstel MQTT server.
You can use your Android phone to check the data.
Please download the gateway user guide if you need the detail of sequences for setup gateway.
!8

SE840F/X, SE832AF Open Source Wireless Sensors Draft Ver 0.50 June 2019
Set up for Programming DK-SE840F
10-pin J-Link connector is installed. 10-conductor J-Link cable I included. DK-SE840F can be connected to an
nRF52840DK easily for programming.
Set up for Programming SE840F Sensor
To program BT840F/X module, connect Debug out of PCA10056 (nRF52840DK) to JS3 (Debug in) of DK-
SE840F by a Tag Connect cable TC2050-IDC-NL-050-ALL.
You need to insert 2 AAA batteries into the battery compartment and make sure that sensor PCBA is not
separated from bottom enclosure.
!9

SE840F/X, SE832AF Open Source Wireless Sensors Draft Ver 0.50 June 2019
Nordic Development Environment
Nordic Semiconductor provides a complete range of hardware and software development tools for the nRF52
Series devices. nRF52 DK board is recommended for firmware development. Document and Software
development tools can be downloaded by the following links.
Get start with Nordic chip and all online documents.
http://infocenter.nordicsemi.com/index.jsp?topic=/com.nordic.infocenter.nrf52/dita/nrf52/
development/nrf52_dev_kit.html&cp=1_1
Nordic SDK with many example projects.
https://developer.nordicsemi.com/nRF5_SDK/
Nordic development zone. You can search or ask a question there.
https://devzone.nordicsemi.com/tutorials/b/getting-started/posts/development-with-gcc-and-
eclipse
Programming the Nordic chip
Download and install Nrf5x-Command-Line Tools
https://www.nordicsemi.com/eng/nordic/Products/nRF52840/nRF5x-Command-Line-Tools-
Win32/58850
Download and install nRF Connect
https://www.nordicsemi.com/?sc_itemid={B935528E-8BFA-42D9-8BB5-83E2A5E1FF5C}!
!10

SE840F/X, SE832AF Open Source Wireless Sensors Draft Ver 0.50 June 2019
Firmware to Control Power Amplifier in SE840X
The following codes are used to set up and control power amplifier SKY66112 in SE840X. Codes can be
downloaded from:
https://www.fanstel.com/download-document
Header files
#ifndef PA_LNA_H__
#define PA_LNA_H__
#include "ble.h"
#include "app_error.h"
#include "nrf_drv_gpiote.h"
#include "nrf_drv_ppi.h"
void pa_lna_init(uint32_t gpio_pa_pin, uint32_t gpio_lna_pin);
#endif
Main program.
#include "pa_lna.h"
#define APP_PA_LAN
#ifdef APP_PA_LAN
#define APP_PA_PIN 17
#define APP_LNA_PIN 19
#define APP_CHL_PIN!8
#define APP_CPS_PIN!6
int main(void)
{
....
#ifdef APP_PA_LAN!
!nrf_gpio_cfg_output(APP_CPS_PIN);
!nrf_gpio_cfg_output(APP_CHL_PIN);
!nrf_gpio_pin_set(APP_CHL_PIN);
!nrf_gpio_pin_clear(APP_CPS_PIN); //enable
!pa_lna_init(APP_PA_PIN,APP_LNA_PIN);
!11

SE840F/X, SE832AF Open Source Wireless Sensors Draft Ver 0.50 June 2019
#endif!
....
}
SKY66112 control codes.
#include <stdint.h>
#include <string.h>
#include "pa_lna.h"
#include "ble.h"
#include "app_error.h"
#include "nrf_drv_gpiote.h"
#include "nrf_drv_ppi.h"
void pa_lna_init(uint32_t gpio_pa_pin, uint32_t gpio_lna_pin)
{
ble_opt_t opt;
uint32_t gpiote_ch = NULL;
ret_code_t err_code;
memset(&opt, 0, sizeof(ble_opt_t));
err_code = nrf_drv_gpiote_init();
if(err_code != NRF_ERROR_INVALID_STATE)
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_init();
//if(err_code != MODULE_ALREADY_INITIALIZED)
APP_ERROR_CHECK(err_code);
nrf_ppi_channel_t ppi_set_ch;
nrf_ppi_channel_t ppi_clr_ch;
err_code = nrf_drv_ppi_channel_alloc(&ppi_set_ch);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_ppi_channel_alloc(&ppi_clr_ch);
APP_ERROR_CHECK(err_code);
nrf_drv_gpiote_out_config_t config = GPIOTE_CONFIG_OUT_TASK_TOGGLE(false);
if((gpio_pa_pin == NULL) && (gpio_lna_pin == NULL))
{
err_code = NRF_ERROR_INVALID_PARAM;
APP_ERROR_CHECK(err_code);
}
if(gpio_pa_pin != NULL)
!12

SE840F/X, SE832AF Open Source Wireless Sensors Draft Ver 0.50 June 2019
{
if(gpiote_ch == NULL)
{
err_code = nrf_drv_gpiote_out_init(gpio_pa_pin, &config);
APP_ERROR_CHECK(err_code);
gpiote_ch = nrf_drv_gpiote_out_task_addr_get(gpio_pa_pin);
}
// PA config
opt.common_opt.pa_lna.pa_cfg.active_high = 1; // Set the pin to be active high
opt.common_opt.pa_lna.pa_cfg.enable = 1; // Enable toggling
opt.common_opt.pa_lna.pa_cfg.gpio_pin = gpio_pa_pin; // The GPIO pin to toggle tx
}
if(gpio_lna_pin != NULL)
{
if(gpiote_ch == NULL)
{
err_code = nrf_drv_gpiote_out_init(gpio_lna_pin, &config);
APP_ERROR_CHECK(err_code);
gpiote_ch = nrf_drv_gpiote_out_task_addr_get(gpio_lna_pin);
}
// LNA config
opt.common_opt.pa_lna.lna_cfg.active_high = 1; // Set the pin to be active high
opt.common_opt.pa_lna.lna_cfg.enable = 1; // Enable toggling
opt.common_opt.pa_lna.lna_cfg.gpio_pin = gpio_lna_pin; // The GPIO pin to toggle rx
}
// Common PA/LNA config
opt.common_opt.pa_lna.gpiote_ch_id = (gpiote_ch - NRF_GPIOTE_BASE) >> 2; // GPIOTE channel used for
radio pin toggling
opt.common_opt.pa_lna.ppi_ch_id_clr = ppi_clr_ch; // PPI channel used for radio pin clearing
opt.common_opt.pa_lna.ppi_ch_id_set = ppi_set_ch; // PPI channel used for radio pin setting
err_code = sd_ble_opt_set(BLE_COMMON_OPT_PA_LNA, &opt);
APP_ERROR_CHECK(err_code);
}
!13

SE840F/X, SE832AF Open Source Wireless Sensors Draft Ver 0.50 June 2019
Revision History
• June 2019, Ver. 0.50: Initial draft release
!14

SE840F/X, SE832AF Open Source Wireless Sensors Draft Ver 0.50 June 2019
Contact Us
United States:
Fanstel Corp.
7466 E. Monte Cristo Ave. Scottsdale AZ 85260
Tel. 1 480-948-4928
Fax. 1-480-948-5459
Website: www.fanstel.com
Taiwan:
Fanstel Corp.
10F-10, 79 Xintai Wu Road
Xizhu, New Taipei City, Taiwan 22101
泛世公司
臺灣省新北市汐止區新臺五路79號10樓之10, 22101
Tel. 886-2-2698-9328
Fax. 886-2-2698-4813
Website: www.fanstel.com
China:
Fanstel Technologies Corp.
11 Jiale Street
Ping-Dih, Long-Gang, Shen Zhen, GD 518117
泛世康科技(深圳)有限公司
廣東省深圳市龍崗區坪地鎮佳樂街11號
Tel. 86-755-8409-0928
Fax. 86-755-8409-0973
QQ. 3076221086
Website: www.fanstel.com
!15
This manual suits for next models
2
Table of contents