Trying to make UART serial radio (arduino=+nrf24l) - Page 1
Forum section: electronics / projects

author: jtu
author_rank: Unknown
timestamp: February 16, 2021, 12:19:22 pm
content: Hi,I'm trying to make UART serial radio using Arduino and nrf24l radio. The purpose is to send whatever UART data comes in within <500m radius at speeds up to 230400 baud. One way, from one "base" to up to 4 receivers, all receivers need the same data. Data packets are sent 4 times every second and are ~680 bytes. To be safe, I'm assuming max @ 1kB. The key here is not to try to go into what data is sent, it's encoded in a way I don't want to go into decoding, that's a whole other business I'm not interested into. It's UART, LSB, no parity, 1 stop bit.From what I see on the market, I know it is possible. I's just I haven't found exactly what I want/need for the price my project can bear.I started to discuss the @ Arduino forum, but no success there. Probably, because key here is that I have practically no control over data. Guys there are talking about how to manipulate content rather than the transport problem. I'ts appreciated, I have learned thingsNow, the current question I'm pasting +/- from my last posts to Arduino forum.I'm confused!Experimenting, learning how Arduino hw serial behaves, I decided to try something trivialCode:void setup() {Serial.begin(230400);Serial.println("Hello world");Serial1.begin(230400); // 460800Serial1.setTimeout(20);Serial2.begin(230400); // 460800}void loop() {}void serialEvent1() {while (Serial1.available()) {Serial2.write(Serial1.read());}}What happens surprises me a lot. Actually, it seem reading and writing approximately the same amount of data. Data packets read and written are same length down to microseconds. But the contents are different!!! How can that be???Iduino Mega, serial speed is 230400.Then, I looked at what's going on on electrical level.Thisshows how scope's decode of incoming and outgoing are different.Andthispic shows bits are different length. UART demands clock accuracy level at one digit if I remember it right. Here I see it in 30% range in some places.Something is wrong here...I'm thinking about my measurements, if something might be wrong with that. The scope is Siglent SDS1202X-E, 200MHz, an order of magnitude good for data rate I'm measuring, I think. What else?Veiksmi,JānisPS This is a sub-project. If you want to know more about the whole, follow the Arduino forumlink, it's described there. Actually, the project started here, on EEVblog, seethisif interested.

author: jtu
author_rank: Unknown
timestamp: February 17, 2021, 12:57:25 pm
content: Ok, I got it. Arduino is simply not up to the task. 230400 baud rate is simply too much. ~the same sketch works with esp32.I was right about weird bit length. It is good on esp and target reads. There are some delays, packet is split into chunks, but that's the next problem to solveI'll have to learn esp32, unfortunately. Sarcasm, of course. Learning might be hard, but its allways good. I'm just a bit sad I wasted all this time and effort with atmega at the moment.

author: jtu
author_rank: Unknown
timestamp: February 22, 2021, 02:32:24 pm
content: Move from Arduino to esp32 is harder that I expected 🙁 thus slow. To get data from serial and give it over wifi is not a trivial task. Good news is I like to learn 🙂

author: DrG
author_rank: Super Contributor
timestamp: February 22, 2021, 05:15:14 pm
content: Quote from: jtu on February 22, 2021, 02:32:24 pmYou may want to take a look at this tutorialhttps://randomnerdtutorials.com/esp-now-one-to-many-esp32-esp8266/just to get your feet wet.