tinyBrd is small development board, with ATtiny84 and NRF24L01+ connector. With software provided by us, You get easy to use board which can send data by radio to Raspberry Pi or Arduino UNO and run many days (our most recent tests show it will run at least 2-3 weeks in this scenario) on single CR2032 battery.
When in sleep mode whole board with NRF24L01 and DS18B20 takes as low as 5 µA!
Tools and materials
To build this example You will need:
Of course You will need tools like solder iron, wire cutter, etc.
To receive data we suggest use Raspberry Pi and our NRF-Hat – simple board to connect NRF24L01+ directly to RPi, without mess (no cables required).
Nettigo tinyBrd with RPi and NRF-Hat
In recent weeks we did a lot tests to our tinyBrd. This was due to new Nettigo tinyBrd Core (integration with Arduino IDE). With v1.1b release we have lowered current consumption even more.
Now, in sleep mode tinyBrd with NRF24L01+ and DS18B20 takes only 4-5 µA (vs 9-10 µA on previous software). During sending data it takes 15 mA (vs 18 mA before).
Our test case is sending data (temperature) read from DS18B20 to RPi every 30 seconds and tinyBrd is powered by singe coin battery (CR2032). How does it work?
Our tinyBrd has very simple and easy to use interface for NRF24L01 radio. This library was bundled with Nettigo tinyBrd Core, add-on for Arduino IDE to program tinyBrd. Now we have extracted it as standalone and can be used on Arduino UNO and other boards.
Changes are minor, since we need to remove name conflict with bundled Radio library. Arduino IDE library manager was taking our Radio library as library for FM chips. So let us introduce RadioNRF24 library. With library name change we have changed main object name so all old examples are valid, just use new object name:
There is no other changes. With UNO You have use different
RadioNRF24.begin(address, 100, 8, 7);
On tinyBrd CSN i CE are fixed so there is no need to give them in initalizer. That is not true with UNO, so in former example 8 is CSN pin and 7 i CE pin. Exactly as it is shown on following diagram – how to connect NRF24L01 to Arduino.
Connecting nRF24L01 and Arduino
Library is for now available only on GitHub: https://github.com/nettigo/RadioNRF24
We will prepare more easy to use form as .zip file. Also – there are some examples as gists: https://gist.github.com/netmaniac/dfd7eb4f884d58346480. Remember – as for today library bundled in tinyBd Core is still using
Radio name, so all code on tinyBrd should use
Radio.begin and similar. On UNO use
RadioNRF24. In future, we will update tinyBrd Core to use
Check tinyBrd page
All, most current and up to date documentation can be found on tinyBrd documentation page: http://starter-kit.nettigo.eu/tinybrd-documentation/ (since Mar 2016)
At Nettigo we did a lot work with NRF24L01. As a result we created small board, with ATtiny84 on board and connector for NRF24L01.
This board is Arduino IDE compatible (You program it using Arduino IDE, most commands are ported), we have prepared some easy to use library for most important tasks: radio communication, power save modes and more.
With easy to use software interface You can get in few minutes running remote sensor, sending data to central unit and in power save mode using only ~10µA! For example – DS18B20 sensor sending data to central unit each 30 seconds can work on two AA batteries few weeks.
We have prepared some Polish documentation, now we start to translate it to English:
- Install required software to Arduino IDE and on Raspberry Pi (optional): http://starter-kit.nettigo.eu/2015/tinybrd-getting-stuff-installed/
- Build minimalistic temperature sensor working weeks on single CR2032 battery: http://starter-kit.nettigo.eu/2016/wireless-temperature-sensor-programmed-with-arduino-ide/
- How to receive and send data on Arduino using NRF24L01 and tinyBrd Radio library: http://starter-kit.nettigo.eu/2015/using-tinybrd-library-on-arduino-to-connect-via-nrf24l01/
Connecting nRF24L01 and Arduino
Now, when we know nRF24L01 module pinout we can now connect it to Arduino or some other board. Just connect pins on the same name on Arduino board and nRF24L01 wireless module:
Connecting nRF24L01 and Arduino4
There are many options how to connect Your Arduinos wireless. One of options available is – nRF24L01+. It costs only 6zł (1.5 EUR) per node and it allows you to connect many devices without using a single wire. nRF24L01 uses radio waves (in 2.4 GHz band) to contact with other modules.
Modem works on 2.4GHz frequency and has 100m range (at best). You can communicate with different baud rates: 250 kbps, 1 or 2 Mbps. High baud rate allows users even to send video material in 720p resolution (very similar to Youtube). During operation modem uses less power that single LED. During receive power consumption is around 12mA and during transmission 11mA. According to datasheet users can set automatic power saving modes. During this states module consume only 320 µA (when data is waiting for transmission), 26 µA (when there is nothing to send), 0.9 µA (in shutdown).
nRF can operate on voltages between 1.9 and 3.6V. The input pins tolerate the 5V logic, so without any problems this module can be connected to the most popular development boards like Arduino. You don’t have to use any logic level converters when connecting this module to Arduino working in 5V logic. Most models of Arduino (UNO, Mega, Leonardo and more) are working with this logic levels.
Operating bandwidth is divided on 125 channels (separate frequencies). Thanks to this, you can create a network of 125 independently working modems in one place. Every channels has its own address. Well, to be honest it can have up to 6 addresses. This addresses are numbers and they represent specific device connected to network which will receive data. Length of the address can be from 3 to 5 bytes. This gives us the addresses from 24 to 40 bits. With the lowest value of the address it is 17 million combinations. Longer address value can be used as 5 letter names (5 chars at 8 bits give us 40 bits in total).
nRF24L01 automatically creates data packets. You are only sending what you want to the specified address. Modem creates a data packet, which is protected from errors with a CRC. When there’s a problem with sending packet, device automatically will try to send it one more time. If sending is successful, receiving module automatically sends a confirmation to the transmitting module.
nRF24L01 uses SPI interface to communicate with the MCU. It uses 5 wires.
nRF24L01 module is being sold on breakout board with build in antenna. The pcb only requires a connection with the development board or MCU. Size of the whole module is very small (1.55×2.9cm). From the bottom you can see two rows of communication pins.
As it was written before, module communicates with the controller via SPI interface.
- VCC – power – from 1.9 up to 3.3 V
- GND – ground
- MOSI – SPI serial data input
- MISO – SPI serial data output
- SCK – SPI clock
- CSN – low state on this pin indicates that with this module the controller wants to communicate.
- CE – signal activating receiving and transmitting. In receive mode, the high state indicates that he wants to receive. In transmit mode, pulse sends one packet of data.
- IRQ – interrupt output. It does a low state pulse when data is waiting to receive, or when the data was properly sent.