Table of Contents:
- 1. Introduction
- 2. Use SDI-12-NB to communicate with IoT Server
- 2.1 Send data to IoT server via NB-IoT network
- 2.2 Payload Types
- 2.3 SDI-12 Related Commands
- 2.4 Uplink Payload
- 2.5 Examples To Set SDI commands
- 2.6 Test Uplink and Change Update Interval
- 2.7 Multi-Samplings and One uplink
- 2.8 Trggier an uplink by external interrupt
- 2.9 Set the output time
- 2.10 Set the all data mode
- 2.11 Set the splicing payload for uplink
- 2.12 Set the payload version
- 3. Configure SDI-12-NB
- 4. Battery & Power Consumption
- 5. Firmware update
- 6. FAQ
- 7. Order Info
- 8. Packing Info
- 9. Support
1. Introduction
1.1 What is SDI-12 to NB-IoT Converter
The Dragino SDI-12-NB is a SDI-12 to NB-IoT Converter designed for Smart Agriculture solution.
SDI-12 (Serial Digital Interface at 1200 baud) is an asynchronous serial communications protocol for intelligent sensors that monitor environment data. SDI-12 protocol is widely used in Agriculture sensor and Weather Station sensors.
SDI-12-NB has SDI-12 interface and support 12v output to power external SDI-12 sensor. It can get the environment data from SDI-12 sensor and sends out the data via NB-IoT wireless protocol.
SDI-12-NB supports different uplink methods including MQTT, MQTTs, UDP & TCP for different application requirement, and support uplinks to various IoT Servers.
SDI-12-NB supports BLE configure and OTA update which make user easy to use.
SDI-12-NB is powered by 8500mAh Li-SOCI2 battery, it is designed for long-term use up to several years.
SDI-12-NB has optional built-in SIM card and default IoT server connection version. Which makes it works with simple configuration.
1.2 Features
- NB-IoT Bands: B1/B2/B3/B4/B5/B8/B12/B13/B17/B18/B19/B20/B25/B28/B66/B70/B85 @H-FDD
- Ultra-low power consumption
- Controllable 3.3v, 5v and 12v output to power external sensor
- SDI-12 Protocol to connect to SDI-12 Sensor
- Multiply Sampling and one uplink
- Support Bluetooth v5.1 remote configure and update firmware
- Uplink on periodically
- Downlink to change configure
- 8500mAh Battery for long term use
- Uplink via MQTT, MQTTs, TCP, or UDP
- Nano SIM card slot for NB-IoT SIM
1.3 Specification
Common DC Characteristics:
- Supply Voltage: 2.5v ~ 3.6v
- Support current: 5V 300mA, 12V 100mA
- Operating Temperature: -40 ~ 85°C
Current Input (DC) Measuring :
- Range: 0 ~ 20mA
- Accuracy: 0.02mA
- Resolution: 0.001mA
Voltage Input Measuring:
- Range: 0 ~ 30v
- Accuracy: 0.02v
- Resolution: 0.001v
NB-IoT Spec:
NB-IoT Module: BC660K-GL
Support Bands:
- B1 @H-FDD: 2100MHz
- B2 @H-FDD: 1900MHz
- B3 @H-FDD: 1800MHz
- B4 @H-FDD: 2100MHz
- B5 @H-FDD: 860MHz
- B8 @H-FDD: 900MHz
- B12 @H-FDD: 720MHz
- B13 @H-FDD: 740MHz
- B17 @H-FDD: 730MHz
- B18 @H-FDD: 870MHz
- B19 @H-FDD: 870MHz
- B20 @H-FDD: 790MHz
- B25 @H-FDD: 1900MHz
- B28 @H-FDD: 750MHz
- B66 @H-FDD: 2000MHz
- B70 @H-FDD: 2000MHz
- B85 @H-FDD: 700MHz
Battery:
- Li/SOCI2 un-chargeable battery
- Capacity: 8500mAh
- Self Discharge: <1% / Year @ 25°C
- Max continuously current: 130mA
- Max boost current: 2A, 1 second
Power Consumption
- STOP Mode: 10uA @ 3.3v
- Max transmit power: 350mA@3.3v
1.4 Connect to SDI-12 Sensor
1.5 Sleep mode and working mode
Deep Sleep Mode: Sensor doesn't have any NB-IoT activate. This mode is used for storage and shipping to save battery life.
Working Mode: In this mode, Sensor will work as NB-IoT Sensor to Join NB-IoT network and send out sensor data to server. Between each sampling/tx/rx periodically, sensor will be in IDLE mode), in IDLE mode, sensor has the same power consumption as Deep Sleep mode.
1.6 Button & LEDs
Behavior on ACT | Function | Action |
---|---|---|
Pressing ACT between 1s < time < 3s | Send an uplink | If sensor has already attached to NB-IoT network, sensor will send an uplink packet, blue led will blink once. |
Pressing ACT for more than 3s | Active Device | Green led will fast blink 5 times, device will enter OTA mode for 3 seconds. And then start to attach NB-IoT network. |
Fast press ACT 5 times. | Deactivate Device | Red led will solid on for 5 seconds. Means device is in Deep Sleep Mode. |
Note: When the device is executing a program, the buttons may become invalid. It is best to press the buttons after the device has completed the program execution.
1.7 BLE connection
SDI-12-NB support BLE remote configure and firmware update.
BLE can be used to configure the parameter of sensor or see the console output from sensor. BLE will be only activate on below case:
- Press button to send an uplink
- Press button to active device.
- Device Power on or reset.
If there is no activity connection on BLE in 60 seconds, sensor will shut down BLE module to enter low power mode.
1.8 Pin Definitions & Switch
SDI-12-NB use the mother board which as below.
1.8.1 Jumper JP2
Power on Device when put this jumper.
1.8.2 BOOT MODE / SW1
1) ISP: upgrade mode, device won't have any signal in this mode. but ready for upgrade firmware. LED won't work. Firmware won't run.
2) Flash: work mode, device starts to work and send out console output for further debug
1.8.3 Reset Button
Press to reboot the device.
1.9 Mechanical
2. Use SDI-12-NB to communicate with IoT Server
2.1 Send data to IoT server via NB-IoT network
The SDI-12-NB is equipped with a NB-IoT module, the pre-loaded firmware in SDI-12-NB will get environment data from sensors and send the value to local NB-IoT network via the NB-IoT module. The NB-IoT network will forward this value to IoT server via the protocol defined by SDI-12-NB.
Below shows the network structure:
There are two version: -GE and -1D version of SDI-12-NB.
GE Version: This version doesn't include SIM card or point to any IoT server. User needs to use AT Commands to configure below two steps to set SDI-12-NB send data to IoT server.
- Install NB-IoT SIM card and configure APN. See instruction of Attach Network.
- Set up sensor to point to IoT Server. See instruction of Configure to Connect Different Servers.
Below shows result of different server as a glance.
Servers | Dash Board | Comments |
Node-Red | ||
DataCake | ||
Tago.IO | ||
General UDP | Raw Payload. Need Developer to design Dash Board | |
General MQTT | Raw Payload. Need Developer to design Dash Board | |
ThingSpeak | ||
ThingsBoard |
1D Version: This version has 1NCE SIM card pre-installed and configure to send value to DataCake. User Just need to select the sensor type in DataCake and Activate SDI-12-NB and user will be able to see data in DataCake. See here for DataCake Config Instruction.
2.2 Payload Types
To meet different server requirement, SDI-12-NB supports different payload type.
Includes:
- General JSON format payload. (Type=5)
- HEX format Payload. (Type=0)
- ThingSpeak Format. (Type=1)
- ThingsBoard Format. (Type=3)
User can specify the payload type when choose the connection protocol. Example:
AT+PRO=2,0 // Use UDP Connection & hex Payload
AT+PRO=2,5 // Use UDP Connection & Json Payload
AT+PRO=3,0 // Use MQTT Connection & hex Payload
AT+PRO=3,1 // Use MQTT Connection & ThingSpeak
AT+PRO=3,3 // Use MQTT Connection & ThingsBoard
AT+PRO=3,5 // Use MQTT Connection & Json Payload
AT+PRO=4,0 // Use TCP Connection & hex Payload
AT+PRO=4,5 // Use TCP Connection & Json Payload
2.2.1 General Json Format(Type=5)
This is the General Json Format. As below:
{"IMEI":"866207053462705","Model":"SDI-12-NB","idc_intput":0.000,"vdc_intput":0.000,"battery":3.513,"signal":23,"1":{0.000,5.056,2023/09/13 02:14:41},"2":{0.000,3.574,2023/09/13 02:08:20},"3":{0.000,3.579,2023/09/13 02:04:41},"4":{0.000,3.584,2023/09/13 02:00:24},"5":{0.000,3.590,2023/09/13 01:53:37},"6":{0.000,3.590,2023/09/13 01:50:37},"7":{0.000,3.589,2023/09/13 01:47:37},"8":{0.000,3.589,2023/09/13 01:44:37}}
Notice, from above payload:
- Idc_input , Vdc_input , Battery & Signal are the value at uplink time.
- Json entry 1 ~ 8 are the last 1 ~ 8 sampling data as specify by AT+NOUD=8 Command. Each entry includes (from left to right): Idc_input , Vdc_input, Sampling time.
2.2.2 HEX format Payload(Type=0)
This is the HEX Format. As below:
f866207053462705 0165 0dde 13 0000 00 00 00 00 0fae 0000 64e2d74f 10b2 0000 64e2d69b 0fae 0000 64e2d5e7 10b2 0000 64e2d47f 0fae 0000 64e2d3cb 0fae 0000 64e2d263 0fae 0000 64e2d1af 011a 01e8 64d494ed 0118 01e8 64d4943
Version:
These bytes include the hardware and software version.
Higher byte: Specify Sensor Model: 0x16 for SDI-12-NB
Lower byte: Specify the software version: 0x65=101, means firmware version 1.0.1
BAT (Battery Info):
Check the battery voltage for SDI-12-NB.
Ex1: 0x0dde = 3550mV
Ex2: 0x0B49 = 2889mV
Signal Strength:
NB-IoT Network signal Strength.
Ex1: 0x13 = 19
0 -113dBm or less
1 -111dBm
2...30 -109dBm... -53dBm
31 -51dBm or greater
99 Not known or not detectable
Probe Model:
SDI-12-NB might connect to different kind of probes, 4~20mA represent the full scale of the measuring range. So a 12mA output means different meaning for different probe.
For example.
Probe Type | 4~20mA scale for this probe | Example: 12mA actually meaning for this probe |
PH Combination Electrodes | 0 ~ 14 pH | PH Value: 7 |
Water Pressure Sensor | 0~5 meters | 2.5 meters pure water |
Pressure transmitter probe | 0~1MPa | 0.5MPa air / gas or water pressure |
User can set different probe model for above probes. So IoT server is able to se identical how it should parse the 4~20mA or 0~30v sensor value and get the correct value.
IN1 & IN2:
IN1 and IN2 are used as Digital input pins.
Example:
01 (H): IN1 or IN2 pin is high level.
00 (L): IN1 or IN2 pin is low level.
GPIO_EXTI Level:
GPIO_EXTI is used as Interrupt Pin.
Example:
01 (H): GPIO_EXTI pin is high level.
00 (L): GPIO_EXTI pin is low level.
GPIO_EXTI Flag:
This data field shows if this packet is generated by Interrupt Pin or not.
Note: The Interrupt Pin is a separate pin in the screw terminal.
Example:
0x00: Normal uplink packet.
0x01: Interrupt Uplink Packet.
0~20mA:
Example:
27AE(H) = 10158 (D)/1000 = 10.158mA.
Connect to a 2 wire 4~20mA sensor.
0~30V:
Measure the voltage value. The range is 0 to 30V.
Example:
138E(H) = 5006(D)/1000= 5.006V
TimeStamp:
Unit TimeStamp Example: 64e2d74f(H) = 1692587855(D)
Put the decimal value into this link(https://www.epochconverter.com))to get the time.
2.2.3 ThingsBoard Payload(Type=3)
Type3 payload special design for ThingsBoard, it will also configure other default server to ThingsBoard.
{"IMEI": "866207053462705","Model": "SDI-12-NB","idc_intput": 0.0,"vdc_intput": 3.577,"battery": 3.55,"signal": 22}
2.2.4 ThingSpeak Payload(Type=1)
This payload meets ThingSpeak platform requirement. It includes only four fields. Form 1~4 are:
Idc_input , Vdc_input , Battery & Signal. This payload type only valid for ThingsSpeak Platform
As below:
field1=idc_intput value&field2=vdc_intput value&field3=battery value&field4=signal value
2.3 SDI-12 Related Commands
User need to configure SDI-12-NB to communicate with SDI-12 sensors otherwise the uplink payload will only include a few bytes.
2.3.1 Basic SDI-12 debug command
User can run some basic SDI-12 command to debug the connection to the SDI-12 sensor. These commands can be sent via AT Command or NB-IoT downlink command.
If SDI-12 sensor return value after get these commands, SDI-12-NB will uplink the return on FPORT=100, otherwise, if there is no response from SDI-12 sensor. SDI-12-NB will uplink NULL (0x 4E 55 4C 4C) to server.
The following is the display information on the serial port and the server.
al! -- Get SDI-12 sensor Identification
- AT Command: AT+ADDRI=aa
- NB-IoT Downlink(prefix 0xAA00): AA 00 aa
Parameter: aa: ASCII value of SDI-12 sensor address in downlink or HEX value in AT Command)
Example : AT+ADDRI=0 ( Equal to downlink: 0x AA 00 30)
The following is the display information on the serial port and the server.
aM!,aMC!, aM1!- aM9!, aMC1!- aMC9!
aM! : Start Non-Concurrent Measurement
aMC! : Start Non-Concurrent Measurement – Request CRC
aM1!- aM9! : Additional Measurements
aMC1!- aMC9! : Additional Measurements – Request CRC
- AT Command : AT+ADDRM=0,1,0,1
- NB-IoT Downlink(prefix 0xAA01): 0xAA 01 30 01 00 01
Downlink:AA 01 aa bb cc dd
aa: SDI-12 sensor address.
bb: 0: no CRC, 1: request CRC
cc: 1-9: Additional Measurement, 0: no additional measurement
dd: delay (in second) to send aD0! to get return.
The following is the display information on the serial port and the server.
aC!, aCC!, aC1!- aC9!, aCC1!- aCC9!
aC! : Start Concurrent Measurement
aCC! : Start Concurrent Measurement – Request CRC
aC1!- aC9! : Start Additional Concurrent Measurements
aCC1!- aCC9! : Start Additional Concurrent Measurements – Request CRC
- AT Command : AT+ADDRC=0,1,0,1
- Downlink(0xAA02): 0xAA 02 30 01 00 01
Downlink: AA 02 aa bb cc dd
aa: SDI-12 sensor address.
bb: 0: no CRC, 1: request CRC
cc: 1-9: Additional Measurement, 0: no additional measurement
dd: delay (in second) to send aD0! to get return.
The following is the display information on the serial port and the server.
aR0!- aR9!, aRC0!- aRC9!
Start Continuous Measurement
Start Continuous Measurement – Request CRC
- AT Command : AT+ADDRR=0,1,0,1
- Downlink (0xAA 03): 0xAA 03 30 01 00 01
Downlink: AA 03 aa bb cc dd
aa: SDI-12 sensor address.
bb: 0: no CRC, 1: request CRC
cc: 1-9: Additional Measurement, 0: no additional measurement
dd: delay (in second) to send aD0! to get return.
The following is the display information on the serial port and the server.
2.3.2 Advance SDI-12 Debug command
This command can be used to debug all SDI-12 command.
Downlink: A8 aa xx xx xx xx bb cc dd
aa : total SDI-12 command length
xx : SDI-12 command
bb : Delay to wait for return
cc : 0: don't uplink return to NB-IoT, 1: Uplink return to NB-IoT on FPORT=100
dd: 0: Do not use aD0! command access, 1: use aD0! command access.
Example1: AT+CFGDEV =0RC0!,1
0RC0! : SDI-12 Command,
1 : Delay 1 second. ( 0: 810 mini-second)
Equal Downlink: 0xA8 05 30 52 43 30 21 01 01
The following is the display information on the serial port and the server.
Example2: AT+CFGDEV =0M!,1,1
0M! : SDI-12 Command,
1 : Delay 1 second. ( 0: 810 mini-second)
1 : Use aD0! command access.
Equal Downlink: 0xA8 03 30 4D 21 01 01 01
The following is the display information on the serial port and the server.
2.3.3 Convert ASCII to String
This command is used to convert between ASCII and String format.
AT+CONVFORM ( Max length: 80 bytes)
Example:
1) AT+CONVFORM=0, string Convert String from String to ASCII
2) AT+CONVFORM=1, ASCII Convert ASCII to String.
2.3.4 Define periodically SDI-12 commands and uplink.
AT+COMMANDx & AT+DATACUTx
User can define max 15 SDI-12 Commands (AT+COMMAND1 ~ AT+COMMANDF). On each uplink period (TDC time, default 20 minutes), SDI-12-NB will send these SDI-12 commands and wait for return from SDI-12 sensors. SDI-12-NB will then combine these returns and uplink via NB-IoT.
- AT Command:
AT+COMMANDx=var1,var2,var3,var4.
var1: SDI-12 command , for example: 0RC0!
var2: Wait timeout for return. (unit: second)
var3: Whether to send addrD0! to get return after var2 timeout. 0: Don't Send addrD0! ; 1: Send addrD0!.
var4: validation check for return. If return invalid, SDI-12-NB will resend this command. Max 3 retries.
0 No validation check;
1 Check if return chars are printable char(0x20 ~ 0x7E);
2 Check if there is return from SDI-12 sensor
3 Check if return pass CRC check ( SDI-12 command var1 must include CRC request);
Each AT+COMMANDx is followed by a AT+DATACUT command. AT+DATACUT command is used to take the useful string from the SDI-12 sensor so the final payload will have the minimum length to uplink.
AT+DATACUTx : This command defines how to handle the return from AT+COMMANDx, max return length is 100 bytes.
AT+DATACUTx=a,b,c a: length for the return of AT+COMMAND b: 1: grab valid value by byte, max 6 bytes. 2: grab valid value by bytes section, max 3 sections. c: define the position for valid value. |
For example, if return from AT+COMMAND1 is “013METER TER12 112T12-00024895<CR><LF>” , Below AT+DATACUT1 will get different result to combine payload:
AT+DATACUT1 value | Final Result to combine Payload |
---|---|
34,1,1+2+3 | 0D 00 01 30 31 33 |
34,2,1~8+12~16 | 0D 00 01 30 31 33 4D 45 54 45 52 54 45 52 31 32 |
34,2,1~34 | 0D 00 01 30 31 33 4D 45 54 45 52 20 20 20 54 45 52 31 32 20 31 31 32 54 31 32 2D 30 30 30 32 34 38 39 35 0D 0A |
- Downlink Payload:
0xAF downlink command can be used to set AT+COMMANDx or AT+DATACUTx.
Note : if user use AT+COMMANDx to add a new command, he also need to send AT+DATACUTx downlink.
Format: AF MM NN LL XX XX XX XX YY
Where:
- MM : the AT+COMMAND or AT+DATACUT to be set. Value from 01 ~ 0F,
- NN : 1: set the AT+COMMAND value ; 2: set the AT+DATACUT value.
- LL : The length of AT+COMMAND or AT+DATACUT command
- XX XX XX XX : AT+COMMAND or AT+DATACUT command
- YY : If YY=0, SDI-12-NB will execute the downlink command without uplink; if YY=1, SDI-12-NB will execute an uplink after got this command.
Example:
Clear SDI12 Command
The AT+COMMANDx and AT+DATACUTx settings are stored in special location, user can use below command to clear them.
- AT Command:
AT+CMDEAR=mm,nn mm: start position of erase ,nn: stop position of erase
Etc. AT+CMDEAR=1,10 means erase AT+COMMAND1/AT+DATACUT1 to AT+COMMAND10/AT+DATACUT10
- Downlink Payload:
0x09 aa bb same as AT+CMDEAR=aa,bb
command combination
Below shows a screen shot how the results combines together to a uplink payload.
If user don't want to use DATACUT for some command, he simply want to uplink all returns. AT+ALLDATAMOD can be set to 1.
AT+ALLDATAMOD will simply get all return and don't do CRC check as result for SDI-12 command. AT+DATACUTx command has higher priority, if AT+DATACUTx has been set, AT+ALLDATAMOD will be ignore for this SDI-12 command.
For example: as below photo, AT+ALLDATAMOD=1, but AT+DATACUT1 has been set, AT+DATACUT1 will be still effect the result.
If AT+ALLDATAMOD=1, FX,X will be added in the payload, FX specify which command is used and X specify the length of return. for example in above screen, F1 05 means the return is from AT+COMMAND1 and the return is 5 bytes.
Compose Uplink
AT+DATAUP=0
Compose the uplink payload with value returns in sequence and send with A SIGNLE UPLINK.
Final Payload is Battery Info+PAYVER + VALID Value from RETURN1 + Valid Value from RETURN2 + … + RETURNx
Where PAYVER is defined by AT+PAYVER, below is an example screen shot.
AT+DATAUP=1
Compose the uplink payload with value returns in sequence and send with Multiply UPLINKs.
Final Payload is Battery Info+PAYVER + PAYLOAD COUNT + PAYLOAD# + DATA
- Battery Info (2 bytes): Battery voltage
- PAYVER (1 byte): Defined by AT+PAYVER
- PAYLOAD COUNT (1 byte): Total how many uplinks of this sampling.
- PAYLOAD# (1 byte): Number of this uplink. (from 0,1,2,3…,to PAYLOAD COUNT)
- DATA: Valid value: max 6 bytes(US915 version here, Notice*!) for each uplink so each uplink <= 11 bytes. For the last uplink, DATA will might less than 6 bytes
Notice: the Max bytes is according to the max support bytes in different Frequency Bands for lowest SF. As below:
- For AU915/AS923 bands, if UplinkDwell time=0, max 51 bytes for each uplink ( so 51 -5 = 46 max valid date)
- For AU915/AS923 bands, if UplinkDwell time=1, max 11 bytes for each uplink ( so 11 -5 = 6 max valid date).
- For US915 band, max 11 bytes for each uplink ( so 11 -5 = 6 max valid date).
- For all other bands: max 51 bytes for each uplink ( so 51 -5 = 46 max valid date).
When AT+DATAUP=1, the maximum number of segments is 15, and the maximum total number of bytes is 1500;
When AT+DATAUP=1 and AT+ADR=0, the maximum number of bytes of each payload is determined by the DR value.
2.4 Uplink Payload
2.4.1 Uplink Payload, FPORT=2
There are different cases for uplink. See below
- SDI-12 Debug Command return: FPORT=100
- Periodically Uplink: FPORT=2
Size(bytes) | 2 | 1 | Length depends on the return from the commands |
---|---|---|---|
Value | Battery(mV) | PAYLOAD_VER | If the valid payload is too long and exceed the maximum support. |
Battery Info:
Check the battery voltage for SDI-12-NB.
Ex1: 0x0B45 = 2885mV
Ex2: 0x0B49 = 2889mV
Interrupt Pin:
This data field shows if this packet is generated by Interrupt Pin or not.
Example:
Ex1: 0x0B45:0x0B&0x80= 0x00 Normal uplink packet.
Ex2: 0x8B49:0x8B&0x80= 0x80 Interrupt Uplink Packet.
Payload version:
The version number of the payload, mainly used for decoding. The default is 16
2.5 Examples To Set SDI commands
2.5.1 Examples 1 -- General Example
COM port and SDI-12 sensor communication converted to SDI-12-NB and SDI-12 sensor communication.
1) The AT+COMMANDx command is applied to the red arrow part, and sends the SDI12 command to the SDI12 sensor:
a. Send the first command and get the first reply:
AT+COMMANDx=1I!,0,0,1
b. Send the second command and get the second reply:
AT+COMMANDx=2I!,0,0,1
c. Send the third command and get the third reply:
AT+COMMANDx=3I!,0,0,1
d. Send the fourth command and get the fourth reply:
AT+COMMANDx=4I!,0,0,1
e. Send the fifth command plus the sixth command, get the sixth reply:
AT+COMMANDx=1M!,2,1,1
f. Send the seventh command plus the eighth command, get the eighth reply:
AT+COMMANDx=2M!,2,1,1
g. Send the ninth command plus the tenth command, get the tenth reply:
AT+COMMANDx=3M!,1,1,1
h. Send the eleventh command plus the twelfth command, get the twelfth reply:
AT+COMMANDx=4M!,1,1,1
2) The AT+DATACUTx command is applied to the green arrow part, receiving and cut out data from the SDI12 sensor:
a. The first reply, all 34 characters: ”113TRUEBNERSMT100038220303182331<CR><LF>”
Cut out all characters: AT+ALLDATAMOD=1 or AT+DATACUTx=34,2,1~34;
b. The sixth reply, all 31 characters:”1+19210+1.04+0.00+22.49+11.75<CR><LF>”
Cut out all characters: AT+ALLDATAMOD=1 or AT+DATACUTx=31,2,1~31;
c. The eighth reply, all 31 characters:”2+18990+1.08+0.00+22.24+11.80<CR><LF>”
Cut out all characters: AT+ALLDATAMOD=1 or AT+DATACUTx=31,2,1~31;
d. The tenth reply, all 15 characters:”3-2919.8+24.0<CR><LF>”
Cut out all characters: AT+ALLDATAMOD=1 or AT+DATACUTx=15,2,1~15;
e. The twelfth reply, all 25 characters:”4+30.8+22.84+4.7+954.38<CR><LF>”
Partial cut, the cut sensor address and the first two parameters:AT+DATACUTx=25,2,1~12, cut out the character field ” 4+30.8+22.84”.
2.5.2 Example 2 -- Connect to Hygrovue10
2.5.2.1 Reference Manual and Command
- Commands to be used in PC and output.
1. check device address
2. change device address
3. check device ID
4. start measure
5. Get Meausre result
2.5.2.2 Hardware Connection to SDI-12-NB
2.5.2.3 Commands set in SDI-12-NB and uplink payload
Data in TTN:
2.5.3 Example 3 -- Connect to SIL-400
2.5.3.1 Reference Manual and Command
- Commands to be used in PC and output.
1. check device address
2. change device address
3. check device ID
4. start measure
5. Get Meausre result
2.5.3.2 Hardware Connection to SDI-12-NB
2.5.3.3 Commands set in SDI-12-NB and uplink payload
Data in TTN:
2.5.4 Example 4 -- Connect to TEROS-12
2.5.4.1 Reference Manual and Command
- Commands to be used in PC and output.
1.check device address
2.change device address
3.check device ID
4.start measure
5.Get Meausre result
2.5.4.2 Hardware Connection to SDI-12-NB
2.6.4.3 Commands set in SDI-12-NB and uplink payload
Data in TTN:
2.5.5 Example 5 -- Connect to SIL-400/TEROS-12 & Hygrovue10
2.5.5.1 Important Notice!
- The product page and reference command see above example 2,3,4
- All of these SDI-12 sensors use the same address (address 0) by default. So we need to change their address to different address, by using aAb! command. See above example.
- The sensor needs to be powered to a steady statue. So the 12VT time need to be set to the maximum stable time for the sensors. in this example, it is 13 seconds.
- If these SDI-12 sensors are powered by external power source. It will add 300uA in the total current in SDI-12-NB.
2.5.5.2 Hardware Connection to SDI-12-NB
2.5.5.3 Commands set in SDI-12-NB and uplink payload
Data in TTN:
2.5.6 Example 6 -- Connect to ENTELECHY-EP_SDI-12
2.5.6.1 Reference Manual and Command
- Commands to be used in PC and output.
1.check device address
2.change device address
3.check device ID
4.start measure
5.Get Meausre result
2.5.6.2 Hardware Connection to SDI-12-NB
2.5.6.3 Commands set in SDI-12-NB and uplink payload
Data in TTN:
2.6 Test Uplink and Change Update Interval
By default, Sensor will send uplinks every 2 hours & AT+NOUD=8
User can use below commands to change the uplink interval.
AT+TDC=600 // Set Update Interval to 600s
User can also push the button for more than 1 seconds to activate an uplink.
2.7 Multi-Samplings and One uplink
To save battery life, SDI-12-NB will sample Idc_input & Vdc_input data every 15 minutes and send one uplink every 2 hours. So each uplink it will include 8 stored data + 1 real-time data. They are defined by:
- AT+TR=900 // The unit is seconds, and the default is to record data once every 900 seconds (15 minutes, the minimum can be set to 180 seconds)
- AT+NOUD=8 // The device uploads 8 sets of recorded data by default. Up to 32 sets of record data can be uploaded.
The diagram below explains the relationship between TR, NOUD, and TDC more clearly:
2.8 Trggier an uplink by external interrupt
SDI-12-NB has an external trigger interrupt function. Users can use the GPIO_EXTI pin to trigger the upload of data packets.
AT command:
- AT+INTMOD // Set the trigger interrupt mode
- AT+INTMOD=0 // Disable Interrupt,as a digital input pin
- AT+INTMOD=1 // Trigger by rising and falling edge
- AT+INTMOD=2 // Trigger by falling edge
- AT+INTMOD=3 // Trigger by rising edge
2.9 Set the output time
Feature, Control the output 3V3 , 5V or 12V.
AT Command: AT+3V3T
Command Example | Function | Response |
---|---|---|
AT+3V3T=? | Show 3V3 open time. | 0 |
AT+3V3T=0 | Normally open 3V3 power supply. | OK |
AT+3V3T=1000 | Close after a delay of 1000 milliseconds. | OK |
AT+3V3T=65535 | Normally closed 3V3 power supply. | OK |
AT Command: AT+5VT
Command Example | Function | Response |
---|---|---|
AT+5VT=? | Show 5V open time. | 0 |
AT+5VT=0 | Normally closed 5V power supply. | OK |
AT+5VT=1000 | Close after a delay of 1000 milliseconds. | OK |
AT+5VT=65535 | Normally open 5V power supply. | OK |
AT Command: AT+12VT
Command Example | Function | Response |
---|---|---|
AT+12VT=? | Show 12V open time. | 0 |
AT+12VT=0 | Normally closed 12V power supply. | OK |
AT+12VT=500 | Close after a delay of 500 milliseconds. | OK |
Downlink Command: 0x07
Format: Command Code (0x07) followed by 3 bytes.
The first byte is which power, the second and third bytes are the time to turn on.
- Example 1: Downlink Payload: 070101F4 ---> AT+3V3T=500
- Example 2: Downlink Payload: 0701FFFF ---> AT+3V3T=65535
- Example 3: Downlink Payload: 070203E8 ---> AT+5VT=1000
- Example 4: Downlink Payload: 07020000 ---> AT+5VT=0
- Example 5: Downlink Payload: 070301F4 ---> AT+12VT=500
- Example 6: Downlink Payload: 07030000 ---> AT+12VT=0
2.10 Set the all data mode
Feature, Set the all data mode.
AT Command: AT+ALLDATAMOD
Command Example | Function | Response |
---|---|---|
AT+ALLDATAMOD=? | Show current all data mode | 0 |
AT+ALLDATAMOD=1 | Set all data mode is 1. | OK |
Downlink Command: 0xAB
Format: Command Code (0xAB) followed by 1 bytes.
- Example 1: Downlink Payload: AB 00 // AT+ALLDATAMOD=0
- Example 2: Downlink Payload: AB 01 // AT+ALLDATAMOD=1
2.11 Set the splicing payload for uplink
Feature, splicing payload for uplink.
AT Command: AT+DATAUP
Command Example | Function | Response |
---|---|---|
AT+DATAUP =? | Show current splicing payload for uplink mode | 0 |
AT+DATAUP =0 | Set splicing payload for uplink mode is 0. | OK |
AT+DATAUP =1 | Set splicing payload for uplink mode is 1 , and the each splice uplink is sent sequentially. | OK |
AT+DATAUP =1,20000 | Set splicing payload for uplink mode is 1, and the uplink interval of each splice to 20000 milliseconds. | OK |
Downlink Command: 0xAD
Format: Command Code (0xAD) followed by 1 bytes or 5 bytes.
- Example 1: Downlink Payload: AD 00 // AT+DATAUP=0
- Example 2: Downlink Payload: AD 01 // AT+DATAUP =1
- Example 3: Downlink Payload: AD 01 00 00 14 // AT+DATAUP =1,20000
This means that the interval is set to 0x000014=20S
2.12 Set the payload version
Feature, Set the payload version.
AT Command: AT+PAYVER
Command Example | Function | Response |
---|---|---|
AT+PAYVER=? | Show current payload version | 1 |
AT+PAYVER=5 | Set payload version is 5. | OK |
Downlink Command: 0xAE
Format: Command Code (0xAE) followed by 1 bytes.
- Example 1: Downlink Payload: AE 01 // AT+PAYVER=1
- Example 2: Downlink Payload: AE 05 // AT+PAYVER=5
3. Configure SDI-12-NB
3.1 Configure Methods
SDI-12-NB supports below configure method:
- AT Command via Bluetooth Connection (Recommended): BLE Configure Instruction.
- AT Command via UART Connection : See UART Connection.
3.2 AT Commands Set
AT+<CMD>? : Help on <CMD>
AT+<CMD> : Run <CMD>
AT+<CMD>=<value> : Set the value
AT+<CMD>=? : Get the value
General Commands
AT : Attention
AT? : Short Help
ATZ : MCU Reset
AT+TDC : Application Data Transmission Interval
AT+CFG : Print all configurations
AT+MODEL :Get module information
AT+SLEEP :Get or set the sleep status
AT+DEUI : Get or set the Device ID
AT+INTMOD : Set the trigger interrupt mode
AT+APN : Get or set the APN
AT+3V3T : Set extend the time of 3V3 power
AT+5VT : Set extend the time of 5V power
AT+12VT : Set extend the time of 12V power
AT+PROBE : Get or Set the probe model
AT+PRO : Choose agreement
AT+RXDL : Extend the sending and receiving time
AT+TR : Get or set data record time
AT+CDP : Read or Clear cached data
AT+NOUD : Get or Set the number of data to be uploaded
AT+DNSCFG : Get or Set DNS Server
AT+CSQTIME : Get or Set the time to join the network
AT+DNSTIMER : Get or Set the NDS timer
AT+TLSMOD : Get or Set the TLS mode
AT+GETSENSORVALUE : Returns the current sensor measurement
AT+SERVADDR : Server Address
UDP Management
AT+CFM : Upload confirmation mode (only valid for UDP)
MQTT Management
AT+CLIENT : Get or Set MQTT client
AT+UNAME : Get or Set MQTT Username
AT+PWD : Get or Set MQTT password
AT+PUBTOPIC : Get or Set MQTT publish topic
AT+SUBTOPIC : Get or Set MQTT subscription topic
Information
AT+FDR : Factory Data Reset
AT+PWORD : Serial Access Password
AT+LDATA : Get the last upload data
AT+CDP : Read or Clear cached data
4. Battery & Power Consumption
SDI-12-NB use ER26500 + SPC1520 battery pack. See below link for detail information about the battery info and how to replace.
Battery Info & Power Consumption Analyze .
5. Firmware update
User can change device firmware to::
- Update with new features.
- Fix bugs.
Firmware and changelog can be downloaded from : Firmware download link
Methods to Update Firmware:
- (Recommended way) OTA firmware update via BLE: Instruction.
- Update through UART TTL interface : Instruction.
6. FAQ
6.1 How can I access t BC660K-GL AT Commands?
User can access to BC660K-GL directly and send AT Commands.
7. Order Info
Part Number: SDI-12-NB-XX-YY
XX:
- GE: General version ( Exclude SIM card)
- 1D: with 1NCE* 10 years 500MB SIM card and Pre-configure to DataCake server
YY: The grand connector hole size
- M12: M12 hole
- M16: M16 hole
8. Packing Info
Package Includes:
- SDI-12-NB SDI-12 to NB-IoT Converter x 1
- External antenna x 1
Dimension and weight:
- Device Size: cm
- Device Weight: g
- Package Size / pcs : cm
- Weight / pcs : g
9. Support
- Support is provided Monday to Friday, from 09:00 to 18:00 GMT+8. Due to different timezones we cannot offer live support. However, your questions will be answered as soon as possible in the before-mentioned schedule.
- Provide as much information as possible regarding your enquiry (product models, accurately describe your problem and steps to replicate it etc) and send a mail to Support@dragino.cc.