All About nRF24L01 Modules

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in my last tutorial i created a node mcu based duino coin miner it is an awesome little miner that sits on my desk and mines few cents a day however adding this miners to my home network choked my wifi router home appliances and smart devices connected to the router constantly started dropping off to my understanding most of the wireless routers and access points can support up to 250 devices connected at once so what's happening here to clarify my doubts i called my isp the answer they gave me was absolutely shocking only 30 devices can successfully connect and exchange data via their router at any given time bloody hell so to overcome this limitation i added another router to the network to scale up the load but i was not happy with this solution so i did a bit of research and found this nrf24l01 rf trans receiver module which i can use to create a mesh of wirelessly connected microcontrollers in this tutorial i'm going to show you guys how to use this trans receiver module to add wireless communication between two or more arduino boards i will be using this module for many of my upcoming home automation projects bang problem solved [Music] this video is sponsored by pcbway pcbway specializes in manufacturing of very high quality low volume colored pcbs at a very budgetary price in addition to standard pcbs you can order advanced pcbs aluminium pcbs rigid flex pcbs they also provide pcb assembly and other related services which can meet your need at the greatest extent so far i have always used wi-fi for wireless communications between microcontrollers while this is easy enough to do it is not exactly suitable for battery operated nodes wi-fi modules consumes a lot of current while transmitting data plus they also have a slight delay when initiating the transmissions as the module has to first connect to the wi-fi network after getting crippled by the abilities of my wireless router i found this cheap very popular and widely used rf transceiver module which you can hook up to any microcontroller this module is called rf transceiver because a single module can work both as a transmitter and a receiver the module operates at a frequency of 2.4 gigahertz which is one of the ism band which means it is open to use in most of the countries of the world data transfer rate is between 250 kbps to 2 mbps board the module is designed for ultra low power wireless applications it has two power saving modes operating at 22 micro amp and 900 nano amps operating voltage is between 1.9 volt to 3.6 volt all other pins on this board are 5 volt tolerant making it easy to connect to any arduino without using a logic level converter the module has 125 independent rf channels giving the possibility to have a network of 125 independently working modems in one place the module is configured and operated through a serial peripheral interface it uses enhanced shock burst for automatic packet assembly and timing automatic acknowledgement and retransmission of packets the module used in this video has an inbuilt pcb antenna making it compact however you can also buy a variant that supports an external antenna allowing much higher range of about 1000 meter in line of sight now let's have a look at the pin outs and specifications of this module gnd is the ground pin it is generally placed inside a square for easy identification vcc supplies power to the module voltage can range from 1.9 volt to 3.9 volts so you can connect it directly to the 3.3 volt pin of your arduino remember connecting it to the 5 volt pin will likely destroy the module ce or the chip enable is an active high pin when selected the module will either transmit or receive depending upon which mode it is currently in csn or chip select not is an active low pin and is normally kept high when this pin goes low the module begins listening on its spi port for data and processes it accordingly sck or the cl clock it accepts clock pulses provided by the spi bus master mosi or the master out slave in it is the spi input to the module it is used to receive data from the microcontroller miso or the master enslave out it is the spi output from the module it is used to send data to the microcontroller irq it is the intra pin that alerts the master when new data is available for processing in order to get this working we need two such modules and two arduino boards for this tutorial i'm going to use two arduino nanos just remember we cannot use a breadboard with these modules because the pin spacing on these modules are not enough to place it in the middle and if you place it anywhere else then you will end up shorting all the pins this means that you'll either have to solder the wires directly to the module or use some sort of jumper cable the connection is exactly the same on both the transmitter and the receiver end connect the ground pin to negative and vcc pin to the 3.3 pin of arduino the signals generated by these modules are very sensitive to power supply noises adding a decoupling capacitor anything from 10 to 100 micro farad across the power supply line is always a very good idea then connect the csn pin to d8 ce to d9 mosi to d11 miso to d12 and sck to d13 pin of arduino since the module requires a lot of data to transfer it gives the best performance when connected to the hardware spi pin of the microcontroller note that each arduino board has different spi pins that must be connected accordingly have a look at the table on screen for quick reference for this tutorial i'm going to use the tmrs20 rf24 osi layer 2 driver for nrf24l01 on arduino and raspberry pi you can download the library from the link provided in the description below in my first example i'm going to send a character array from one module to the other using a split screen i'm going to demonstrate this example on my left is the transmitter code and on my right is the receiver code let's start by including the spi library followed by the rf modules library just downloaded from the github in the code then we are creating an rf24 object by passing the csn and the c as the two arguments to the radio function next we are creating an area of the addresses that the modules will use to communicate amongst themselves the address can literally be anything however it has to be the same on both the transmitter and the receiver module this is how the rf module know who they are communicating with in the setup section we first initialize the radio object then using the radio.open writing pipe function we set the address of the transmitter which we will use to send the data to the receiver module on the receiving end we use the radio.open reading pipe function with the same address to read the data from the data pipe next we set the power amplifier level since the module in this demo are sitting just next to each other i'm using the minimum level next in the transmitter code we need to tell the module to stop listening using the radio.stop listening function this sets the module as a transmitter on the receiver module we need to start listening using the radio.start listening function this sets the module as a receiver after that in the loop section of the transmitter we send an array of character using the radio.write function and on the receiver and we read the array using the radio.read function and display it on the serial monitor every second in the second example i'm going to light up two leds on the receiver end based on whichever button is pressed on the transmitter end to achieve this i have added two leds on the receiver end and two push button switches on the transmitter end when button b1 is pressed the transmitter sends b1 using the radio.write function and when button b2 is pressed the transmitter sends b2 using the radio.write function to the receiver module the switch statement in the receiver code then lights up the corresponding led based on whichever button is pressed on the transmitter end in my third example i'll show you guys how a single node can act as both transmitter and a receiver just remember you cannot send and receive data at the same time using the stop listening and the start listening function will toggle between sending and receiving of data on the data pipes what's different here from the previous code is that we are creating two pipes or addresses for the bi-directional communication in the setup section we need to define both pipes in a way that the sending address of the first module is the receiving address of the second module and vice versa the receiving address of the first module need to be the sending address of the second module now in the loop section of the first arduino we use the radio.stop listening function to turn the node into a transmitter and send the data using the radio.write function on the receiver end we use the radio.startlistening function to read the incoming data while there is incoming data we read it using the radio.read function then we add a bit of delay to the code after that we set the first arduino to receiver mode using the radio.start listening function and the second arduino to transmitter mode using the radio.stop listening function the data is then displayed on screen using the serial monitor the nrf24l01 plus has a feature called multi saver it is an abbreviation for multiple transmitter single receiver in my fourth example i'm going to show you guys how to connect multiple transmitters to a single receiver in a multi-siever network each rf channel is logically divided into six parallel data channels or data pipes each data pipe has its own unique data pipe address only one data pipe can receive a packet at any time so basically the primary receiver in the middle is collecting data from six different transmitting nodes simultaneously the primary receiver can stop listening at any time and start acting like a transmitter this way you can create a mesh of network where each node can act as a repeater there is a different library called rf24 mesh you need to use to create this mesh network since i don't have that many modules handy at the moment i am unable to show you guys the working bit of it however i will create a second tutorial dedicated just to this mesh network so stay tuned there is a way to conserve battery by sending this module to sleep mode please read through the ping pair underscore sleepy example for more details i have provided the link in the description below these modules work very well when the transmitter and receiver are close to each other if the distance is too big you may lose communication the signals generated by these modules are very sensitive to power supply noises depending upon the amount of noise the communication rate may vary setting the maximum output power can also improve the communication range if there is an obstacle in the line of sight you may see multiple dropouts reducing the data rate can also significantly improved the performance a speed of 250 kbps is more than enough for most of our projects using an external antenna can also significantly improve the transmission rate another potential source of noise for rf circuit is wi-fi especially when someone's network is set to the same channel since wi-fi mostly use the lower frequency channels it is recommended to use the highest 25 channel for your module thanks again for watching this video i hope it helps you if you want to support me you can subscribe to my channel and watch my other videos thanks see you again in my next video bye now
Info
Channel: Crazy Couple DIY
Views: 31,528
Rating: undefined out of 5
Keywords: crazy couple, nRF24L01+ Module, Wirelessly Communicate Between Arduinos, NRF24L01 Tutorial, Arduino Wireless Communication, NRF24L01 Arduino Tutorial, How the nRF24L01 Wireless Transceiver Module Works With Arduino, Arduino, wireless communication between microcontrollers, wireless doorbell, RF433, NRF24, nRF24L01 sleep mode, arduino wireless tutorial, Multiceiver Network, Multiceiver, nrf24L01 Multiceiver, crazy couple diy, arduino (brand), radio module, arduino nrf24l01
Id: LhBIRMMAGGE
Channel Id: undefined
Length: 11min 21sec (681 seconds)
Published: Tue Jun 21 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.