How to make an RF24L01 sensor network and one receiver

Hello this is my first post here, please forgive the mistakes

So I want to do a network of sensors (it will be up to 6 or maybe even 100) based on:
-RF24L01
-pro mini atmega328p
-DS18d20

  • TMRh20 libraries
    They will send their measurements to the main receiver every 1min, arduino uno atmega328p
    My question is whether it is possible or you have some pages where there is something more about it. how to do it?

Because assuming that the sensor will be sleeping, he will wake up for 10ms, send a measurement and go to sleep again.
This RF24L01 has 6 possible ports to read at one time 6 * (minute [ms] / 10ms) = 6 * (60000/10) = 36,000 measurements per minute.
So it is theoretically possible to handle these 100 sensors.
Only just nw how to get on it from the programming side
I found this only is C and not arduino IDE unless (nRF24 Multi-Network – Allowing for 255 addresses « insideGadgets)

I will add that the data from these sensors wants to write probably on the SD card of this main receiver

If you have any other ideas on how you could do it or what other interface to use, I would be very grateful for every clue.
Thank you in advance for every reply

I don't think there is any value in using the nRF24 pipes. Just use a single pipe on the master and have all the slaves send to the same address. That way there is no theoretical limit to the number of slaves.

Where you may run into a problem is if two slaves transmit at the same time - both messages will be garbled. Using multiple pipes does not solve that because there is only one wireless. The more slaves you have the more likely that collisions will arise. You should probably include in your program some code to deal with that problem. You could experiment to see if the normal auto-retry feature is sufficient. I suspect it may not be, especially with a larger number of slaves. But I don't have enough Arduinos and nRF24s to experiment with.

If you want to avoid the risk of data collisions you could put the master in charge and have it poll the slaves in turn. However that does not work so well if the slaves spend a lot of time asleep. See the second example in my tutorial.

...R
Simple nRF24L01+ Tutorial

ok thanks for the suggestions, your guide has already read several times :smiley: a lot of brightens.
And could you cache this data possibly and send it once every 10min etc?
because it is still possible to use atmegi328p memory which will take data from the sensor and give it to RF24L01

Do you think that this is the optimal solution to my problem?

DANYx17:
And could you cache this data possibly and send it once every 10min etc?

If the slaves could cache the data and wake up and listen for (say) 30 seconds every 10 minutes then the master should be able to poll them all within 30 seconds and collect any data from a slave that happened to be awake. In this concept the master would poll the slaves every 15 seconds (say).

All sorts of schemes are possible. The design of a suitable scheme is mainly a matter of clear logical thinking rather than any programming expertise.

...R

ok, can you do that the main receiver asks each sensor, and it responds.
After the first questioning delay they would have done themselves.

or does the receiver have to know all sensor addresses? is it enough that the sensors know the address of the main receiver?

Transmitters code (temperature sensors)

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <JeeLib.h>

#define ONE_WIRE_BUS 2

OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

RF24 radio(9, 10);
const uint64_t pipe = 0xE8E8F0F0E1LL;

void setup(void) {
Serial.begin(9600);
sensors.begin();
radio.begin();
radio.openWritingPipe(pipe);
}

void loop(void)
{
sensors.requestTemperatures();
float temperature = sensors.getTempCByIndex(0);
radio.write(&temperature, sizeof(float));
Sleepy::loseSomeTime(60000);
}

Receiver's code (picked up, will be saved in the future)

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

RF24 radio(9, 10);
const uint64_t pipe = 0xE8E8F0F0E1LL;

void setup(void) {
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(1, pipe);
radio.startListening();
Serial.begin(9600);
Serial.print("Temperature");
delay(1000);
}

void loop(void)
{
if (radio.available()) {
float temperature = 0;
if (!radio.read(&temperature, sizeof(float))) {
Serial.println("ACK not received by client.");
}

Serial.println(temperature);
delay(1000);
}
}

I still do not know how to make the master know which slave sent the data
and then it saves to another file, for example