www.dragino.com
LSN50 LoRa Sensor Node User Manual
22
/
60
2.4.4
Analogue Digital Converter (ADC)
The ADC monitors the voltage on the PA0 line, in mV.
Ex: 0x021F = 543mv,
Example1:
Reading an Oil Sensor (Read a resistance value):
In the LSN50, we can use PB4 and PA0 pin to calculate the resistance for the oil sensor.
Steps:
1.
Solder a 10K resistor between PA0 and VCC.
2.
Screw oil sensor’s two pins to PA0 and PB4.
The equipment circuit is as below:
1
0
~
7
0c
m
* Bouy on top, the oil sensor act as a 10K resistor.
* Bouy on bottom, it act as a 0ohm resistor,
To get the deep for the liquid, we can measure the
output resistance for oil sensor and calculate where
the bouy is so to calculate the height of oil.
Solder a 10K Resistor between
PA0 and VCC
Connect oil sensor to PA0 and
PB4
PB4 will be set to low(0v) at
every sampling
ADC Pin