I have a set of arduino UNOs and a set of NRF24L01 extended range modules which I have been able to program for one way communication by just connecting all eight pins directly to the MC. Now, I recently purchased the I2C shields that supposedly "simplifies the communication alot" but I find that to be ridiculous. The only thing that has worked is this example: [YouTube Link, Code in description.] which I have just copied and pasted. When I try to modify anything, it stops working.
I am in desperate need of a tutorial, a data sheet or instructions or anything regarding this module. I have looked everywhere on the internet and have found nothing. The only thing I have found is how to communicate between two arduinos via i2c, but the examples presented don't work either.
I am on the verge of tossing these to the trash. This is my last resort. Please help, thanks.
Im sorry guys for rambling like that yesterday I had spent the whole day working on it with no avail until this morning at 3 AM and I was already frustrated. My hardware consists of two UNOs, two NRF24L01 modules, and two NRF24L01 Wireless Shield SPI to IIC I2C TWI Interfaces which don't really have a part number either, but I know they they are made by icstation. The I2C shields are these: [SPI to I2C by icStation] and there is a data sheet with a bit of basic information.
The idea of this shield is to simplify the communication process between two or more NRF24L01 modules. Now instead of using the SPI.h, nRF24L01.h etc, we will only use wire.h which is used for I2C communication. The address for both of these modules is 35, and when there is no data being transmitted by the user, the default conversation is simply (0x47).
I have now made the modules work and I am able to send a three digit numbers from one NRF to the other using "unsigned char", or a single letter using "char", like this:
[Snippet of code only]
unsigned char DataRX = 125;
Wire.write(DataTX);
This prints out 125 on the other module's serial. I have also tried sending a float number (12.6), but on the other end I only get 12 without the .6. I believe this is just standard I2C communication, the same as wired, I just haven't ever worked with I2C before.
How do you send a four digit number via I2C? how about a string "Hello"? or a (12.6) float?
Thank you all, if you can point me in the right direction I would truly appreciate it. If you all need more information let me know and Ill post it.
daniel__gl:
Im sorry guys for rambling like that yesterday I had spent the whole day working on it with no avail until this morning at 3 AM and I was already frustrated. My hardware consists of two UNOs, two NRF24L01 modules, and two NRF24L01 Wireless Shield SPI to IIC I2C TWI Interfaces which don't really have a part number either, but I know they they are made by icstation. The I2C shields are these: [SPI to I2C by icStation] and there is a data sheet with a bit of basic information.
That sounds like using a train to get a Boeing 737 from Manchester to London.
I got my nRF24s to work by following this tutorial
hahah I know right? I did see that tutorial before and I have read it completely. Its the one I used initially to set up my program before the shields arrived. Furthermore my program was already running and communicating partially the way I wanted it, I just needed to figure out how to open up a second pipe to receive data and have two way communication. The only problem I had with this set up was, when I used the NRF in MAX power mode, the range almost vanished completely unless I wrapped my hand around the antenna, so I set up power to LOW. Im assuming that the range is reduced by setting power to this level, and by using the shields I haven't had any problems with range. Also it has an onboard 3.3v regulator.
Once the I2C Shields arrived I had to start all over again, this time programming everything in I2C. Here is where all hell broke loose because I don't know how to even make sense of how I2C works and the tutorials don't make sense either because they don't explain how data is transmitted. All I know is that I2C begins communication by asking for a byte then reading data. But how do I know what the incoming data is? Is everything sent at once? If I want to send a value of 100, then a value of 200 in an array, how does it work?
I wish it was as easy as "radio.write(array, sizeof(array));" but I2C does not work like that. Am i making sense?
daniel__gl:
I wish it was as easy as "radio.write(array, sizeof(array));" but I2C does not work like that. Am i making sense?
I will only say that if it was my project I would dump the I2C shield.
out how to open up a second pipe to receive data and have two way communication
You don't need a second pipe to get 2-way communication. I just use the writeAckPayload() function on the slave and it sends data back without even needing to change between listening and writing.
As a general comment, it is seldom practical to solve a complex problem by adding further complexity that you are just as unfamiliar with. In this case, if you were just asking a question about nRF24 code I may be able to help. But I know nothing about I2C or your shield and I have no idea whether your problem is in the I2C system or in the nRF24 system.
I am starting to think the same thing, maybe these shields are not a good idea after all, they save room because it uses less wires but waste a whole bunch more time for somebody with no experience; i2c is more complex to make it communicate more than one variable. The thing I liked about these is the onboard regulator and the status leds but I think ill just order some hardware and make my own pcb shield that consists of just a regulator, status leds and thats it, no I2C.
By the way I had no clue you could use the same pipe for return communication! I was thinking since at the beginning I set the open.readingpipe(pipe) for the rx and open.writingpipe(pipe) for the tx, it was strictly one way communication. So with writeAckPayload() I can write as much information back to the rx? or does it have any kind of limitation? The idea for my project, for now is to send two, three digit numbers to the rx, and then have the rx send back a different three digit float value.
Also, have you ever had any range problems when you set the power level on the NRF to HIGH or MAX? I have read forums where people say that it could be a noisy 3.3v power input but I'm still not sure what the problem really is. At this point I have already installed the recommended capacitor across the power pins like everybody recommends. The communication works great on power level LOW but I want to switch to MAX because I need as much range as possible.
BINGO!!!! I will be definitely be using the payload function. Thank you so much for your help Robin2 that was the missing piece, now whats left is the MAX power issue which I think or hope will be resolved with the use of a 3.3v regulator.
I will definitely run back to this thread if I have any questions!
I purchased a couple of these boards just to see what they were about. I stumbled into this thread looking for info and I am adding this note for anyone else who also ends up here.
NRF24L01 Wireless Shield SPI to I2C Interface
The idea of this board is to provide an I2C interface to the NRF24 to make it simpler to use. This board contains an ATMega48 which talks to the NRF24 via SPI and provides an I2C interface to it.
The example code does work, but just lets you send one byte at a time between two units. There is no information about other commands that might let you configure the NRF24 (like set the radio number). For this to be of any value, the source code for the firmware in the ATMega48 should have been published or at least a document showing the commands that (presumably) the ATMega48 recognizes for configuring NRF24 settings.
This board may have been a good idea, reducing the pins needed to control an NRF24 from 5 (SPI) to 2 (I2C) but it has failed due to lack of documentation and source code.
Guys I need step by step tutorial about getting these shields work with nrf24l01.
Any help will be appreciated.
To answer Robin2:
The advantage of using the shield is less number of cables from Arduino (7-8 with nrf24l01 vs 4 with shields).
So far I could not manage to make them (shields) work.
The problem is some people are telling the codes should be uploaded to shields, if you check these youtubes:
On the other hand, if you check this:
And on page 6 check the information bar at the end of the arduino IDE.
You will see the selected board is not atmega48 (the MCU of the shield),
but the arduino MCU that shield is connected.
The atmega48 on the shield should already have the firmware.
I guess these codes (Zambetti codes) should be uploaded to Arduino UNO (or to others).
Schematics + pcb layout + some notes on the operation
I could not find anything related to the firmware, code for the atmega48 or how to program it with arduino UNO.
Anyway, so much effort and so few fruits.
Maybe the shields I bought were broken or some kind of connection problem with my jumper wires...
After my final trial, I guess the problem is related to the shield not being able to drive
my specific nrf24l01 chips.
Arduino sends data to shield, I see the red led on the shield, but nothing on the nrf24l01 chip (pcb actually)
I tried separately nrf24l01 s and they are ok.
Some people mentioned about putting a capacitor between the legs of nrf24s
But well enough for me.