Troubleshooting

A02YYUW UART to Wemos D1 mini

userHead BartWeemaels 2022-05-19 06:10:22 563 Views3 Replies

Hi,

I would like to connect my UART A02YYUW sensor to my Wemos D1 mini. I’m reading that I need to use softwareserial library to connect, but don’t know how to connect my A02YYUW to the wemos D1 mini board.

The 5V & GND are quit obvious, but the RX & TX seems to be hard to couple to which serial pin on the D1 mini ?

Anyone got an idea or got this working ?

Thanks in advance !

Kr,

Bart

2024-08-22 03:58:10

Found the solution here (Search for A022Y on the page):
ARDUINO TUTOS – e-techno-tutos

 

Essentially, you need to add the following code before reading the Rx pin which sends a 30ms pulse on the Tx pin:

//send pulse
mySerial.flush();
delay(30);
digitalWrite(TXpin,HIGH);
delay(30);
digitalWrite(TXpin,LOW);
delay(30);
digitalWrite(TXpin,HIGH);
delay(60);
//read Rx PIN

userHeadPic Anupam.Varghese
2022-05-31 07:54:34

This should not be a big problem.

I took the sample code and adapted the following line.SoftwareSerial mySerial(11,10); // RX, TXGPIO 11 and 12 do not exist in Wemos 

I took GPIO 12 and 13 (D6,D7).  

 

SoftwareSerial mySerial(12,13); // RX, TX

 

everything else I did not change.The values are displayed correctly.

 

 

userHeadPic RolandSpaeni
2022-05-19 10:12:57

Anyone ?

userHeadPic BartWeemaels