Using nRF24L01 radios as part of a weather station

This is an extension of the weather station project one of my IoT students tackled last year (2019).

The objective was to have a remote sensor (located in one of the school's gardens) to send temp/humidity/pressure readings to a database using MQTT. Initially a Wemos D1 Mini was used but the WiFi range of the ESP8266 limited the distance the sensor could be placed from the school.

Someone suggested I should look at the inexpensive UHF radios - - nRF24L01 as an alternative.
I've just spent a week of frustration and successes trying to get these radios to work reliably.
I won't share all the frustration as that's very negative and boring - just the final outcome (below).

Here's a photo of the remote station - Wemos D1 Mini + BME280 + nRF24L01+

And here's the base station - Wemos D1 Mini + OLED panel + nRF24L01+

Initially I used Arduino Nanos at both ends, then realised how do I send the received data to Node-RED, so I replaced the Nanos with Wemos D1 Minis. Note: You can upload Arduino 'sketches' to the Wemos which means you can WiFi-enable an Arduino project very, very easily.

The above photos are of a 'test rig' I lashed-up to do some range checks today (11/Sept/20). I managed to achieve a distance of 435 metres (see photo below) before I ran out of 'clear walking space', so now I have to think of somewhere that has a nice, flat, clear, line-of-sight terrain.

I've got a couple of sketches working that sense temp/humidity/pressure (at the remote station) and send the data (as an array) to the base station where it is unpacked and then formatted as a 'json' string and sent via MQTT to Node-RED. I've actually managed to get the sketch to handle a local and a remote MQTT broker (i.e. BeeBotte). Next step is to implement 'DeepSleep' at the remote station to save the energy in the battery pack. I'll publish the Arduino sketches here once I'm happy the programs work reliably.


Of course, you only need to do that on the master end, not on the sensor end :slight_smile:

I used to use these before the days of cheap Wi-Fi. Never had any problems with them though they were the non-plus type and so had limited ranges. Really easy to use though as a serial port. One problem I did occasionally get was truncation of the message. Best to keep each message fairly short and use a stop character that you can test in Node-RED to make sure you aren't trying to process incomplete messages.

Agreed - I can't remember why I did that, I might revisit the remote station and use the Nano again.

So amazing to get this distance with these tiny devices, love it.

I think that the record for Wi-Fi was a couple of hundred km? Don't suppose that was a Wemos D1-Mini though! :slight_smile:

Crafting a specialist aerial will do wonders for signal strength.

There is a record of 766km with lorawan, don't think that wifi can reach that far with "normal" equipment because of the higher frequencies. Nevertheless, the 382km record with wifi from 2007 is still impressive.

1 Like

It is said that putting the standard wifi stick aerial in a baked bean tin can make a good directional aerial which works wonders for wifi range. I have to admit that I haven't tried it however and the idea may be entirely apocryphal. Best to take the beans out and leave one end open I imagine.

1 Like

I once had a under-graduate working with me that was taking a degree course in 'Antenna Design' - he tried to explain the theory of 'patch antennas' to me. Went over my head (no pun intended).

These are the modules I've used.

There are lots of ways to improve antenna performance. A Pringles tin is another. Even just an earthed metal plate under the built-in antenna for a D1-mini may may a big difference.

Fortunately, you don't need to understand much of it to be able to reproduce a decent result. :slight_smile:

You've managed to reach a very long distance with these 2.4GHz modules!

I've had my share of struggles with the NRF24L01+ modules but I've found these shielded NRF24L01 modules to be
pretty good (sorry for the crappy link created from the app).

I would also chime in that like mentioned the LoRa based radios are crazy good for long distance. I bought this set of two ESP32's with LoRa included for experimentation. This bundle was not exactly cheap compared to NRF24L01+ modules and D1 Minis but the radio modules themselves can be bought much cheaper. I have to admit I haven't yet got myself to use them on any project but the distance with the pre-flashed demo firmware was just ridiculous. At our summer cottage (in the middle of the forest) I put the sender unit on a glassed porch and then walked away from the cottage also maybe 500m away and still receiving the packets without no line of sight and dense forest and one or two (wooden) buildings in between. Due to mosquitos I didn't walk further to test the limit but it already blew my mind how effortlessly they were able to communicate!

Does it work with a tinned tomato tin too? :slight_smile:

Definitely not. WiFi does not like tomatoes at all (even residue). It's what WiFi and I have in common. We both have autistic tendencies.


Probably not a good time to point out that that baked beans come in tomato sauce! :smiling_imp:

1 Like

No harm done, I disapprove beans also. The texture gives me cold shivers. I don't know about WiFi though. It seems to approve them based on the comment above. :roll_eyes:

1 Like

Obviously the best solution would be a cheese-based antenna - "Haloooo-me!!" :stuck_out_tongue_winking_eye:

I'll get my coat...

1 Like

I'll have to take a look at those shielded ones!

@dynamicdave and I started playing with the nRF24L01 about the same time - I actually got mine first but have been having a devil of a time keeping decent connections. I'll get a packet sent/received and then 10 missed. And this is with them next to each other or across the yard.

David has had much better success and I haven't had time (or energy) to do much lately. Our daughter lives three houses up the street with three kids (8, 6 boys and 3yr old girl) and was due to have her third in two weeks.

Well that all changed Wednesday. She was up early Wednesday morning (6AM) and texted me and I suggested a walk and we went on it. She had been having contractions for the last day and she was ready for the baby to come. We got back to our house and I got her a coffee and she took a sip and hit the bathroom and then called her husband, woke him up and said lets go to the hospital. We got the three kids and they left. They arrived at the hospital at 8AM and Kya was born 58 minutes later! We had the kids for two days and tonight Mom, Dad and the four kids are home safe and my wife and I am looking for a good nights sleep...before our daughter and the kids (Dad working) descend on us again tomorrow.

So you can probably guess why I haven't made much progress :yawning_face: and don't know when I will.

1 Like

If you haven't yet, I suggest go check Mysensors forum for tips with the modules. Personally I'm not interested in the platform as it seems somehow convoluted to me but they've got years of experience primarily using those modules.

Congrats on your next grandparent level, grandpa. :smile:

I have to apologise to @dynamicdave for instigating the demise of this thread into OT silliness.


The choice of words. :trophy: :rofl: