SN0311 / A0221AU UART Ultrasonic Sensor

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Pierrem31
New user
Posts: 3
Joined: 26 Mar 2023, 14:13

SN0311 / A0221AU UART Ultrasonic Sensor

#1 Post by Pierrem31 » 26 Mar 2023, 14:54

Hi all,

As I am a newbie in the ESP world, I don't even know if my project in feasible "As it"
By the past I made a CO2 sensor connected trough MQTT to my HomeAssistant, using the same board and firmware.
https://emariete.com/en/diy-co2-monitor-wifi/

Anyway :
I would like to read my sensor A0221AU using EspEasy on my ESP80 board (ref below)

So, my first question is : is it possible to read UART using this board and this firmware ?

I didn't find the answer in this forum, but I found some tests, and I tried to add a "Generic Puls Counter" : there is "Something" as a result when my sensor is connected : I keep hope !

I you have any information to help me, it would be great,

Thank you

Pierre

from
https://wiki.dfrobot.com/_A02YYUW_Water ... KU_SEN0311 :
UART Output

Output Communication

When "RX" floats or input High level, the module outputs processed value, the data is more steady, response time: 100-300ms; when input Low level, the module outputs real-time value, response time: 100ms.
UART data bit stop bit parity band rate
TTL level 8 1 none 9600bps

UART Output Form
Frame Data Description Byte
Header 0xFF 1 byte
DATA_H Distance Data High 8-bits 1 byte
DATA_L Distance Data Low 8-bits 1 byte
SUM Checksum 1 byte

UART Output
Header DATA_H DATA_L SUM
0xFF 0x07 0xA1 0xA7

Note: checksum only reserves the low 8-bits of the accumulated value.

SUM=(Header+Data_H+Data_L)&0x00FF
=(0XFF + 0X07 + 0XA1)&0x00FF
=0XA7;

Distance= Data_H*256+ Data_L=0X07A1;

Equal to 1953 when converted into decimal;

Represent the current measured distance is 1953mm.
https://fr.aliexpress.com/item/40005500 ... 90182%21sh

https://www.aliexpress.com/item/1005003 ... 30906%21sh


Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests