Category Archives: Application

Application catagories show the application and user guide of the products from dwmzone. you will find some further userful information which related the products list on dwmzone online shop.

Lora Sensor Node-LSN50 User Manual and Case Study

INTRODUCTION

Dragino LoRa Sensor Node

Dragino LoRa Sensor Node

What is the LSN50

LSN50 is a Long Range LoRa Sensor Node. It is designed for outdoor use and powered by Li/SOCl2 battery for long term use power consumption and secure data transmission.It is designed to facilitate developers to quickly deploy industrial level LoRa and IoT solutions. It help users to turn the idea into a practical application and make the Internet of Things a reality. It is easy to program, create and connect your things everywhere.

It is based on SX1276/SX1278 allows the user to send data and reach extremely long ranges at low data-rates.It provides ultra-long range spread spectrum communication and high interference immunity whilst minimising current consumption.It targets professional wireless sensor network applications such as irrigation systems, smart metering, smart cities, smartphone detection, building automation, and so on.

LSN50 uses STM32l0x chip from ST, STML0x is the ultra-low-power STM32L072xx microcontrollers incorporate the connectivity power of the universal serial bus (USB 2.0 crystal-less) with the high-performance ARM® Cortex®-M0+ 32-bit RISC core operating at a 32 MHz frequency, a memory protection unit (MPU), high-speed embedded memories (192 Kbytes of Flash program memory, 6 Kbytes of data EEPROM and 20 Kbytes of RAM) plus an extensive range of enhanced I/Os and peripherals.

LSN50 is an open source product, it is based on the STM32Cube HAL drivers and lots of libraries can be found in ST site for rapid development.

Introdution2.jpg

STM32l0x

  • The maximum link budget is 157 dB
  • +20 dBm, 100 mW constant RF output with Vsupply
  • +14 dBm high efficiency PA
  • Programmable bit rates up to 300 k
  • High sensitivity: down to -137 dBm
  • Bulletproof front end: IIP3 = -12.5 dBm
  • 89 dB blocking immunity
  • The low RX current is 10 mA and the register is held at 200 nA
  • Fully integrated synthesizer with 61 Hz resolution
  • FSK, GFSK, MSK, GMSK, LoRa and OOK modulations
  • Bit built-in synchronizer for clock recovery
  • Synchronous word recognition
  • Preamble detection
  • 127 dB + dynamic range RSSI
  • Built-in temperature sensor and low battery indicator 1.65 V to 3.6 V power supply

Specifications

MCU Side:

  • MCU: STM32L072CZT6
  • Flash:192KB
  • RAM:20KB
  • EEPROM: 6KB
  • Clock Speed: 32Mhz

LoRa Side:

  • LoRa Chip: sx1276/sx1278
  • 68 dB maximum link budget.
  • +20 dBm – 100 mW constant RF output vs.
  • +14 dBm high efficiency PA.
  • Programmable bit rate up to 300 kbps.
  • High sensitivity: down to -148 dBm.
  • Bullet-proof front end: IIP3 = -12.5 dBm.
  • 127 dB Dynamic Range RSSI.
  • LoRaWAN 1.0.2 Specification

Absolute Maximum Ratings:

  • I/O pins: 0.5v ~ VCC+0.5V

Common DC Characteristics:

  • Supply Voltage: 2.1v ~ 3.6v
  • Operating Tempature: -40 ~ 85°C
  • I/O pins: Refer to STM32L072 datasheet

Power Consumption:

  • STOP Mode: 2.7uA @ 3.3v
  • LoRa Transmit Mode:

125mA @ 20dBm 44mA @ 14dBm

Battery:

  • Li/SOCI2 unchargable battery
  • Capacity: 4000mAh
  • Self Discharge: <1% / Year @ 25°C
  • Max continuously current: 130mA
  • Max boost current: 2A, 1 second

Dimensions:

  • Size:65 x 50 x 50mm
  • Net Weight: 140g

Features

  • STM32L072CZT6 MCU
  • SX1276/78 Wireless Chip
  • Pre-load bootloader on USART1/USART2
  • MDK-ARM Version 5.24a IDE
  • I2C,LPUSART1,USB
  • 2x12bit ADC, 1x12bit DAC
  • 18xDigital I/Os
  • LoRa™ Modem
  • Preamble detection
  • Baud rate configurable
  • CN470/EU433/KR920/US915
  • EU868/AS923/AU915
  • Open source hardware / software
  • Available Band:433/868/915/920 Mhz
  • IP66 Waterproof Enclosure
  • Ultra Low Power consumption
  • AT Commands to change parameters
  • 4000mAh Battery for long term use

Applications

  • Wireless Alarm and Security Systems
  • Home and Building Automation
  • Automated Meter Reading
  • Industrial Monitoring and Control
  • Long range Irrigation Systems,etc.

Getting Start

Power On/Off the LSN50

The LSN50 is power off before shipping to avoid accident during shipping. We use a jumper to power on/off the LSN50, This will be useful for monitoring power consumption when connecting to different sensors and with different software. User can power on the device by simply adding the jumper to the board , as below.

Power on.jpg

Use the AT Command

  • AT0 1.png

  • steps
  1. NEW LSN50 1.png

  2. Connect USB 1.png

  3. Open application Seral port and click Start

  4. You can see the status of the interface(If it does not appear, press the reset button or the AT command: ATZ.)

  5. Input commands: Ex)AT+ADR=0(Adaptive rate is off).If your AT command is sent successfully, the software will receive feedback (OK).

  • Tips:If you want to know the more commands,you can send: AT+?.)

Program LSN50

  • Download Flashloader(Here is just sample application.You can also use the same type of programming application.And the method is similar.) and download STM32CubeExpansion_LRWAN.zip(Include source code).

Steps

  • Please follow the below of examples:

Follow the picture to find the program file.

Open this file.

Promgram4 1.png

Program3.png

Program5 1.png

Program6 1.png

Program7 1.png

Program8 1.png

Result

Program9 1.png

Program10 1.png

Current consumption test in “Stop mode” mode

  • Remove the jumper from JP2, connect with a multimeter, and hit 20uA.

Pin Definition

Introdution.png

 

Case Study 1: With Oil Sensor

Schematic

  • The Oil Sensor is a sliding variable resistance, floating through the float above the circuit to change the size of the resistance.

Yuanlitu 1.png

Schematic 2.png

Connection steps

OILSENSOR 1.jpg

Connect 2.png

Connect 3.png

Calculation method

  • Only for our LSN50 such as:

(TTN) The value of the first two above is 00 00, which is 0
H = 0 * 3.0 * 1000 / (3.0 * 4095) (mm)
If (TTN) data = 00 10 is 16
H = 16 * 3.0 * 1000 / (3.0 * 4095) (mm)

Case Study 2: With DS18B20 Temperature Sensor

Schematic

  • DS18B20 Temperature range is -55~125℃.

The delay time when the temperature changes is 750ms.Temperature measurement error is 0.5 ℃. The programmable resolution is 9~12 bits.

DS18YUANLI.png

Connection steps

DS18B.png

DS18B 1.png

Calculation method

  • The DS18B20 is configured as 12 bits at factory shipment. When reading the temperature, a total of 16 bits are read. The first 5 bits are sign bits. When the current 5 bits are 1, the read temperature is negative. When the current 5 bits are 0, Take the temperature is positive. When the temperature is positive read method: the hexadecimal number can be converted into decimal. When the temperature is negative, the reading method is: add 1 after the hexadecimal inversion, and then convert it to 10 hexadecimal. Example: 0550H = +85 degrees, FC90H = -55 degrees.

Order Infomation

Order Info- LSN50-XX-YY

XX:

  • 433: Best Tuned at 433Mhz
  • 868: Best Tuned at 868Mhz
  • 915: Best Tuned at 915/920 Mhz

YY:

  • 12: With M12 waterproof cable hole
  • 16: With M16 waterproof cable hole
  • 20: With M20 waterproof cable hole

DWM-PM-2 Mini Infrared PIR module User Guide

DWM-PM-2 Mini Infrared PIR module

Features

Power supply is 3.3V to 15V.module include LDO;
Sensitivity can be adjust,
Delay time can be adjust,
Trigger mode is be defined as repeatable;
[small size,Wideer working voltage range,small current,stable performance]

Repeatable: if the moudul detect human body is moving,output high level at once,this moment,at delay time,if PIR detect body is moving once more, then delay time reset,be cleared to zero,start counting from zero,until the delay time to over,will output low level,waitting next trigger.

Unrepeatle:if the moudul detect human body is moving,output high level at once,this moment,signal input line be closed,PIR detect is disabled, until the delay time to over,will output low level,waitting next trigger.

 LDR worke mode

Customer can sold a LDR then the module will not work at the day time and will work at the evening.

dwmzone-DWM-PM-2-Mini-Infrared-PIR-module-application-typical-diagram

dwmzone-DWM-PM-2-Mini-Infrared-PIR-module-application-typical-diagram

Sensitivity adjust and Delay time adjust

 

delay time adjust and sentivity adjust

delay time adjust and sentivity adjust

If you want to change the sensitivity level you can folow the formula Usens=R1/(R1+R2)*VDD.if the Usens=3.3V it’s highest sensitivit and if the Usens=0.15V is Lowest sensitivity.You also have to consider the power comsumption For Lower Power comsumption the Resistance value of R1+R2 should Over 500k ohm.

if you want to change delay time take this tale as reference shows as below.

delay time adjust reference table

delay time adjust reference table

The module ouput is MCU IO port direct output,to use,advise series connection a resistance,4.7K to 10K;

Note:

1.Before use,need checking Solder iron temperature , implement leakage of electricity, and static discharge in winter(cmos component)
2.When power on,IC has 20S to 60S self-testing process,in the meantime,will output high level,then,output low level,into stable waiting state.(waiting state,it is also on standby);

User Guide DWM-PM-8 50uA Lowest standby Current 0.18s to 300s Delay Time Mini Infrared PIR motion sensor module

DWM-PM-8 50uA Lowest standby Current 0.18s to 300s Delay Time Mini Infrared PIR motion sensor module

Features

Power supply is 3.3V to 15V.module include LDO;
Sensitivity can be adjust,
Delay time can be adjust,
Trigger mode is be defined as repeatable;
Controller MCU built-in sensor:strong interference rejection capacity,Low EMI.
[small size,Wideer working voltage range,small current,stable performance]

dwmzone-pir-infrared-sensor416-dwm-pm-8-50ua-lowest-standby-current-018s-to-300s-delay-time-mini-infrared-pir-motion-sensor-feature

dwmzone-pir-infrared-sensor416-dwm-pm-8-50ua-lowest-standby-current-018s-to-300s-delay-time-mini-infrared-pir-motion-sensor-feature

Repeatable: if the moudul detect human body is moving,output high level at once,this moment,at delay time,if PIR detect body is moving once more, then delay time reset,be cleared to zero,start counting from zero,until the delay time to over,will output low level,waitting next trigger.

Unrepeatle:if the moudul detect human body is moving,output high level at once,this moment,signal input line be closed,PIR detect is disabled, until the delay time to over,will output low level,waitting next trigger.

 LDR worke mode

Customer can sold a LDR then the module will not work at the day time and will work at the evening.

dwmzone-pir-infrared-sensor416-dwm-pm-8-50ua-lowest-standby-current-018s-to-300s-delay-time-mini-infrared-pir-motion-sensor-module

dwmzone-pir-infrared-sensor416-dwm-pm-8-50ua-lowest-standby-current-018s-to-300s-delay-time-mini-infrared-pir-motion-sensor-moduleSensitivity adjust and Delay time adjust

Sensitivity adjust and Delay time adjust

dwmzone-pir-infrared-sensor416-dwm-pm-8-50ua-lowest-standby-current-018s-to-300s-delay-time-mini-infrared-pir-motion-module

dwmzone-pir-infrared-sensor416-dwm-pm-8-50ua-lowest-standby-current-018s-to-300s-delay-time-mini-infrared-pir-motion-module

dwmzone-pir-infrared-sensor416-dwm-pm-8-50ua-lowest-standby-current-018s-to-300s-delay-time-mini-infrared-pir-motion-time-table

dwmzone-pir-infrared-sensor416-dwm-pm-8-50ua-lowest-standby-current-018s-to-300s-delay-time-mini-infrared-pir-motion-time-table

Test and Application circut

dwmzone-pir-infrared-sensor416-dwm-pm-8-50ua-lowest-standby-current-018s-to-300s-delay-time-mini-infrared-pir-motion-sensor-application

dwmzone-pir-infrared-sensor416-dwm-pm-8-50ua-lowest-standby-current-018s-to-300s-delay-time-mini-infrared-pir-motion-sensor-application

Motion Activated LED Step Light, Part 1 – Project Overview

Motion Activated LED Step Light, Part 2 – PM-8 Sensor and Schematic

Motion Activated LED Step Light, Part 3 – Adding LIght Sensor (LDR)

Motion Activated LED Step Light, Part 4 – Warm white LEDs and battery life

 

User Guide for DWM-PM-6 20uA Lowest standby Current 1.8s to 1Hour Delay Time Mini Infrared PIR module

DWM-PM-6 20uA Lowest standby Current 1.8s to 1Hour Delay Time Mini Infrared PIR module

Features

Power supply is 3.3V to 15V.module include LDO;
Sensitivity can be adjust,
Delay time can be adjust,
Trigger mode is be defined as repeatable;
Controller MCU built-in sensor:strong interference rejection capacity,Low EMI.
[small size,Wideer working voltage range,small current,stable performance]

dwmzone-dwm-pm-6-20ua-lowest-standby-current-18s-to-1hour-delay-time-mini-infrared-pir-module-delay-time-low-EMI

dwmzone-dwm-pm-6-20ua-lowest-standby-current-18s-to-1hour-delay-time-mini-infrared-pir-module-delay-time-low-EMI

Repeatable: if the moudul detect human body is moving,output high level at once,this moment,at delay time,if PIR detect body is moving once more, then delay time reset,be cleared to zero,start counting from zero,until the delay time to over,will output low level,waitting next trigger.

Unrepeatle:if the moudul detect human body is moving,output high level at once,this moment,signal input line be closed,PIR detect is disabled, until the delay time to over,will output low level,waitting next trigger.

 LDR worke mode

Customer can sold a LDR then the module will not work at the day time and will work at the evening.

dwmzone-dwm-pm-6-20ua-lowest-standby-current-18s-to-1hour-delay-time-mini-infrared-pir-module

dwmzone-dwm-pm-6-20ua-lowest-standby-current-18s-to-1hour-delay-time-mini-infrared-pir-module

Sensitivity adjust and Delay time adjust

dwmzone-dwm-pm-6-20ua-lowest-standby-current-18s-to-1hour-delay-time-mini-infrared-pir-module-sensitive

dwmzone-dwm-pm-6-20ua-lowest-standby-current-18s-to-1hour-delay-time-mini-infrared-pir-module-sensitive

dwmzone-dwm-pm-6-20ua-lowest-standby-current-18s-to-1hour-delay-time-mini-infrared-pir-module-delay-time

dwmzone-dwm-pm-6-20ua-lowest-standby-current-18s-to-1hour-delay-time-mini-infrared-pir-module-delay-time

dwmzone-dwm-pm-6-20ua-lowest-standby-current-18s-to-1hour-delay-time-mini-infrared-pir-module-delay-time-low-delay-time-1.8S

dwmzone-dwm-pm-6-20ua-lowest-standby-current-18s-to-1hour-delay-time-mini-infrared-pir-module-delay-time-low-delay-time-1.8S

Test and Application

dwmzone-dwm-pm-6-20ua-lowest-standby-current-18s-to-1hour-delay-time-mini-infrared-pir-module-application

dwmzone-dwm-pm-6-20ua-lowest-standby-current-18s-to-1hour-delay-time-mini-infrared-pir-module-application

Note:

1.Before use,need checking Solder iron temperature , implement leakage of electricity, and static discharge in winter(cmos component)
2.When power on,IC has 20S to 60S self-testing process,in the meantime,will output high level,then,output low level,into stable waiting state.(waiting state,it is also on standby);

3.The module ouput is MCU IO port direct output,to use,advise series connection a resistance,4.7K to 10K;

Software development guide for E931.96, Reading and Writing functions

Affected Devices and Sensors

E931.96 Ultra-Low Power PIR Controller

Interfaces

The E931.96 accepts data from the MCU on the SERIN input pin. Measurement data is clocked out and motion interrupts are flagged on the INT/DOCI pin of the device.A zero to one transition on the INT output indicates detected motion. The interrupt pin will stay at one until it is cleared by the MCU.The MCU can read the ADC voltages (14 bits) and the configuration data (25bits) through the DOCI output of the E931.96.

Setting up the device (SERIN)

After power up the E931.96 need to be programmed with a configuration that sets up the device with operational parameters and puts the device in the correct operational mode.  The device is programmed with a 25-bit bit stream on the SERIN input. The SERIN input is held low when the interface is not used, it also provides for minimum interference to the sensor. The microcontroller generates a low to high transition on the SERIN input, this is a clock pulse, and subsequently applies a data bit value, either a one or a zero. This process is repeated 25 times until all the data bits are clocked into the E931.96. The low to high transition or clock pulse can be very short, typically 1 instruction cycle of the microcontroller, but the data bit value must be applied for at least 2 system clocks (2/FCLK), of the E931.96. Whenever the data transfer is interrupted for more than 16 system clocks (16/FCLK), the last data received is latched into the configuration registers. Should the transfer of data be interrupted for more than 15 system clocks, the writing procedure needs to be restarted.Table 3 in the datasheet shows the sequence of bits and the meaning of the register values. Configuration data is clocked into the device starting at bit 24 down to bit 0.  A typical code example would look as follows:

void write_to_E93196(long long setup_data)  // setup_data holds the device configuration

{

char i;

long long mask;

mask=0x01000000;       // Bitmask is at bit 25

for(i=0;i<25;i++)

{

serin_clock();        // Generates zero to one clock pulse on SERIN pin

if((setup_data&mask)>0)  // Decide if it is a one or a zero data bit

output_high(SERIN);

else

output_low(SERIN);

delay_us(72);         // More than 62us, ensure it is more than 2/FCLK

mask>>=1;            // Shift mask to the next bit

}

output_low(SERIN);

delay_ms(1);            // Wait for data to be latched, time must be more than 16/FCLK

}

Reading

The DOCI pin is used to transfer data from the device to the MCU. The MCU drives a clock signal and the E931.96 provides the data bit. The MCU initiates reading of the status and configuration data by forcing a high level for the duration of more than 2 device clock cycles (>3/FCLK) on the DOCI pin (tFR in the datasheet).

A clock pulse is generated by a low to high transition on the DOCI pin. Subsequently the MCU samples data bit value driven by the E931.96. This process is repeated 15 times to read the ADC value and a further 25 times until all the data bits are clocked out of the E931.96. The sampling speed is influenced by the capacitance on the DOCI line due to the PCB layout and the MCU load. The DOIC pin does not have a strong driver so that it can be overdriven for the clock pulses. When readout is completed, the MCU must drive the DOCI pin to zero, and subsequently switch to tri-state in order to receive a new interrupt. The source for the ADC input can be selected between PIR input, supply voltage input and temperature. Reading can be terminated at any time by forcing the DOCI line to zero for at least 4 system clock cycles.The interrupt source for the DOCI/INT output can be selected between reading of the ADC values or for motion detection. If the ADC interrupt is selected, an interrupt is produced every 512 system clocks that signals that an ADC value is available to be clocked out. It is possible to read ADC values without making use of the interrupts generated by the E931.96.For interrupts as a result of motion, the motion detection bit and the interrupt source bit need to be set.No interrupt will be generated while the microcontroller accesses the interface.Below is an example of reading the ADC value as well as the configuration data from the device.

void readback_all_from_E93196(void)

{

int n;

long long kk;

#use fast_io(A)  // This tells the compiler that I will take care of the direction settings of the port

force_doci_high();   // force read, hold DOCI high at least 3 clocks of IC

//clock out bits [39:25] for the ADC value and the out of range bit

for(n=0;n<(14+1);n++)

{

doci_clock();

adc<<=1;     // This instruction is my sample delay

if(input(DOCI_PIN)==1)

adc++;

}

//Next read the setup bits [24:0]

setup_back=0;

for(n=0;n<25;n++)

{

doci_clock();

kk<<=1;          // This instruction is my sample delay

if(input(DOCI_PIN)==1)

setup_back++;

}  clear_DOCI_interrupt();

#use standard_io(A)

}

Helper functions

In the examples above we made use of small functions that is shown below. The syntax of these functions may be different to suit the particular compiler that is used. The DOCI output is clocked by the device as fast as possible; the direction handling is also taken care of.

void doci_clock(void)

{

#use fast_io(A)

output_low(DOCI_PIN);     // Clear DOCI pin

doci_dir&=~DOCI_PIN_DIR;  // Clear direction bit

set_tris_a(doci_dir);     // DOCI pin output

delay_cycles(5);          // Wait a bit

output_high(DOCI_PIN);    // Set DOCI pin

doci_dir|=DOCI_PIN_DIR;   // Set direction bit

set_tris_a(doci_dir);     // DOCI pin input

delay_cycles(5);          // Wait a bit

}

After an interrupt was generated by the device, it is cleared by the MCU by driving the DOIC pin low and releasing it, so that the device can drive again when an interrupt occurs.

void clear_DOCI_interrupt(void)

{

//Release the DOCI Line leave in zero state

#use fast_io(A)    // Prevent compiler from handling the direction control

output_low(DOCI_PIN);      // Clear DOCI pin

doci_dir&=~DOCI_PIN_DIR;   // Clear direction bit

set_tris_a(doci_dir);      // DOCI pin output

delay_cycles(175);      // Time depends on track capacitance on the PCB

doci_dir|=DOCI_PIN_DIR;    // Set direction bit

set_tris_a(doci_dir);      // DOCI pin input

#use standard_io(A)

}

A read request from the MCU to the E931.96 is indicated by forcing DOCI to high level for 3 device clocks (3/FCLK) of the E931.96

void force_doci_high(void)

{

// force read, at least 3 clocks of IC

#use fast_io(A)    // Prevent compiler from handling the direction control

output_high(DOCI_PIN);    // Set DOCI pin

doci_dir&=~DOCI_PIN_DIR;  // Clear direction bit

set_tris_a(doci_dir);     // DOCI pin output

delay_us(120);

#use standard_io(A)

}

The function below generates the clock signal on the SERIN input of the device. The clock delay can be as short as one cycle on the MCU.

void serin_clock(void)

{

output_low(SERIN); // Clear SERIN pin

delay_us(1);

output_high(SERIN);     // Set SERIN pin

delay_us(1);

}