A01NYUB Waterproof Ultrasonic Sensor

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
dapeda
New user
Posts: 9
Joined: 10 Feb 2021, 22:45

A01NYUB Waterproof Ultrasonic Sensor

#1 Post by dapeda » 10 Feb 2021, 22:56

Hello all!

I would like to commission the following sensor in ESPEasy:
A01NYUB Waterproof Ultrasonic Sensor (https://wiki.dfrobot.com/A01NYUB%20Wate ... 3#target_1).

It communicates via UART, but I have not managed to get it working. The sensor works and when put into operation with the Arduino script on the above page on the ESP8266, it works.

I can't find a suitable sensor in ESPEasy that will give me the serial value that the sensor provides (distance in centimeters) so that I can send the value to Domoticz via MQTT.

How can I get values that come in serially? I thought this is like HC-SR04....

i would be happy to get some support.

best regards,
Peter

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: A01NYUB Waterproof Ultrasonic Sensor

#2 Post by TD-er » 10 Feb 2021, 23:18

I think the SDS011 plugin is one of the simplest plugins using serial.
Maybe that can be useful as a template for your plugin?

dapeda
New user
Posts: 9
Joined: 10 Feb 2021, 22:45

Re: A01NYUB Waterproof Ultrasonic Sensor

#3 Post by dapeda » 10 Feb 2021, 23:27

Hello,

thank you for your quick reply!
I have now selected the device Dust - SDS011/018/198 and entered HWSerial with RX: GPIO-3 (D9) TX: GPIO-1 (D10). Unfortunately, the value is only 0.00. I have already exchanged the cables of TX/RX, but without success.

PEter

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: A01NYUB Waterproof Ultrasonic Sensor

#4 Post by TD-er » 10 Feb 2021, 23:40

I think we're missing each others point.
I tried to explain which plugin source code was probably the simplest to start tinkering with to make it work with your sensor.
Meaning you need to code it, compile it etc. :)

Currently we don't have a plugin for your sensor available (as far as I know)

dapeda
New user
Posts: 9
Joined: 10 Feb 2021, 22:45

Re: A01NYUB Waterproof Ultrasonic Sensor

#5 Post by dapeda » 11 Feb 2021, 00:05

That's right, I think we've been talking past each other.
I am not a programmer, but I can transfer scripts in Arduino to the ESP. Certainly not write a plugin.

The A01NYUB sensor outputs the distance it measures in cm. so it writes e.g. 117
This is the distance in CM, i.e. 1.17 meters or 117 cm.

I am just wondering that there is no dummy sensor here that displays everything that comes in serially.

What about the Device: Communication - Serial Server can it not display incoming serial values?

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: A01NYUB Waterproof Ultrasonic Sensor

#6 Post by TD-er » 11 Feb 2021, 10:39

You could try the Serial Proxy plugin.
That one considers a line of ASCII text (with line ending) as a string message and sends it to the first enabled MQTT controller.

dapeda
New user
Posts: 9
Joined: 10 Feb 2021, 22:45

Re: A01NYUB Waterproof Ultrasonic Sensor

#7 Post by dapeda » 11 Feb 2021, 11:21

I have not found a serial proxy. Now I have flashed the ESP_Easy_mega_20210114_normal_ESP8266_1M.bin to the ESP, here the plugin is not visible either.
Can you please show me where I can find it on the WebGUI? Maybe I'm just overlooking it. Thanks a lot!

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: A01NYUB Waterproof Ultrasonic Sensor

#8 Post by TD-er » 11 Feb 2021, 11:24

Since it is still highly experimental, it is not yet included in the regular builds
I can make a test build for you, what size of flash do you use? (ESP8266 I presume)

dapeda
New user
Posts: 9
Joined: 10 Feb 2021, 22:45

Re: A01NYUB Waterproof Ultrasonic Sensor

#9 Post by dapeda » 11 Feb 2021, 11:28

I use the 1MB ESP8266 here.
Thank you very much for your support

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: A01NYUB Waterproof Ultrasonic Sensor

#10 Post by TD-er » 11 Feb 2021, 11:33


dapeda
New user
Posts: 9
Joined: 10 Feb 2021, 22:45

Re: A01NYUB Waterproof Ultrasonic Sensor

#11 Post by dapeda » 11 Feb 2021, 12:56

Thanks, is installed, but I could not test yet, have to go to the office. I will let you know when I could test further.

dapeda
New user
Posts: 9
Joined: 10 Feb 2021, 22:45

Re: A01NYUB Waterproof Ultrasonic Sensor

#12 Post by dapeda » 11 Feb 2021, 22:18

Hi,

I have now had some time to research further.
There should be some data coming in, but I don't really see the values.
Here is the output and the settings:
Unbenannt.JPG
Unbenannt.JPG (13.16 KiB) Viewed 10385 times
Unbenannt2.JPG
Unbenannt2.JPG (73.27 KiB) Viewed 10385 times

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: A01NYUB Waterproof Ultrasonic Sensor

#13 Post by TD-er » 11 Feb 2021, 23:09

Do you have an enabled MQTT controller?
This plugin doesn't (yet) allow for selecting a controller, it is hard coded to send it to the first enabled MQTT controller. (since it is using the output type "String" which isn't yet supported in the rest of the ESPEasy code)

dapeda
New user
Posts: 9
Joined: 10 Feb 2021, 22:45

Re: A01NYUB Waterproof Ultrasonic Sensor

#14 Post by dapeda » 12 Feb 2021, 08:57

Thank you! I tried it with and without controller, because I actually wanted to see what arrives natively at the device in the ESPEasy. I managed only once to send a value to Domoticz, which was also plausible. However, I found that the EPS8266 freezes after a few minutes when SerialProxy is active. Additionally, I tested this on different boards. On all of them this occurs as well. It's not finished yet, the plugin, I understand that and wait until it's finished.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: A01NYUB Waterproof Ultrasonic Sensor

#15 Post by TD-er » 12 Feb 2021, 09:00

How many messages are being received and at what interval?
You may want to tweak the controller queue settings too to make sure you're not running out of resources on the ESP.

dapeda
New user
Posts: 9
Joined: 10 Feb 2021, 22:45

Re: A01NYUB Waterproof Ultrasonic Sensor

#16 Post by dapeda » 14 Feb 2021, 09:36

could not find messages per second but nonly this:
Output Communication

When "RX" floats or input High level, the module outputs processed value, the data is more steady, response time: 150-300ms; when input Low level, the module outputs real-time value, response time: 150ms.
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

from https://wiki.dfrobot.com/A01NYUB%20Wate ... %20SEN0313

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests