Go Down

Topic: Arduino + nRF24L01 (Read 12 times) previous topic - next topic

terrancelim

hi, i am just started using nRF24L01,
i just want know can Arduino use this device communicated with pic16fXXX?
any one have the example?

maniacbug


The simplest way to do so would take the information that comes from potentiometers (analogRead between 0 and 1023) and send it immediately by nRF24L01, right.?


Yup.  Just pack it up into a payload and off you go.  Each payload can go up to 32 bytes, so plenty of space for most everything you'd want to send to control a robot, I'd imagine.

Spare yourself the hassle of working out all the registers, and use a library.  There is the mirf library on the playground.  I also wrote my own at http://maniacbug.github.com/RF24/ .  In any case, all of cpixip's advice is sound, though I wouldn't recommend sending each value separately.


Flavio21

The simplest way to do so would take the information that comes from potentiometers (analogRead between 0 and 1023) and send it immediately by nRF24L01, right.?

200ft Not bad, not expecting much ..
xD

maniacbug



  • From my experience, even in close range you will get some loss of signal. nRF24L01 data links are not reliable for transmission ranges larger than about 2-3m and if there is no direct line of sight between the transceivers. (That's probably why these units feature the autotransmission ability.)




I've found them to be quite good even at distance.  Right now I am running a test of 2 units, separated by at least 200ft, on opposite ends of my house and on different floors.  My test sent 5000 10-byte packets spaced at 250ms.  180 packets were completely lost, even exhausting all the retries.  All the rest made it through OK.

cpixip

Hi Flavio - that is basically the opposite of what I have described in my previous example. Sadly, I do not have the time to work out an example for you, but you might consider to implement something along the following points:


  • You can read the potentiometers with Arduino's analogRead.

  • This gives you a 10-bit value for each of your 4 channels.

  • You can store the 10-bit value of each channel in 2 bytes. This gives you a total of 2*4=8 bytes to transmit.

  • The nRF24L01 is able to transmit these 8 bytes in a single transmission, including CRC-check and - utilizing Shockburst - automatic retransmission if the initial transmission fails. In your case, this is a much better approach than the single byte transmission I sketched above (which is much slower and does not utilize the nRF24L01-buildin error-checking).

  • From my experience, even in close range you will get some loss of signal. nRF24L01 data links are not reliable for transmission ranges larger than about 2-3m and if there is no direct line of sight between the transceivers. (That's probably why these units feature the autotransmission ability.)

  • So make sure at the receiving end that in case no transmission is received, or if a corrupted transmission is received, your robot stops.

  • If you can, try to use modules with real antennas, not modules with antennas which are printed or soldered on the circuitboard.

  • Try to reduce the datarate as much as you can (1MHz or even lower) - this will increase the link stability and range a little bit.



Maybe some other board members have some code or information to share...

Go Up