DFRobot Beetle DFR0282 & nRF24L01+ Mesh Networking

I have a half dozen Beetle Arduino's ($8 each)on hand that I picked up some time back just to have on hand. Then I came across these nRF24L01 2.4 GHz wireless cards ($1 each in bulk) and was wondering if it would be possible to use these together for a very cheap and compact remote sensing node using the Mesh24 library. The Beetle has 10 digital I/O's but I'm not sure if we could map them over to the wireless card. The Mesh24 example say 9 and 10 can be changed but "Digital pins 11, 12 and 13 are for SPI and cannot be changed". Any thoughts or suggestions? :o

Pin Assignment nRF24L01:
1 - GND
2 - VCC 3.3V !!! NOT 5V
3 - CE to Arduino pin 9
4 - CSN to Arduino pin 10
5 - SCK to Arduino pin 13
6 - MOSI to Arduino pin 11
7 - MISO to Arduino pin 12
8 - UNUSED

Beetle Pins:
Sscreen Digital Analog
RX 0
TX 1
SDA 2
SCL 3
9 9
10 10
11 11
A0 A0 A0
A1 A1 A1
A2 A2 A2

The ICSP header should have the SPI pins that you need(SCK, MOSI, MISO) then 9 and 10 for the chip selects.

Look at iBoardRF24. GitHub - andykarpov/iBoardRF24: Arduino driver for nRF24L01 on the iTeadStudio iBoard .
There is also a iBoardRF24Network. GitHub - andykarpov/iBoardRF24Network: Network Layer for nRF24L01(+) Radios on iTeadStudio iBoard
I don't know about a mesh layer.
Anyway, the iboardRF24 libraries allow you to use any pins you want for the SPI.

I found a good article on the ICSP header pinout. I’ll research this and see where it leads me this weekend. Thanks for the quick response and suggestions.

Arduino ICSP programming header pinout

However, finding the actual pinout on the Arduino site seemed to be almost impossible.

Oh, that's funny. It's only on the schematic of most of the boards on the Products page.
http://www.arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf
See the header labeled "ICSP" above the Atmega328P-PU chip?

The DFRobot Beetle is supposed to be compatible with the Arduino Leonardo. With what I've learned from you all I now have a better understanding and direction.

PS. I found the schematic for the Leonardo but it's not as clear as the Uno you posted Crossroads. Thanks to all!

Yes, the Leonardo schematic allows for 2 processor package types, leadless (-XUMU) and leaded (-XUAU).

Not sure what the XU is supposed to represent, the MU and AU are pretty clear.
http://www.digikey.com/product-search/en/integrated-circuits-ics/embedded-microcontrollers/2556109?k=atmega32u4
The datasheet only refers to RC or not RC:

ATmega16U4-AU External XTAL
ATmega16U4RC-AU Internal Calib. RC
ATmega16U4-MU External XTAL
ATmega16U4RC-MU Internal Calib. RC

Well I've got the Mesh24 example (Base & 1 Node) chatting up a storm at great distances inside the house running on two Arduino Mega’s. To date my testing on the Beetle hasn't been the best. I power up the base then the node running on a Beetle. The base receives one data set and then nothing. I just ordered some 10uf & 47uf surface mount capacitors I'll add to the Grd. & 3.3vdc terminals on the radio to see if that helps. I've got to get this working on the Beetle to make it cost effective for my project. :confused:

Beetle bottom side and how I hooked the ICSP.

nRF24L Radio Hookup.png

nRF24L Radio Hookup.png

I thought the nRF radios were 3.3V but the pins were 5V tolerant. Also, did you connect CE and CSN?

Sorry for the omissions, CE & CSN connect to 9 &10 and I'm running a 3.3vdc regulator off the 5vdc supply.

Try switching the CE and CSN pins. I have been having trouble finding out which is which.

Ok. So you have the radios connected and they only receive 1 message and then stop. Correct?
Can you post the exact code you are using and actual pictures of your setup?

Right now I'm just useing the Mesh24 library example code (Base & 1 Node). On the Beetle the base receives one transmit cycle and stops. Right now I'm testing with two Mega's which works perfectly so I'll have to rebuild the circuit on the Beetle before I can send you pics of the circuit. When I do I'll also try reversing 9 & 10 as suggested to see what happens.

Thanks,

Results with Beetle

Mesh24 Channel 60; Address 1; Starting Mesh24 Radio...
76566 msg=0201FC0000000003000000A74100808B
device=2 temperature=3 voltage=-1mV uptime=0s

I tried reversing 9 and 10, completely fails. When I test this with 2 Mega boards the above is repeated every second.

PS. Since I tied into the USB ICSP pins you have to unplug the radio to upload your code then plug the radio.

Is that a voltage divider I see on the Beetle board? Do not use voltage dividers as regulators. To get enough current, you have to nearly short-circuit the power supply. A few diodes should work. The NRF chip will operate from 1.9V to 3.6V.

You were right on the money, I put some diodes in series from +5vdc with a cap and 100k ohm resistor to ground. I have a stable 3.4vdc to the transceiver and it's working perfectly. Now when I receive the surface mount capacitors and 3.3 vdc regulator I ordered I'll be good to go. This setup will be very cost effective. Thanks for all the help!

Results on Base:
19027 msg=0201FC0000000003000000A74100808B
device=2 temperature=3 voltage=-1mV uptime=0s
20030 msg=0201FC010000000100FF03F13AD690ED
device=2 temperature=1 voltage=1101mV uptime=1s
21031 msg=0201FC0200000001000000D9ACB7E0BE
device=2 temperature=1 voltage=-1mV uptime=2s
22035 msg=0201FC030000000100FD032A0CB5BA9B
device=2 temperature=1 voltage=1103mV uptime=3s
23037 msg=0201FC040000000100000082B731C4D7
device=2 temperature=1 voltage=-1mV uptime=4s
24040 msg=0201FC050000000100FE03C8DA069C84
device=2 temperature=1 voltage=1102mV uptime=5s
25042 msg=0201FC060000000100FF03D88E058660
device=2 temperature=1 voltage=1101mV uptime=6s
26044 msg=0201FC070000000100FE03FE09E5D6F0
device=2 temperature=1 voltage=1102mV uptime=7s
27046 msg=0201FC080000000200FC03432FF3D63E
device=2 temperature=2 voltage=1104mV uptime=8s
28049 msg=0201FC09000000010000004D04A4F7F6
device=2 temperature=1 voltage=-1mV uptime=9s
29051 msg=0201FC0A0000000100FF03989816B14D
device=2 temperature=1 voltage=1101mV uptime=10s
30054 msg=0201FC0B0000000200FF03553C7CC28B
device=2 temperature=2 voltage=1101mV uptime=11s
31056 msg=0201FC0C0000000100FE038C125DEA6E
device=2 temperature=1 voltage=1102mV uptime=12s

Glad it works! So the project is a wireless voltmeter? Can you post the completed project on the gallery?
EDIT And just wondering, why the 100K resistor to ground?

No the project will be an inexpensive to deploy mesh network of sensors, switches, controls etc., right now I've just been using the example code to get the Beetle to work. With this setup the Beetle & nRF24L01 the cost can be around $12 per node and the way it's wired we have 1 digital and 3 analog I/O's remaining to program on the Beetle. For more demanding nodes we could use another board.

Very interesting. Will the NRF24L01 have enough range? (You could get the PA variant)