Read Information from a Sensor with esp8266
Posted: Fri Dec 01, 2017 4:00 pm
Hi people,
im new to this iot things and also to programming . I give my best to explain my problem.
I have a Nodemcu V3 (with ESP8266) connected with a SDS 011 Nova PM Dust Sensor.
I want to read the PM 2.5 and PM 10 Value from the meassurement of the Sensor.
When i understand it right. The TXD and RXD connection is important for me?!
I set the TXD from the SDS011 Sensor to the Pin 4 and the RXD to Pin 5.
my Code until now:
import machine
#TXD = 4 output? RXD = 5 input?
pin4 = machine.Pin(4, machine.Pin.OUT)
pin5 = machine.Pin(5, machine.Pin.IN, machine.Pin.PULL_UP)
print (pin4.value())
print (pin5.value())
>>> thats what i get back
1
1
I dont really understand what it means? I test a little bit and sometimes i get 0 instead of 1. What exactly does it say to me? Do i think wrong when i belive that
pin4.value() gives me the value for PM 10 or PM 2.5 ?
On the manuel for the Sensor i found this:
Needs all sensor response:
Send command:
AA B4 04 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 02 AB
Sensor with ID A160 Reply:
AA C0 D4 04 3A 0A A1 60 1D AB
Show PM2.5 data is 04D4, convert it to a decimal 1236,then it show PM2.5 to 123.6μg/m3,PM10 data is 0A3A, convert it to a decimal 2618, then it show PM10 to 261.8μg/m3.
but how can i send this to the sensor that i can get the response?
Thank you verry much for helping
best regards
Till
im new to this iot things and also to programming . I give my best to explain my problem.
I have a Nodemcu V3 (with ESP8266) connected with a SDS 011 Nova PM Dust Sensor.
I want to read the PM 2.5 and PM 10 Value from the meassurement of the Sensor.
When i understand it right. The TXD and RXD connection is important for me?!
I set the TXD from the SDS011 Sensor to the Pin 4 and the RXD to Pin 5.
my Code until now:
import machine
#TXD = 4 output? RXD = 5 input?
pin4 = machine.Pin(4, machine.Pin.OUT)
pin5 = machine.Pin(5, machine.Pin.IN, machine.Pin.PULL_UP)
print (pin4.value())
print (pin5.value())
>>> thats what i get back
1
1
I dont really understand what it means? I test a little bit and sometimes i get 0 instead of 1. What exactly does it say to me? Do i think wrong when i belive that
pin4.value() gives me the value for PM 10 or PM 2.5 ?
On the manuel for the Sensor i found this:
Needs all sensor response:
Send command:
AA B4 04 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 02 AB
Sensor with ID A160 Reply:
AA C0 D4 04 3A 0A A1 60 1D AB
Show PM2.5 data is 04D4, convert it to a decimal 1236,then it show PM2.5 to 123.6μg/m3,PM10 data is 0A3A, convert it to a decimal 2618, then it show PM10 to 261.8μg/m3.
but how can i send this to the sensor that i can get the response?
Thank you verry much for helping
best regards
Till