Use Counting Mode
Table of Contents:
Use LT IO controller to counting how many object pass over flow line.
1. Overview
In this case, we will use IO controller and Laser Sensor to check how many objects pass on a flow line.
2. Sensor Selected
The sensor used here is a laser sensor model is BX-R52:
The BX-R52 is an NPN output Laser sensor, It shipped with a reflector. The sensor has four pins. We only three pins here: they are VCC , GND and Output.
The sensor will emit a laser after powering on.
- When the lase arrives at the reflector, the reflector will reflect the laser to the sensor and the output pin will have a floating output.
- When there is something blocking the laser, it will output GND.
So put the laser sensor and reflector on the two sides of the flow line. When there is an object passing between the flow line, it will block the laser and the sensor will switch from float to 0v. So we can count how many times it switches from float to 0v to know how many objects pass.
3. Connect to IO-Controller
Connect the Laser sensor to Controller as below Reference URL: http://wiki.dragino.com/xwiki/bin/view/Main/User%20Manual%20for%20LoRaWAN%20End%20Nodes/LT-22222-L/#H3.6.2DigitalInputPort:DI12FDI228ForLT-22222-L29
Below is the wiring:
- Power Adapter +12v <--> IO Controller VIN <--> Sensor VCC
- Power Adapter GND <--> IO Controller GND <--> Sensor GND
- IO Controller VIN <--> IO Controller D1+
- Sensor Output <--> IO Controller D1-
In above connection means below:
4. Testing
Configure IO Controller with below commands:
AT+MOD=2 // Set to use double counting mode
AT+TRIG1=1,100 // (set DI1 port to trigger on high level, valid signal is 100ms )
ATZ
Enable debug mode so we can see info from console:
AT+DEBUG
Then pass the object like below photos.
Whenever there is object pass, we can see counting increase from debug mode.
From LoRaWAN platform, we can see the counting is uplink to the platform.