Multiple RFM69HCW in Arduino Mega

Hello everyone,

I was working on a project trying to make a receiver and a transmitter to communicate using 2 arduino uno, 2 rfm69 antennas (1 uno + 1 rf for transmission and 1+1 for reception) and the RadioHead library in order to calculate the RSSI values of these transmissions. .

Now I want to expand my project and want to use a transmitter with the Uno as before, and connect 5 RECEIVERS on an Arduino Mega. My questions are, is it possible to make this connection, 5 RF69 on a Mega? And also, is it possible to do that kind of measurements using the RadioHead code? Or the only way to achieve it, is by using 5 Unos and 5 Instances of the Receiver's code in 5 different USB ports?

Why 5 receivers ? Can’t you use one receiver that responds to multiple transmitters ( as RFM can work as a transmitter/receiver)

No. It's important for the project to get measurements from 5 receivers, placed in specific distances from a source, at the same time.

stevemis:
It's important for the project to get measurements from 5 receivers, placed in specific distances from a source, at the same time.

Whilst at the same time all 5 receivers are connected to the same ATmega ?
So these 5 receivers are all within say, 10-15cm, of each other ?

1 TX and 5 RX sounds backwards. :slight_smile: Please describe your project.

srnet:
Whilst at the same time all 5 receivers are connected to the same ATmega ?
So these 5 receivers are all within say, 10-15cm, of each other ?

Yes, I want 5 receivers placed on a 10cm distance one from the other and about 1m away of the source. I want to get some RSSI measurements to evaluate some formulas. Just that.
I know I can do so using 5 Unos with an RFM on each one of these while running 5 instances of the receiver's code. However it would be much easier if there is a way to do the same process using just 1 Mega with 5 RFMs on it. I just don't know if:

  • it is possible to do that kind of connection ( 5rfms on a Mega)
  • Get somehow 5 measurements, one for each antenna with 1 RX instance

I would not treat the RSSI readings as a precise figure, RFM69s are not calibrated devices.

The difference in RSSI from 1m and 1.1m would be expected to be only 0.8dBm, the variation due to differences between devices and random noise could be maybe up to 2-3dBm.

Why do you want to measure RSSI at such very short distances, I cannot think of a pratical application ?

I know it's not precise. I'm using a sampling process and I get a mean value.
Like I wrote above, I'm trying to evaluate some mathematical formulas. But it doesn't matter what's the purpose.
All i'm asking is if this connection (5 on a Mega) is possible and how am I suppose to connect all the (miso, mosi etc pins ) and if there is a way get measurements from 5 different antennas using only 1 instance of the RX code.
I know I can successfully do so if I use 5 unos in 5 ports, 5 instances and 1 source. However, I have only 2 Unos and 1 Mega at the moment.

Did you try to use 2 RFM69s on the UNO and see if the library supports multiple instances of the same device ?

The answer is likely to be a square law with distance from the transmitter ( if not saturated ) if placed close to the ground or cube law if placed high up .

The answer can’t be anything different.

You would get the best result using the same receiver all the time and moving it about .

srnet:
Did you try to use 2 RFM69s on the UNO and see if the library supports multiple instances of the same device ?

I don't know how to connect 2 RFMs in 1 Arduino (Uno or Mega). 5V and GND are easily connected using a breadboard, however I don't know where to connect MISO, MOSI , etc. (wrote that on a previous reply).
Can I use the breadboard to connect 2 MISO pins from the 2 RFMs , e.g, on pin 13? Or I must use a different pin at the Uno or Mega, for each MISO, MOSI, SCK from the 2 antennas?
If I have to connect each data pin into a different pin port at the Arduino, then the standard library's RX will receive both signals into 1 port. Therefore, I don't think I can get 2 different RSSI measurements, 1 from each RFM.
However, I'm too newbie with the Arduino tech and maybe there is a way, and that's what i'm asking on this topic.

Let's ignore the Mega part.
Can 2 Unos support 2 RFM69 antennas? If yes, where am I suppose to connect the 5 data pins? All at the same pin at the Uno using a breadboard or in different pins?
Secondly, if the connection is possible, how can I get 2 measurements from 2 antennas that send data on my PC using only 1 USB port? (because they are connected on the same Uno)

SPI is a bus system, MISO, MOSI, SCK would connect to both RFM69.

Each RFM69 would then need a seperate SS and IRQ connection.

Since your using the Radiohead library, I would suggest you read the documentation for the library.

I think I successfully made all the connections on 5 RFMs on the Arduino Mega.
My question however is:
When I tested 2 RFMS in 2 Unos, I used the code examples from the RadioHead Library, Radiohead69_RawDemo TX and RX.
Is it possible for these two codes to run for more than 1 receiver and 1 transmitter? I tried a few changes on the receivers code to add 5 rfm antennas, declare the needed pins, etc. But is it possible to make a communicate between 1 transmitter and more than 2 receivers with this example, with some changes? Or do I need a completely new and custom program written by me? I'm really amateur with this kind of stuff to do so...

Anybody who have established a communication between 1 rfm69 transmitter and 2 rfm69 receivers (or more)?

If you wait long enough, there might be someone who reads the forum who has tried multiple RFM69s on the same Arduino, but why you would want to do this is not clear, so maybe not many people have tried it.

You could ask the writers of the Radiohead library, they might know the answer.

Alternativly, since you have the gear to try it, you could try it, its your project ?

srnet:
If you wait long enough, there might be someone who reads the forum who has tried multiple RFM69s on the same Arduino, but why you would want to do this is not clear, so maybe not many people have tried it.

You could ask the writers of the Radiohead library, they might know the answer.

Alternativly, since you have the gear to try it, you could try it, its your project ?

I tried a few changes on the standard code but it was unsuccessful.
My project like I said before is: 1 transmitter on a position and 5 receivers on a circle. I move this circle from 0.1m to 1m distance from the transmitter, and measure the RSSI value of each receiver every 10cm i move the circle. Imagine something like a robot vacuum with 5 receivers on it and moving from 1m distance till right next to the transmitter.
I want to get these measurements of RSSI from each RFM69 during the transmission of a random message to evaluate some mathematical formulas that a college created.

My problem now is that the standard library's code is written for 1 transmitter and 1 receiver. And because i'm really amateur with the arduino's I have no idea if it's possible for the code to be manipulated to work for 5 receivers.

Removed