nRF with sensor network

Hi there,

I'm trying to create a project that collect data from multiple sensors, basically one master need to control and collect data from up to 100 devices, using nRF24L01+for radio communication between devices (master <> slave).

Operations order is:

  1. All devices are sleeping;
  2. The master is awakening;
  3. Using the address of each slave, for one by one, it will do next set of instructions:
  • Awake slave;
  • send ack command to slave (optional, or trigger for awake of slave);
  • Receive ack payload;
  • receive data from slave
  • Slaves goes to sleep.
  • master send data to DB;
  • go to next slave (address);
  1. After all slaves has been interrogated, master goes to sleep.

I've done some of this points, but also I have some questions or points that I couldn't solve:

  1. How many slaves I can connect to a single master, directly, without intermediate nodes?
  2. for the moment I send to sleep only the master because I didn't find a way to awake slaves;
  3. How can I perform the sequence of sending ack command (Master=tx, slave =rx), ack payload (master=rx, slave=tx), data from sensors, as structure (master=rx, slave=tx)? I solved sending only ack and payload or only data, but I don't know how to merge this.

Is anyone that can help me?

Thank you.

You have up to 100 slave radio devices.
The simplest architecture is that the master is awake the whole time and the slaves wake themselves up, transmit a payload to the master and sleep again in a cycle.
This is best to preserve the battery life of the slaves.
If you also, for some reason, want the master to sleep, then you have to solve a big synchronisation problem.
How wide, are the slaves spread ? Within a few meters of each other or what ?

5

INT pin on nRF

I don't understand why it should be multiple talking instead of single request from M and S answers with payload.

Why is it 5? Are you perhaps thinking about pipes? You can have many slaves connected to one master as @6v6gt indicates in post #2.

it will be less than 200 m from the widest point.
and, to be honest, the best way to preserve the battery life is to sent all to sleep.

IRQ pin? how? i should put slave uc to sleep and then what?

why only 5?

for some reason I thought about nRF24L01+. never mind.

it is nRF24L01+, but I really don't have any idea why only 5. That's why I asked you why only 5, without any sarcasm...

How are the sensors going to be connected to the arduinos that will drive the nRF24L01+ radios ? There will be maximum cable lengths depending on the protocol etc.
What types of sensors?
Is mains power available at all locations?
Each slave can use the same pipe/channel. You simply have to tag the payload with a unique marker.

I made 20 CO2 sensor devices and have read somewhere nRF24L01+ can physically only 5 other nrfs talking.

they are temperature sensors (DHT11), connected over PCB. I think all this info are not relevant to solve my issue.

anyway, I managed to solve a lot of described steps/issues. Now i have only one more to solve: I want to call all the slave devices one by one, somehow called into a for, like in example:

RF24 radio(2, 4);                              // CE, CSN
const int nmaxslaves  = 2;                   // Max number of BeeHives
int Slave_Address;
const byte Master_Address[6]="11111";
.
.
.
void loop() 
{
  unsigned long start_timer = micros();                    // start the timer
//  Serial.println("=============Start_master===========");
  digitalWrite(LED, HIGH);
//  Slave_Address = 0;
  radio.stopListening();
  for (Slave_Address = 1; Slave_Address <=nmaxslaves; Slave_Address++)
    {
      Serial.print("Slave_Address = ");
      Serial.println(Slave_Address);
      radio.openWritingPipe(Slave_Address); 
      radio.write(&payload, sizeof(payload)); 
      radio.openReadingPipe(0, Master_Address);
      radio.startListening();
      delay(10000);
//      Serial.println("Check Radio");
        if (radio.available())
          {
//            delay(5000);
//            Serial.println("Radio OK");
            radio.read(&BR, sizeof(BR)); 

This example works, but only if the slave address is 1.

int address = 1;

Any ideea why?

Without seeing all the master code and a complete example of a slave, it is difficult to do more than guess that you have not configured all the slaves to match the address that you are using. That one slave works is certainly a good starting point.

Fix your master code so it only addresses one slave at a time and systematically change it to address each slave. Once you know each slave is reachable, then modify your master again.

Unless all the slaves are mains powered, the way you are doing it is going to limit the battery life of the system. Each slave has to be permanently awake to receive any commands from the master.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.