Тёмный

#73 nRF24L01 Send (and receive) data with your Arduino! 

Ralph S Bacon
Подписаться 54 тыс.
Просмотров 201 тыс.
50% 1

New! ralphbacon.blog
Use your Arduino to transmit (and receive) data reliably with this easy-to-use module.
The nRF24L01 module achieves this beautifully - and with the excellent RF24 library from TMRh20 we can do just about anything you might think of.
However, in this absolute beginners' guide, we just scratch the surface but still managed to produce a useful transmit and receive sketch (originally taken from the above library but simplified even further).
The nRF24L01+ boards (but available in many places):
www.amazon.co.uk/dp/B010N32X3U
The breakout board that prevents power-related issues:
www.amazon.co.uk/gp/product/B...
The library I use is very mature, s/he has several others too. See his/her homepage here, choose the RF24 library as I showed in the video.
github.com/TMRh20 or a copy from here:
github.com/RalphBacon/nRF24L0... or here
github.com/nRF24/RF24 (thanks Ed19601)
Note that there are several good nRF24L01 libraries available out there. If you use another one bear in mind that the pin connections will be different. I chose the one above as it seemed to give us Arduinites a decent interface to the nRF24L01 module without too much mucking around.
My sketches (one for receive, one for transmit) even though both do actually transmit anyway (remember that each module will automatically acknowledge receipt of data unless you specifically switch off that capability - why would you do this?).
IMPORTANT NOTE: thanks to the Eagle Eyes of Arduinite viewer whitefields5595 please remember that pin 10, although not connected to the nRF24L01+ in this demo must NOT be used as a general purpose IO pin - it remains the standard CS pin of the SPI bus - and if that doesn't mean much just remember to leave pin 10 on your Uno or Nano unconnected whilst running this sketch!
------------------------------
DOWNLOAD HERE
------------------------------
github.com/RalphBacon/nRF24L0... --- click the Download button and choose the zip file, unzip and place each sketch in its own folder (of the same name as the sketch) in your usual Arduino sketches folder.

If you like this video please give it a thumbs up, share it and if you're not already subscribed please do so :)
My channel is here:
------------------------------------------------------------------
/ ralphbacon
------------------------------------------------------------------
How can I remember this? Memory tip: "See" Ralph Bacon, geddit?

Наука

Опубликовано:

 

4 фев 2017

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 753   
@oversizedsloth3748
@oversizedsloth3748 4 года назад
Thank you so much for this video! My class really appreciates the content you put out (our teacher showed us this video) and we are looking forward to your future videos.
@RalphBacon
@RalphBacon 4 года назад
I'm glad it helped you and your classmates, GingerSkips! And thanks to your teacher for pointing you to this channel, great to have you along for the Arduinite journey. Thanks for posting.
@eljefe400
@eljefe400 6 лет назад
there are dozens of these nrf tutorials that I have looked through (and tested many). This was the one that made it all work. Excellent Job . thank you so much for sharing. Well done!
@RalphBacon
@RalphBacon 6 лет назад
Wow! that's great news, Jeffrey, although I cannot take all the credit. Albert Einstein famously said "Make it as simple as possible but no simpler". So I do. Once Arduinites have grasped the simplest example they can build on that all by themselves, usually. So thanks for endorsing my "simple" approach (my brain can't handle complex anyway!), appreciated.
@wolenyo
@wolenyo 5 месяцев назад
Oooh, Mr. Ralph, THANKS SO MUCH!! I've watched a lot of tutorials on YT and not a single one has given me code that works, until I found your video. You've now erased hours and hours of frustration that I've accumulated from my other attempts. Great job with this video, Mr. Ralph! I will definitely check out your other videos. Excellent teaching style. Thanks again!!
@RalphBacon
@RalphBacon 5 месяцев назад
Glad it helped! And you're Welcome! Glad you got it working.
@randallknox2141
@randallknox2141 7 лет назад
Ralph--great video! My grandson and I watched it, put together a couple of NRF24L01 circuits, put a send sketch on his laptop and the receive sketch on my laptop and it worked flawlessly the first time. We really appreciate your help. Thanks, Randy
@RalphBacon
@RalphBacon 7 лет назад
Hello Arduinite! I'm currently on vacation 5,000 miles away from home so I'll have to be brief with these comments until my return, mid-July. That's great new Randall, and I'm pleased you're sharing the fun with the younger generation too. Brilliant!
@BOBANDERSON5150
@BOBANDERSON5150 7 лет назад
Thank you for explaining everything down to the smallest details. Made working with these modules so much easier. Getting your example up and running made first, helped me see what goes on in the software. Thanks again, Bob. Subscribed to your channel.
@RalphBacon
@RalphBacon 7 лет назад
Glad you liked it Bob, and thanks so much for subscribing too. I do like these nRF24L01+ modules, they are very powerful, especially the ones that have an external antenna (not needed for most home use unless you live in a castle). Great to hear from you.
@MCGearhead
@MCGearhead 3 года назад
Fantastic tutorial! Very easy to follow and the sketches loaded up and ran without any issues. Thank you!
@RalphBacon
@RalphBacon 3 года назад
Great news!
@tonydonnelly
@tonydonnelly 7 лет назад
I just received my NRF24L01 modules that I ordered off of ebay 4 months ago, so I'm quite anxious to give them a try. Your tutorial is a fantastic jumping off point. Thanks!
@RalphBacon
@RalphBacon 7 лет назад
Yes, indeed, Tony, just follow my video *exactly* and you will have no issues. And if you have not yet bought the (very cheap) adapter plates for these modules do so *now* as it sorts out all the power issues that people stumble over! Great to hear from you.
@minoz55
@minoz55 4 года назад
Thank you! Your video helped me to sort it all out. The tip to open two separate instances of the IDE: Wow!
@RalphBacon
@RalphBacon 4 года назад
And I'm very glad about that, Thomas, if this channel helps in any way then I have succeeded. Thanks so much for posting.
@stevea3717
@stevea3717 7 лет назад
Hello Ralph, thank you for a great tutorial .It worked straight away for me . this is an excellent platform for newbies to start from ,very simple and easy to understand .This can be the basis of many projects. Well Done! Keep those videos coming.
@RalphBacon
@RalphBacon 7 лет назад
Glad you liked the video Steve. +Raad Yacu (see below) reminds us all that the data length is limited to 32 bytes at a time. I will have to look at the libraries for this device to see how they get around that (probably multiple transmits). Thanks for posting!
@topquark22
@topquark22 11 месяцев назад
For the integrated Nano3/nRF24L01 modules, you need to use CE=10 and CSN=9. This is opposite from what's given in all online examples I've seen. It caused me endless confusion until I followed the traces on the board to the pinout of the chip! People need to get in this habit and stop posting confusing information!
@RalphBacon
@RalphBacon 11 месяцев назад
You know how it is, Cut & Paste from one example to another.
@markhill8389
@markhill8389 6 лет назад
Thank you so much for explaining this so clearly, i even learned how to properly add to library. You have made my day.
@RalphBacon
@RalphBacon 6 лет назад
That's great news, Mark, it's not often I get to make someone's day. You may have seen the humorous quote: "I can only please one person per day. Today is not your day. Tomorrow doesn't look good either." How WRONG that is, as you have proved! Seriously, I appreciate the post and it's great to hear from you.
@markhill8389
@markhill8389 6 лет назад
Ralph S Bacon Keep up the good work. I'm definitely guided by your footsteps for this rf project.
@tbddevelops
@tbddevelops 7 лет назад
Really clear tutorial and has encouraged me to pick these back out of my electronics bin. Thank you.
@RalphBacon
@RalphBacon 7 лет назад
Glad it has inspired you to re-try these devices, Terry, they're pretty easy to set up (usually!). Thanks for posting, good to hear from you.
@Vhbaske
@Vhbaske 4 года назад
I tried during a whole month to have some success with the nRF2401 modules, I almost abandoned Arduino programming for my dissilutionment, until, mr. Ralph Bacon appeared in my RU-vid browsing. The first moment, the sketches worked, and he explained here why you make the regular mistakes we make with these modules! Thanks, Mr. Bacon, and may you have good health to keep teaching us as you do.
@RalphBacon
@RalphBacon 4 года назад
I'm very glad it helped you, Pedro, thanks for letting me know of your success!
@airthrow
@airthrow 6 лет назад
By far the best NRF24L01 tutorial on YT, can't believe how frustrating this can be. Hope I am up and running tonight with your assistance, thanks!
@RalphBacon
@RalphBacon 6 лет назад
Let's hope you're successful, do let us know!
@airthrow
@airthrow 6 лет назад
I've got the library installed fine and the transmitter code uploads fine to my Uno! However, the code fails to upload to my pro micro (other example sketches and ones I have written upload to this pro micro fine, but I just bought it)- is the code incompatible with a Pro Micro? Because I was have space constraints with the transmitting device. Thanks for the help, I feel confident with some fiddling I will finally get it!
@RalphBacon
@RalphBacon 6 лет назад
If you have selected the correct board / CPU / speed etc then it should upload. I choose the Leonardo board for my Pro Micro (from Sparkfun) and my computer even says these on the COM port allocation - check there too, see how it identifies itself. Take care with this board, as it's easy to brick it (I did a video on that too). TBH I'd try a Mega if you can't get this working, you can get one for about £5 / $6.50 from the Far East these days, which will sort out your memory constraints.
@miniminerx
@miniminerx 6 лет назад
I love your videos! The best I have found. Keep it up! I also like how you keep on uploading too.
@RalphBacon
@RalphBacon 6 лет назад
You are most welcome MiniminerX, I'm glad you like the videos. Nice to hear from you.
@tonybell1597
@tonybell1597 7 лет назад
Ralph, thank you soooo much for this video, found your channel this weekend...... have been wrestling with these little blighters for for ages, couldn't get anything working, this has re-kindled a project idea I have had a for a while... thanks.... keep up the good work!
@RalphBacon
@RalphBacon 7 лет назад
Welcome Tony! Yes, once you have a demo it all becomes very simple, does it not? I'm hoping your interest extends beyond nRF24's and into all things Arduino, in which you have definitely found a channel for you! Enjoy (and subscribe if you think this is for you). Good to hear from you.
@asaadiftikhar6564
@asaadiftikhar6564 5 лет назад
This is the only useful tutorial for beginners on RU-vid. Bless you man!
@RalphBacon
@RalphBacon 5 лет назад
You are most welcome Asaad Iftikhar, I'm glad you like the video. Nice to hear from you.
@fasihullahsaleem
@fasihullahsaleem 3 месяца назад
Great Sir, I have watched so much videos and non of them worked for me. I thought it maybe due to the noise but your single code worked for me and my wasted days are paid off. Thank You Sir.
@RalphBacon
@RalphBacon 3 месяца назад
Glad it helped!
@markchurch8037
@markchurch8037 7 лет назад
I found this tutorial very clear to understand well explained in layman's terms for us beginners i look forward to viewing more of your tutorials in the near future, Thank you very much Ralph . Mark
@RalphBacon
@RalphBacon 7 лет назад
Thanks for your kind words, Mark, I'm very glad you found it clear and easy to understand - especially for beginners. That is the whole point of my RU-vid channel. Great to hear from you.
@shiister
@shiister 6 лет назад
Thank you for this video. I am using this to confirm all the NRF24L01 I ordered are functioning.
@RalphBacon
@RalphBacon 6 лет назад
Yes, indeed, shiister, this would be a very good sketch to prove that the units work as expected. Thanks for suggesting this and for posting.
@stevenalbright3363
@stevenalbright3363 7 лет назад
Thank you very much, this really got me understanding the NRF24L01 and its up and running great.
@RalphBacon
@RalphBacon 7 лет назад
Hello Arduinite! I'm currently on vacation 5,000 miles away from home so I'll have to be brief with these comments until my return, mid-July. Glad it helped you, Steven, that's what this channel is all about!
@JulioSalim
@JulioSalim 6 лет назад
Excellent explanation. I've just reproduced at my lab with two Arduinos Pro Mini and it is working very well.
@RalphBacon
@RalphBacon 6 лет назад
Excellent news, Julio. Did you use the adapters to plug in the nRF24L01 modules? If not, get some (they are very cheap, I got mine from Amazon) and prevent lots of problems due to the power being insufficient at anything above Minimum Power Level!
@robertpatton6700
@robertpatton6700 7 лет назад
The video helped, I had stayed away from the nRF24L01 as they seemed to complicated. Thanks I plan to order some and give it a try.
@RalphBacon
@RalphBacon 7 лет назад
That's great news Robert! Let's face it, if you replicate exactly what I had in the video (with or without the adapter although I recommend those too, especially for anything other than low power usage) then it's going to work. So you have a working prototype that you can then enhance it to suit. Glad you feel inspired, thanks for posting.
@jeffbeck6501
@jeffbeck6501 6 лет назад
AFTER 1,000,000 TRIES, WITH 100,000 PIECES OF CODE, THIS IS THE FIRST ONE THAT WORKED. THANKS. I have never had a harder time with a piece of code and devices. How ridiculous this took so long. It must have been just a combination of many things. I can now finally do stuff. Great tutorial. Subscribed. Thumbs up. Thanks.
@RalphBacon
@RalphBacon 6 лет назад
I can feel your relief from here, Jeff, and it is so rewarding that I can help people get their projects off the ground. Thank you so much for posting this, it's feedback like this that keeps me going! One caveat: are you using the plug-in adapter boards for this device? If not, do yourself a huge favour and get them, they are really cheap (even on Amazon) and stop any power supply-related problems down the line. Thanks again for posting, great to hear from you.
@jeffbeck6501
@jeffbeck6501 6 лет назад
Absolutely I am using them, thanks. I tried one time for 3 weeks using the high powered versions and I could never even get them working. This time I bought the normal versions, plus the adapters, plus your code, and finally it worked. Now that I have this working, I will go back and test the high powered versions. You do a really great job with your videos. It is the clear thinking and clear explanations that people appreciate. I need to check out some of your other projects. I see one there with EEPROM basics. That was another hurdle I had to get over as well. None of this stuff is simple when you combine all the hardware, software, and gotchas. I don't have a youtube channel but I do have some really cool projects related to some of your stuff. I may send you some links someday so you can check them out. ...because most people I know are just not interested. They just don't get it.
@RalphBacon
@RalphBacon 6 лет назад
Some people "just don't get it" in the same way that I just don't get sport. Really. I just don't care about football, rugby, tennis, golf... the list goes on. I probably watch about 5 minutes of sport a year on the TV. I just don't get it. People are different I guess, thank goodness, imagine if there were more of me! But keep going, Jeff, because you *do* get it.
@Ilikeridin
@Ilikeridin 5 лет назад
Thank you for the tutorial. I’ve watched a bunch but this is the first which I’ve followed. Worked a treat. The only error which I ran into was I used an external power source and forgot to ground a board. Obviously worked straight away once I realised the problem. Again, thank you.
@RalphBacon
@RalphBacon 5 лет назад
Glad it worked, Chris, I hope you're using the adapter boards?!? Cheap and save a lot of heartache.
@Ilikeridin
@Ilikeridin 5 лет назад
Ralph S Bacon I am not. Not been doing this long but a lot of parcels are starting to arrive from China ha. I’ve ordered one today. Couldn’t find one for a Pro Mini, so will make something similar on perf board. Cheers
@RalphBacon
@RalphBacon 5 лет назад
I was referring to the adapter boards for the nRF24L01+ modules. If you use them bare (like I did in my video, I know, bad example) you have to wire them "from underneath", easy to get wires crossed (don't ask me how I know this) and the power for the 3v3 module cannot be successfully supplied by the 3v3 pin from the Arduino unless you're using the lowest power possible (like my demo). Once I got the adapter boards it was *so* much easier to wire up and all power issues disappeared because you supply the adapter board with 5v not 3v3 and the Arduino has enough 5v current to go around!
@Ilikeridin
@Ilikeridin 5 лет назад
Ralph S Bacon I did use the adapter boards but I want to use them within a project with everything powered by 3.3V. So I was considering not using the adapters. So I’m glad you mentioned that, as it probably wouldn’t work. I’ll have to supply the Pro Mini with 5V and take a supply from the source for the nRF24L01+
@rosswaring2835
@rosswaring2835 3 года назад
This video was super helpful in getting my self balancing robot and remote controller to work. I would have spend days sorting it out otherwise! Thanks Ralph!
@RalphBacon
@RalphBacon 3 года назад
Glad it helped!
@nolihernandez
@nolihernandez 4 года назад
nothing compares to British education - great learning resource that actually works mate! thanks!
@RalphBacon
@RalphBacon 4 года назад
Glad it helped, Noli, thanks for posting.
@Zubin19
@Zubin19 7 лет назад
Dear Ralph, Firstly Congratulations and thank you so much on a brilliant piece of work on nrf24l01 module. I have been watching a lot of videos with respect of IOT and especially on Arduino and trust me this was so simple and easy to understand am very sure Albert Einstein, would be super proud of you. I am yet to lay my hands on this both the Arduino & nrf24l01 and will keep you posted on the results that I get. Thank you once again for your efforts, God Bless. Best Regrads Zubin.
@RalphBacon
@RalphBacon 7 лет назад
Glad you found it useful and easy to follow. I think Mr Einstein would say that I could have made it even simpler but, hey, it's a good starting point. When you order the nRF24L01 modules DO remember to order the adapter plates too. Makes everything much easier (and safer) to wire up.
@zubinhakim2147
@zubinhakim2147 7 лет назад
Dear Ralph, I finally managed to build the solution at home and it worked just as expected. I did mess up with the Pins initially as I was doing this exercise by looking at 2 different videos, but then it was good to make a mistake and I realized that using a wrong pin the Transceiver looped into itself. I am yet to receive those adapter plates that you mentioned, they are on their way. Thank you once again for your efforts and time that you took to post this video. I shall keep you posted on my next work that I plan to do on this. I plan to extend this exercise to switch on and off a relay to switch on and off a bulb. Till then Good Bye and God Bless.
@johnmellor6065
@johnmellor6065 4 года назад
just built the above circuit and really made up as this is my first success on arduino wfi using nrf24lo1 thanks alot
@RalphBacon
@RalphBacon 4 года назад
Well done, John, so glad it worked for you. Thanks for posting.
@tino8015
@tino8015 3 года назад
Such a good video, I was about to quit trying to program these antennas, but this video saved me, thanks.
@RalphBacon
@RalphBacon 3 года назад
Great to hear! They are very good modules (but be aware - and beware - that there are fakes out there, always get original Nordic devices).
@tino8015
@tino8015 3 года назад
@@RalphBacon thanks for the answer, and i'm sad to announce that mines might be fake cause I tryed every tutorial out there, copy and pasted the code. But no signal reveived or sent. I will buy some new ones thanks for telling me. Btw I got the ones sold by WayinTop, they are the only on amazon( the ones with the antenna).
@willofirony
@willofirony 7 лет назад
Excellent Video, Ralph. The R24 looks to be a Godsend. They appear to have encapsulated a LOT of admin and distilled the developers contribution to be no more complicated than using Serial. As to dupont cables: positively the worst plasticine I have ever tried to use. Keep up the good work Ralph. Brilliant channel!
@RalphBacon
@RalphBacon 7 лет назад
You're too kind Michael (but I'll take all the praise I can get)! Yes, I like these little RF24 units. I was going to use them to monitor my water tanks et al in the attic but I think I might use an ethernet enabled Arduino instead (my next video, oops, spoiler alert). BTW I like dupont cables (I have dozens, all lengths and configurations) but if you ever strip the insulation hoping to use them as real cables to wire stuff up with, then -- don't! They only have about 6 strands in them! OK for breadboard lash-ups but no good for real project work. Thanks for posting, good to hear from you.
@willofirony
@willofirony 7 лет назад
Thanks for the heads up on stripping Dupont wiring. I have found similar results when trying to strip the cables that come with "wall wart" power supplies. It is almost as if the insulation is just sprayed on to copper strands as fine as human hair. Your thoughts on using ethernet instead of the RF24 units are interesting. I was thinking of using the RF24s in place of ESP2866 wifi units.; having the various nodes communicating with a base which is also in circuit with just one ESP8266. The base would thus handle the IOT & time-of-day admin for all the nodes; including buffering node data, should the WiFi router (or the ISP network) go down temporarily. Do you suspect the reliability of a network of RF24s?
@RalphBacon
@RalphBacon 7 лет назад
I don't suspect the reliability of a network of RF24s but you can only use about six, I think, without creating a mesh. But the same chap who wrote the RF24 library I used also has a library for that. I suspect it's a bit more work for you but you can read up about and then decide. I like the idea though, of a network all controlled by an ESP8266 hub. Your house will be truly part of the IoT movement!
@BenDover-ci2wi
@BenDover-ci2wi 7 лет назад
Thank You very much for this tutorial. I finally menaged to get this thing working :)
@RalphBacon
@RalphBacon 7 лет назад
Hey Ben, I'm trying to interpret your post's meaning: 1. After a lot of trouble following your video, Ralph, I FINALLY got it working anyway. 2. I've had this unit in my box of components for ages and now thanks to your video, Ralph, I've FINALLY got it working. I'm hoping it's #2, especially as you are good enough to post your thanks here, which I humbly accept. Good to hear from you (and I knew what you were saying but it's Sunday afternoon so a bit of humour is OK here, right?).
@BenDover-ci2wi
@BenDover-ci2wi 7 лет назад
Yes it is :) Now I can move on with my project. I subscribed your channel and hope you will keep up the good work.
@1larrydom1
@1larrydom1 7 лет назад
Ralph, just subscribed after watching this video. I am working on getting analog sensor information back to an Arduino in the sun room that runs my irrigation. I didn't want to lay cable to the sensors to cover the 30 feet or so, so I ordered 2 of these to do the trick. Your video helped a great deal as my garden irrigation project is my first one! Just have to now learn how to send the data from the sensors back to the main Arduino. Thank you again for the well thought out presentation.
@RalphBacon
@RalphBacon 7 лет назад
Hello Arduinite! I'm currently on vacation 5,000 miles away from home so I'll have to be brief with these comments until my return, mid-July. I'm so pleased it helped you, Lawrence (Larry?), really I am. Remember that although I have called one a transmitter and one the receiver, they BOTH send data to each other in my demo, it's just the transmitter that initiates the whole process.
@1larrydom1
@1larrydom1 7 лет назад
Ralph - I hope you enjoy holiday, and thanks for the reply. I am awaiting the modules to regulate the 5v to ease the hookup. I certainly do remember that both units talk to each other. Once the modules come, I will start trying to get the soil moisture sensor and the rain sensor to transmit back to the main unit. One idea I had to prevent, or at least slow the corrosion of these sensors, was to power them on only when I need a reading, about once every half hour. Lots to figure out still!! Larry
@RalphBacon
@RalphBacon 7 лет назад
Yes, exactly what I do for my rain sensor. Power it up, take a reading, power off. No noticeable corrosion after several weeks. But mine are not buried in damp soil so your mileage may differ!
@male22male22
@male22male22 3 года назад
@Ralph Thanks for the video, I have a question. 1. which pin in Arduino nano connect to the pin IRQ, and CE in NRF24.
@RalphBacon
@RalphBacon 3 года назад
The Nano is _exactly_ the same as the UNO in this respect, same pins etc.
@pranavshinde9529
@pranavshinde9529 4 года назад
First of all thank you so much, I've been struggling with nrf finally got it working. In my project I'll be controlling a bot with nrf, does the nrf needs to aligned in a certain position for effective tx and Rx.Also the range sometimes suffers even if I move one nrf little bit.
@RalphBacon
@RalphBacon 4 года назад
The position of the nRF24L01 should not be critical. However, a couple of other things are: 1. Are you using the adapter plate so you can run it off 5v? This is a very common source of problems. 2. What power setting did you set in the code? LOW should be OK but try the higher power settings too. Only use MIN for workbench use (about 30cm range).
@mendimano
@mendimano 7 лет назад
Nice tutorial thanks for sharing, I wonder is it possible to send and recive the internet signal or for example the cable TV signal through this system.
@RalphBacon
@RalphBacon 7 лет назад
Not a chance, Armend, sorry! This is not a computer network packet transporter, nor a TV signal repeater either (far too slow). But it is good at transmitting (small packets of) data from one Arduino to another, at moderately high speed (up to 2Mbps) but that's about it. If you think about computer networks, they have a minimum speed these days of 100Mbs and usually 1Gb or higher. Internet TV requires something like 3Mb per second for standard definition and 5Mbps for HD. So... So forget that idea but do use this wonderful device for your Arduino needs,it really does work well (with the adapter boards); especially nice is the auto-confirm and auto-retransmission feature, all without a single line of code! I'll be using this in a future project (after my imminent vacation). *Good question*, though, thanks for posting it here.
@giniterminator
@giniterminator 7 лет назад
Hello Ralph, this is the best explanation about nrf24l01! Just one question. How do you send more the one variable in one package? Thanks.
@RalphBacon
@RalphBacon 7 лет назад
Hi Gustavo! The way I would do it is to send either a concatenated fixed length string of several variables, or, if you can't be sure of the length, separate them with a delimiter such as a "|". Convert all the variables to strings if you do it this way. Then reconstruct them at the receiving end. I might be tempted to use a struct to do this.
@RalphBacon
@RalphBacon 7 лет назад
I think you are limited to 32 bytes of data though... will have to check this.
@billglass5160
@billglass5160 2 года назад
Channel 124 is a good one for me here in Grenoble, France. Thanks for the tip, Ralph!!!
@RalphBacon
@RalphBacon 2 года назад
Fantastic! Well away from microwave ovens!
@billglass5160
@billglass5160 2 года назад
@@RalphBacon Default channel gave short range (2 meters). I live in a WIFI jungle. Channel 124, 2 brick walls, 2nd floor, and my birdnest breadboard yields 0/100 CRC errors. Waiting for LNA with antenna to top this score.
@artbecker5618
@artbecker5618 7 лет назад
I have several of the power adapters shown at 4:26. They can be used without a breadboard by using the 8 connectors on top; 2 each 5v & 3.3v plus 4 ground pins. Stick the pins on the bottom in a piece of non-conductive foam to protect them.
@RalphBacon
@RalphBacon 7 лет назад
A great way of using those power adapters, Art, thanks for pointing this out. A clever piece of lateral thinking, that they don't *need* a breadboard to work! Thanks for the post, others will doubtless find it useful too.
@rodrigoecharren8055
@rodrigoecharren8055 5 лет назад
Hola, es imprescindible usar adaptadores de tension para los pines SPI? Lei en algunos foros que los SPI pueden manejar los 5v de arduino directamente. Gracias.
@RalphBacon
@RalphBacon 5 лет назад
Hola Rodrigo! Es un riesgo Podría funcionar o podría destruir el chip nRF24L01. O podría funcionar por un tiempo y luego fallar de repente. Si solo quieres experimentar, adelante. Pero para un proyecto verdadero, usaría yo un nivelador de voltaje. Gracias por publicar una pregunta interesante. Rodrigo asked whether the 5v Arduino could directly control the nRFL0124's SPI pins without a voltage leveller: It's a risk. It might work or it might destroy the nRF24L01 chip. Or it might work for a while and then suddenly fail. If you just want to experiment then go ahead. But for a true project, I would use a voltage leveller.
@davidbond9360
@davidbond9360 6 лет назад
Hello Ralph, great video, it lead me to success! I've built a remote sensor using the nRFL2401+, is there anyway I can get the nRFL2401+ to tell me when its battery is running low?
@RalphBacon
@RalphBacon 6 лет назад
You can get the Arduino to tell you this by monitoring the battery level on an analog pin, David. I'd use a simple 1K and 10K ohm potential divider for this. Two resistors, the 1K from +ve and the 10K to -ve with the analog pin connected to where the two resistors join. The Arduino can then transmit a data packet that you interpret and that tells you the battery is low. Experiment on a local Arduino so you get the correct measurement. Any good?
@user-zc7yj2kl1f
@user-zc7yj2kl1f 6 лет назад
I enjoyed your video. so i would like to ask a question. I want to control this sensor's signal emission using the clock in the arduino. Because I want to set it up to be transmitted simultaneously with other ultrasonic wave signals. is it possible? if so, I would appreciate it if you could give me the relevant information or source. thank you for great explanations.
@RalphBacon
@RalphBacon 6 лет назад
I'm not totally sure what you're trying to do, Jeong Dong-ho. Describe to me what you want the project to do and I'll see if I can help, ok?
@jameshaefner8880
@jameshaefner8880 7 лет назад
thanks for the video, planning a project using these and it was very helpful! quick question however, where would you adjust the code to have 2 main transmitters and one main receiver? I am thinking of having two separate sensors with arduino nanos transmit different data back to a main arduino mega to process and display the data. Thanks
@RalphBacon
@RalphBacon 7 лет назад
Hey James, glad you found the video useful! As soon as you have multiple transceivers you run into the challenge of logistics; who is sending to whom, when, how often and so on. I would assign your sensor transceivers different channels so that your master controller can then poll for the results every few seconds, minutes or whatever. In fact, the transceivers have 124 channels to choose from (Wi-Fi and microwave interference notwithstanding) and can be used to "channel hop" anyway. So your sensors wait for a "Give me your data request" (in much the same way as my demo showed) and transmit the values back to the master. The master then moves onto the next sensor and repeats the request albeit on a different channel (probably in a simple loop). There are doubtless other ways to do this with a sensor mesh perhaps (there are examples in the library which I must admit to not having read, my requirements being fairly simple), but I've no reason to think my above suggestion would not work with several sensors, all on different channels. I hope this helps and good luck - please post back your success, failure, issues, problems so I (and other readers here) can see what works and what doesn't. Great question!
@jameshaefner8880
@jameshaefner8880 7 лет назад
Thanks for the reply! I have been looking through different videos on simple communication, mesh, and networks to see what will work well for what I am trying to do, and what will also allow for easy expansion after the initial installation (adding additional sensor nodes). I am thinking of moving towards a simple network, but am still doing research and planning for this. Your video was a lot of help in getting started with everything
@jacobendure262
@jacobendure262 6 лет назад
Yes, I also tried a number of NRF24L01 transceiver project some worked but soon after they stopped for no apparent reason. I am quite sure it had to do with interference from other channels so the key difference here is the line: // Use a channel unlikely to be used by Wifi, Microwave ovens etc radio.setChannel(124); I just started it an hour ago and it's still going! Thank you so much !
@RalphBacon
@RalphBacon 6 лет назад
You are most welcome Jacob Endure, I'm glad you like the video and found a solution. Nice to hear from you.
@alisonmccarthy374
@alisonmccarthy374 7 лет назад
I am trying to test out my transmitter and receiver using your set up and no matter what I do I don't seem to be able to get them to 'talk' to each other. The transmitter is continuously outputting "No acknowledgement of transmission - receiving radio device connected? No response received- timeout!" and the Receiver just says the startup line of "THIS IS THE RECEIVER CODE - YOU NEED THE OTHER ARDUINO TO TRANSMIT" I have the bigger NRF24L01+ with the antenna attached and the connection board NRF24L01 YL-106. I saw you said to someone in the comments below that with the attachment board you power it with the 5V port but I am just wondering if I could be doing something else wrong. It seems that the transmitter isn't recognizing the receiver and vice versa
@RalphBacon
@RalphBacon 7 лет назад
Hi Alison, sorry to hear you're having issues. Look at the post in the comments on this video from "nouar" who is also having problems and ensure you have followed the suggestions I have made there first. I have to assume you have wired it up correctly (the pin-out diagram is a TOP view with the wires coming in underneath, so it can be a little confusing). If you are using the adapter board into which you have plugged the nRF24L01, the yes THAT board needs 5volts. The bare module alone needs only 3.3 volts (or you will fry it). Also make sure you have kept the power to both modules to the LOW settings (in my sketch you will see RF24_PA_LOW. You can even change that to RF24_PA_MIN to keep power to an absolute minimum, although the range will be about 30cm / 1ft). Also set the speed of transmission to RF24_250KBPS for the most reliable transmission. So change this line: radio.setDataRate(RF24_2MBPS); replacing the 2MBPS to 250KPS on BOTH sketches. Finally, many users report that the 3.3 volt supply is too noisy to work reliably and solder a capacitor on the module itself between VCC and GND with a value of 1.0µF - 10.0µF. You can solder this directly on the board underneath - it doesn't have to be pretty, you just want it so it doesn't short out - that is why I recommend the plug in adapter boards, it gets round all the power issues. Try all this out and post back! Fingers crossed.
@baswansink7068
@baswansink7068 6 лет назад
Dear Ralph, i have setup a similar setup as your video here, the thing i have is that i'm seeing the "No aknowledgement" message, but on the receiver side it still states "Sent response .." and counting up. what could be the cause of this? I expected that if the transmitting side does not work well, the receiver side doesn't do anything right? At least if i disconnect the transmitter from USB the receiver stops sending out responses, so something reaches the receiver. Any thoughts, many thanks ahead.
@RalphBacon
@RalphBacon 6 лет назад
Well now, Bas, you are sure the receiver is getting the correct value (from the transmitter) but the transmitter is not getting the auto-acknowledgement? I'm firstly assuming you haven't programmed the nRF24L01 to disable that feature as that would be too silly for words. In which case, are you running the nRF24L01's on their adapter boards? If you don't have adapter boards do yourself a huge favour and get some, they are very cheap and solve 99.9999% of all problems with these devices. If you do have the adapter boards already, let me know and I'll think of what else we can do.
@michael__5647
@michael__5647 Год назад
hey, one thing i discovered while working with the nrf24l01 pa lna is that my jumpers where to long, they were about 10cm an that was to much, i soldered everything to a perfboard and now it's working but i got me a lot of grey hairs till i figured this out, winding gnd around mosi and miso should work too
@RalphBacon
@RalphBacon Год назад
Interesting, thanks for the heads up!
@danhcong5234
@danhcong5234 4 года назад
Thanks for sharing. I have got a question. Co D10 pin work in pwm mode with this rf module? Thanks.
@RalphBacon
@RalphBacon 4 года назад
As we are not using pin D10 for the nRF24L01+ I don't see why you could not use for anything you wanted to, including PWM, Danh.
@danhcong5234
@danhcong5234 4 года назад
Ralph S Bacon thanks. I tried this module. One with antenna and one without. I tried indoor, but distance is not far as advertised. Just approximately 6 meters. Do you have any information about this?
@HaseebAdnan0
@HaseebAdnan0 7 месяцев назад
So i commented 2 days and some hours ago that PA+LNA modules were not working. What i had done was i had plugged the antenna into a breadboard to kind of understand better(although it was harder to understand), then the breadboard forwarded the connections to arduino uno, effectively using 2 cables. Turns out my code wasnt working properly because the wire length does matter, cuz we are in the Microseconds. Thanks SIr and the guy who commented about using shorter wires down in the same video!!!
@RalphBacon
@RalphBacon 7 месяцев назад
Does the module not just have a standard IPEX connector, or something else where you connect the antenna directly? Mine certainly have an IPEX connector (I chose them because of this) so no wires to solder at all - precisely because of the issues I knew could be lurking which you have discovered (and fixed 👍)
@HaseebAdnan0
@HaseebAdnan0 7 месяцев назад
idk what ipex means but it could mean 8 pins that are easily connectable, in this case, unlike cameras that need to have an adapter board. I thought it would be easy for me to connect the antenna to the breadboard and remember the configuration 1,3,5,7,2,4,6,8 pins and wire that way.@@RalphBacon
@RalphBacon
@RalphBacon 7 месяцев назад
The IPEX connector is a tiny gold circular connector on board (only about 3mm diameter), to which an aerial cable snaps into: bit.ly/ipex-and-cable But I have also used this type where the antenna screws directly into the module: amzn.to/3GBdxZu Just easier than trying to wire up an antenna.
@HaseebAdnan0
@HaseebAdnan0 7 месяцев назад
@@RalphBacon oh i have an old remote with 2 ipex connectors, it has a fulhan microprocessor which is a chinese company, i couldn't find any documentation for it. But these have screwable antennas here.
@howardtriggs5967
@howardtriggs5967 8 месяцев назад
Thanks for the excellent tutorial, I was very quickly able to get the setup to work with the nRF24L01 modules with the built in aerial, However when I went to swap them out for the PA/LNA modules with the aerials it didn't work - is there any modification I need to get those longer range modules to work? Thanks again
@RalphBacon
@RalphBacon 8 месяцев назад
Glad you got it working but odd about the longer range modules. Mine just used the "standard" IPX connector (as found on some ESP32 modules) and I used the same aerials that I would for an ESP32. The IPX connectors are a bit stubborn so make sure they are connected properly. Unless you have the screw-on type which accept the ESP32-style aerials too, directly. Try getting the BT module(s) working with a simple two-way Arduino sketch to prove the modules are behaving in the manner you expect.
@sameerk12982
@sameerk12982 4 года назад
Hello from India.... Thank you very much Sir for the great tutorial ...I am planning to make water level indicator for water tank in my house which is on first floor and should send data at ground floor... So planning to use this transceiver..your tutorial is great help.
@RalphBacon
@RalphBacon 4 года назад
That sounds like a great way to use this device, Sameer. Good luck with your project.
@neilw2O
@neilw2O 5 лет назад
Thanks Ralph. Like you say, had to jump through hoops to get two USB ports working at the same time. Windows 7 End up swapping the mouse with other USB port forcing driver reload. Then it worked. Is it safe to close the Arduino windows? Unplug USBs last is my guess. We will see. Plug 'em in first? I will try tomorrow..
@RalphBacon
@RalphBacon 5 лет назад
Yes it can be very tricky. Saw your later reply so I guess you have it cracked now!
@Vhbaske
@Vhbaske 4 года назад
I've had some bad luck with the Dupont cables, many fail and some come without continuity from the pack. I am ordering a set that one can make them and includes a special plier. Too many obstacles here, but I am persistent to overcome obstacles.
@RalphBacon
@RalphBacon 4 года назад
I've got the metal pins and sockets and the shrouds (plastic headers) and the correct pliers (not cheap). Whilst I can now make some wonderful cables, Pedro, it is a fairly slow process! But sometimes you need a quality cable. Dupont is only OK for breadboard use, not a permanent project.
@drelmetbrown
@drelmetbrown 4 года назад
Thanks for the video Ralph, very informative and helpful for a newcomer to the subject. I am awaiting arrival of 2 Rf nano's - so no separate tx / rx modules. Have you come across these yet ?
@RalphBacon
@RalphBacon 4 года назад
Do you mean the new Arduino Nano 33 IoT? I've not got any experience with that (yet). A bit pricey for my shallow pockets! It uses via WiFi not the (same frequency) 2.4GHz _bespoke_ comms of the nRF24L01 though. It will be interesting how those communicate; I'd expect that you would have to know the other's IP address.
@drelmetbrown
@drelmetbrown 4 года назад
@@RalphBacon. Sorry no Ralph i was referring to this... www.aliexpress.com/item/32980796969.html?spm=a2g0s.9042311.0.0.785e4c4doapbjE I am a little limited on space so thought this was helpful being integrated all in one. Oh, Nano 33 IoT just had a look at that and may have to play with that one in the future !
@aarongellado9547
@aarongellado9547 5 лет назад
IT WORKS!!! I've been trying multiple tutorials. Yours was the only one that worked for me. Could you try doing an NRF24 network next?
@RalphBacon
@RalphBacon 5 лет назад
You sound surprised, Aaron! No more than me, really. 😱 But I'm not going to do a (mesh) network though, sorry, as I have no need and it just seems like an overly complicated way to send data around! There is a demo sketch in the stuff I put on my GitHub so you could always have a go. May the force be with you... Thanks for posting, good to hear the positive feedback.
@francismwangi5676
@francismwangi5676 5 лет назад
A good tutorial here!But am a bit stuck. I accidentally powered my modules with 5v and am not sure if i damaged them,,,is there a way i can test the modules just to be 100% sure in case anything happened to my modules??Regards.
@RalphBacon
@RalphBacon 5 лет назад
Oh dear. I guess you weren't using the adapter boards I keep banging on about then, Francis? The easiest way to test out your boards is to implement my demo sketch _exactly_ ideally using the adapter boards so you know it's not a silly power issue that is causing it to not work. Luckily these nRF24L01 boards are cheap, so if you have damaged them you can replace pretty cheaply. But please do yourself a favour and buy the adapter boards which are even cheaper and will stop you connecting 5v directly to the board. Good luck!
@KalterKrieger
@KalterKrieger 6 лет назад
Have you ever had modules that dont communicate with eath other? I know every register and every bit of these chips, use them with ARM Cortex M1 CPU and a self written lib. I used th scan bit and found out, that the middle frequency of each channel is not the same in every module. You can improve distance if you shield the chips with a GND plane.
@RalphBacon
@RalphBacon 6 лет назад
I personally have never had that issue, Kalter Krieger, but several reports on the internet (and in the comments here) indicate that some Arduinites have problems - mostly power-related because they did not use the adapter boards but maybe this has something to do with it too. Good tip about the ground plane, thanks for posting and vielen Dank für deine Infos.
@KalterKrieger
@KalterKrieger 6 лет назад
Hello, you accent sounds "British" ;-) The problem is, that these chips are clones. The original ones from Nordic are much more expensive, about 5 USD / pc. I have aprox. 30 of them and only 20 are worht to be used in applications. Schöne Grüße aus Deutschland.
@gaya6352
@gaya6352 3 года назад
Hi Ralph! first of all thank you for sharing this video with us. I would like to ask you a question; is it possible to receive data on the spatial position?
@RalphBacon
@RalphBacon 3 года назад
Do you mean where the other system is positioned, like a GPS signal? If so, then no, although you could install a simple GPS module and send the coordinates back to the initiator, I guess.
@berndlottes9940
@berndlottes9940 4 года назад
Question: Does the normal NRF12L01 without PA, also transmit signal from arduino mega with 11 Potentiometer to 11 Servos+mega, and also receives back the signal of 3 Axis accelerator-shield, for the nextion 3,2 LCD-Kompass? Open area(water) to ca 200meters? are those 2 modules enough to transmit fully connected mega, with up to 32 Potis using digital Inputs or I2C?
@RalphBacon
@RalphBacon 4 года назад
I;m afraid that question is too specific for me to answer, Bernd. As far as I know the nRF24 can only address 6 other devices.
@berndlottes9940
@berndlottes9940 4 года назад
@@RalphBacon , i can tell you it works very well, meanwhile i ve made it, sending 11 Poti-Values over nrf24L01 to other arduino mega(Joy-it), controlling there 11 servos, defined on any of the 54 Digi-Ports, then receiving back Voltage-Value, Direction and Roll-Degrees from Modellship to my handtransmitter, and there makin it visible on nexton Display, works cool, i have 2 timer, 2 Voltages, Rollin in degrees and Compass in Degrees, and also 11 Servo-values displayed on Nextion LCD-Display....mega cool.. at moment im workin on touch-clicks to define min and max-values of each servo over display
@amithababy4745
@amithababy4745 6 лет назад
hi ralph..despite connecting everything properly my rx serial monitor is blank and tx is nor receiving any acknowledgement..what could be the problem?
@RalphBacon
@RalphBacon 6 лет назад
Let us assume that you checked and double-checked your wiring. Your transmitter sends out the character but does not receive an acknowledgement. It continues to wait for a reply character but receives nothing. Is this correct? If you swap the two modules over do you get any change in behaviour? Are you using the adapter boards that allow you to run the nRF24L01s on 5v (a 3.3v regulator is all built in)? They solve 99% of all known problems, which all seem power-related. Do get two adapter boards and try again. So many people have done this and suddenly it all works!
@DrekerboyStudio
@DrekerboyStudio 6 лет назад
hi ralph i am working on a project but i am not the best at coding. so i have a question, can you maybe help me with controlling a arm or a robot wireless with the nrf24l01. but the controller i am using is a wii nunchuk controller.
@RalphBacon
@RalphBacon 6 лет назад
I'm afraid I'm not familiar at all with Wii or their Nunchuk controller. The best place for general help is forum.arduino.cc who have experts aplenty that probably know this stuff inside out. Good luck!
@DrekerboyStudio
@DrekerboyStudio 6 лет назад
ok thx, but can you maybe help me with controlling a robot arm with potentiometers wireless? thanks
@RalphBacon
@RalphBacon 6 лет назад
Controlling it with your phone, you mean? Wirelessly? Well, you could watch videos #36 and #37 which show you how to send stuff (and receive confirmation) from your phone to your Arduino. Once you have mastered that, it's the same as entering a value directly into the Arduino. Not difficult but you must walk before you can run!
@SpeccyMan
@SpeccyMan 6 лет назад
DrekerboyStudio, take a look at this video as it might help point you in the right direction: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-7rcVeFFHcFM.html his example is controlling a single servo with a potentiometer (actually a joystick with 2 but only 1 is used) and NRF24 modules.
@thormarum995
@thormarum995 7 лет назад
Just found your channel and I have a question. I bought 433 MHz modules but they interfere with my weather station and they are very sensitive to noise. I need to transmit a RS-232 signal (5 bytes) from a PC to an Atmel microcontroller. Is this possible using these modules?
@RalphBacon
@RalphBacon 7 лет назад
Hi Thor! Yes, I've found the 433Mhz modules are pretty dumb inasmuch that they interfere with one another as well. You can certainly transmit data from your PC to an Arduino but I have only done this using two Arduinos (one transmitter, one receiver) and using Python on the PC to send data via the standard USB to the transmitter Arduino (all simple stuff). No RS-232. Do you need that or is it just a communications protocol you thought might be required? This is reasonably straightforward, so much so others might benefit with a video on how to do it... let me know exactly your requirements.
@thormarum995
@thormarum995 7 лет назад
Hi Ralph. Thanks for your answer. I'm a modelrailway enthusiast and would like to have small scale 1:87 trucks driving, just like they have at Miniatur Wunderland in Hamburg. If you don't know this please check out their website. You can also find lots of videoes on YT. I control my trains from a PC using homemade MS VB software. Partly using industrial I/O and partly RS-232 communication. My experience is that USB and VB 6.0 is unreliable. In Hamburg they use IR to control their vehicles but I can't get the range I need and therefore thought of radio communication. My plan is to put a receiver in each vehicle and send commands to each vehicle. Each vehicle will have an AtMega 88 to control it's functions as well as receiving data. Each vehicle will have it's own unique address, hence 5 bytes. 1 address byte, 3 bytes data and 1 byte checksum. I'm an electronics engineer so I can make my own hardware, I can develop SW for Atmel and program chips using the Atmel STK-500. I haven't tried using STK-500 with Arduino but it should be possible. Hope this gave you an idea of my project.
@RalphBacon
@RalphBacon 7 лет назад
I don't know about USB and VB6.0 being unreliable as I stopped using VB6 about 10 years ago and now it's just a dim and distant memory! If you used a more recent programming language (Python seems to be the "in-thing" right now) you would have no problems using USB. Python (to me) is a strange mixture of C-like syntax with Visual Basic included (from someone who has never programmed in Python). But you could use the Python "Processing" IDE that is *very* similar to the Arduino IDE (see processing.org/reference/environment/) which I also demonstrate briefly in my video #76 which reads in some Arduino-generated data. Just some thoughts. Once you have cracked the reliability of USB to Arduino then this project is very do-able. Thanks for letting me know the background, a very interesting project you have there.
@giusepperandazzo5357
@giusepperandazzo5357 5 лет назад
Hi Ralph thanks for your tutorial. I'm trying to make these modules work for two days but without results. Everything is wired correctly. The power supply is given by a stabilized power supply at 3.3V. I also put a 470uF capacitor between + and - Unique thing that I didn't try is the adapter boards because I have no one near me. I have to order them. With the oscilloscope, I see that the power is stable....strange very strange. Anyway with your sketches I get: Sent response: Random numbers for example 128 .....in other part I get : Sent: random numbers for example 254 Received: always 0! Any suggestions besides the adapter boards? thanks in advance for your time. Giuseppe
@RalphBacon
@RalphBacon 5 лет назад
OK, Guiseppe, here goes: 1. Check and double check your wiring. Because you are not using the power adapters it is easy to make a mistake because you are wiring from UNDERNEATH the board. I can only strongly recommend that you *buy the adapters*, they are cheap by mail order. And solve all sorts of power issues. 2. Put some debugging statements in the RECEIVER module. So do various Serial.println statements to see what it is receiving and sending back. It can get a bit messy on the Serial Monitor window but it's the only way to see what is going on. Believe me, this demo sketch works just fine. So if it does not work for you it is either power adapter boards and/or wiring that is wrong!
@mohammedzaman1937
@mohammedzaman1937 7 лет назад
nice video! is there a way to turn on/off a led remotely when the temperature reaches a certain level (provided a temp. probe is attached to the arduino)?
@RalphBacon
@RalphBacon 7 лет назад
Certainly you can do this Mohammed. I would get it working first locally, that is, get an Arduino to turn off its own LED when connected to a temperature sensor such as a DHT11 or a DS18B20 (see video #28). That way, you learn how to control the LED first, then you can send that information using a single byte using the nRF24L01 to another Arduino and turn off its LED remotely.
@mohammedzaman1937
@mohammedzaman1937 7 лет назад
thanks for the reply. i am going to video #28....
@mahalakshmipm9308
@mahalakshmipm9308 3 года назад
your video is of great help how do I transmit float value if I use float i am getting error stating missing parameter I am trying to transmit gps coordiantes through nrf24l01
@RalphBacon
@RalphBacon 3 года назад
You need to read up about "structs". Within the struct you define your floating variable(s) and any others (max 32 bytes) and it all just works like it should. The C++ code takes care of what byte goes where. The receiver and transmitter must, of course, use the exact same struct for this to work. In this way, the nRF24 just transmits a bunch of bytes without knowing (or caring) what they are; your Arduino code knows however, and that's the important bit.
@binarybox.binarybox
@binarybox.binarybox 6 лет назад
Today, I connected together a couple of nRF24L01 with adapter boards using two nano arduinos on breakout boards. One unit had a pot and the other nano had a servo connected. Servos cause current surges and need a 10uF 25v cap and without it, the servo doesn't work. I fitted a tantalum cap to both nRF24L01 boards between GND and VCC near the xtal and the servo worked really smoothly. I followed Howtomechatronics video. Dan does say a cap is needed. Hope this helps anyone having problems with the nRF24L01.
@RalphBacon
@RalphBacon 6 лет назад
Excellent, thanks for sharing that useful tip, Binary box.
@user-eu2yf6ij2t
@user-eu2yf6ij2t 2 года назад
Great tutorial. What do you think about encapsulating data for mesh networking with these?
@RalphBacon
@RalphBacon 2 года назад
There are some code examples in the library that deal with mesh networks but I have to admit I've never needed one so have not experimented (yet).
@paulhurd954
@paulhurd954 6 лет назад
Thank you, made things easy to set up. Question about the nrf24lo1 with the extended antenna. Does that just increase its range or does it make receiving/transmitting better. Less prone to interference?
@RalphBacon
@RalphBacon 6 лет назад
Both, I think you'll find to be true, Paul. A better antenna lets more power to be transmitted, and a bigger signal to be received. So it's a win-win on all fronts if you choose one of the walkie-talkie style antennas for these modules. Make sure you use the adaptor plates for these units if you using anything above minimum power though (in fact, at all times)! Good question, thanks for posting.
@paulhurd954
@paulhurd954 6 лет назад
Ralph S Bacon thanks for the response. Makes sense. Could I then use a module with Antenna to do the transmitting(more power) to a module with built in antenna to only receiver data? Or do they need to be identical modules?
@RalphBacon
@RalphBacon 6 лет назад
No, they don't need to be identical but (part of) the benefit of a higher power transmission would be lost, because of the less efficient receiver's aerial. However, either/or is better than no high power aerial, that's for sure - a higher power transmitter will transmit further and a more sensitive receiver will be able to grab a signal from the noise. Do bear in mind that although I've called the sketches "transmitter" and "receiver", they *both* transmit, even if only to auto-acknowledge. And do make sure you use the adapters (I've said it before and I'll say it again!).
@paulhurd954
@paulhurd954 6 лет назад
Ralph S Bacon thanks!!!
@adabill295
@adabill295 7 лет назад
Great project, I have a need for a Garage Door monitor. I have two doors and sometimes ( Not very often, but once is too many) I forget to close the door after I came in. It would be nice to be able to have a display inside showing the position of the doors. It is an attached garage so the doors are about 30 feet away from living area ( through a wall). I would also appreciate an idea ass to how to tell if the garage is not fully closed. What type of sensor to use? I have really appreciated your videos and they come across ( at least to me) in a very understandable manner and you explain everything important like where the specific library you use is located.
@RalphBacon
@RalphBacon 7 лет назад
Hi AdaBill, I'm glad to like the videos! As a (wireless) garage door monitor this would be ideal. You can also use a Hall Effect transistor that responds to a magnet to determine whether the doors are *fully* closed (not left ajar). I've done a video on those too. Even a microswitch would be OK (like I used in my stepper motor project). Anything that could connect to an Arduino that then sends out the correct status via the nRF24L01. Sounds like a nice project. Let us all know when you get it working, right? Thanks for posting!
@adabill295
@adabill295 7 лет назад
Thanks again, I went back and looked at video #55 and I'm in the process of ordering some hall effect sensors to try it out.
@vithuransoccer1
@vithuransoccer1 6 лет назад
Hi, Ralph (or anyone who can help), I'm getting this weird error where my receiver is sending out a response which is just counting up by one all the way up to 254 and then it will reset and start again at 0 and go back up. The transmitter, on the other hand, says there is no acknowledgment of transmission along with the timed out error. I tried switching which Arduino the transmitter and receiver are on but it gave the same error. I'm currently powering both radios from the Arduino's 3.3v. Thanks in advance for any help!
@RalphBacon
@RalphBacon 6 лет назад
Here's my take on this issue, Vithuran: 1) you're powering the nRF24L01s from the 3.3v, something that has caused much misery to many Arduinites. I know it worked in my demo but maybe the boards you have are subtly different. Do yourself a favour and buy the adapter boards. If you live in the UK, Amazon do them for the same price as you can get them for in China (for a pack of 5). In the States maybe the same. Whatever, even from a Far Eastern warehouse, get them and power from 5v. Yes, really. 2) The "receiver" sketch only does something when it has received something from the "transmitter". Check your (dual, as shown in my demo) Serial Monitor (debug) windows and see what is being sent, when and by which module. If you are using my sketches, without alteration, they will work if your power supply to the nRF24L01s is correct, and *your wiring too*, of course! How do you feel about that advice? More money spent but very little of it for a huge problem (probably) solved...
@vithuransoccer1
@vithuransoccer1 6 лет назад
Alright I'll look into the adapter board, thanks for the advice!
@szehenry
@szehenry 6 лет назад
Very clear and simple. Big thanks for making it. Btw, it would even better if you put the wiring section at the end of video to the front. Tks!
@RalphBacon
@RalphBacon 6 лет назад
True, sze Henry, true, and hindsight is a wonderful thing. I think we all should have more of it! But I'm glad you like the video, they are really quite wonderful modules, especially when used with their adapter plates. Thanks for posting.
@mindglow4553
@mindglow4553 4 года назад
your video is very helpful i tried this , but one problem i am facing , data is not receiving on receiver side , i also tried other codes but data transmits but not received plz can you help me about this ,where i did mistake?
@RalphBacon
@RalphBacon 4 года назад
Are using the small plug in adapters for the nRF24L01 modules - an absolute necessity! And cheap. Are you using my two sketches for Transmitter (master) and Receiver (Slave)? If you swap the modules over do you get the same results?
@drelmetbrown
@drelmetbrown 4 года назад
Works well Ralph thanks, didn't initially though but my nano's 3.3v output is 3.5v and i suspect there is noise on the line, scope not to hand at the moment) A 47uf on each nrf sorted for now until i use the adaptors.
@RalphBacon
@RalphBacon 4 года назад
Oh, yes, do get the adapters, Emmett, it just makes using these great transceivers so much easier. Glad you got it all going without them though! Thanks for posting.
@abhinmajix
@abhinmajix 7 лет назад
sir, iam always getting the " No acknowledgement of transmission - receiving radio device connected? No response received - timeout! " message . what may the reason....
@RalphBacon
@RalphBacon 7 лет назад
Hey Abhin Raj! Well, according to some people here you need a *stable, low noise power supply*. And you must test on the low power setting first. You can change the speed setting to radio.setDataRate(RF24_250KBPS); I'm assuming you're using the two sketches I used in the demo otherwise unaltered? Are you using adapters (5v) or connecting up the nRF24L01 units directly to 3.3V?
@BEGRProductions
@BEGRProductions 6 лет назад
**READ** Ok, to try to save everyone the headache I had when trying to replicate this tutorial, follow these steps. 1. DELETE all other RF24 libraries you have on your computer, they're not all the same even if they have the same name and seem to have similar functions. 2. Down Ralphs's folder (includes a wiring schematic, sketches shown in the video, and the library) provided in his description. 3. Add RF24 library from downloaded folder in step 2 4. Open Ralph's sketches and see if they're working as shown in the video. If they are, then tweak to fit your own design. I spent a lot of time trying to make this example work on a different library (same name) I had installed on my computer. It almost worked, but the data got stuck sending it back to the master. Thank you so much Ralph for helping with this excellent, concise and organized tutorial.
@RalphBacon
@RalphBacon 6 лет назад
Thanks for posting this, it will sure help everyone who tries to follow this demo, that's for sure.
@Taran72
@Taran72 5 лет назад
It's definitely helping me! I couldn't get it to work even after I soldered a 10uF capacitor to the NRF module. :) I will follow your instructions and hopefully I'll be ok. :)
@Taran72
@Taran72 5 лет назад
I just did that and it doesn't work: I'm not quite sure why. I tried another code and that other one works. Could it be something about the module I'm using? Maybe it's a cheap brand and it may not be reliable? Is there a way that I can do a step by step check?
@alexliu694
@alexliu694 5 лет назад
@@Taran72 BIG OOF
@Taran72
@Taran72 5 лет назад
@@alexliu694 : I'm learning....just asking a question. :) By the way, since I added this comment I managed to resolve all the issues I had. :)
@hardeei
@hardeei 5 лет назад
Hi, i want to control one dc motor with rotary encoder and wireless communication with nrf24l01. For dc motor its need to be have speed and direction control with rotary encoder( KY-040) on transmitter side and l298n motor controller on receiver side. Please help me in cods for transmitter and receiver.
@RalphBacon
@RalphBacon 5 лет назад
I don't write custom code, Hardeep, but I can help you work out what you need. You need to split this project up into various stages so that you understand what a rotary encoder does (and can do for you), what an nRF24L01+ can do to control a bridge motor controller. My suggestion would be to first _understand_ how a rotary encoder works and how it might adjust the speed of a wired motor on your workbench. It's explained in some detail in video #19.
@victormironescu
@victormironescu 3 года назад
Very clear tutorial, Thank you.
@RalphBacon
@RalphBacon 3 года назад
Glad it was helpful!
@Brandon-qo6mp
@Brandon-qo6mp 3 года назад
Hi Ralph your video has been very helpful on learning the nRF24L01 module as I've been trying to learn them for the past month, however I am still having issues. I am able to get my transmitter to work in the serial monitor but it will always receive "0's". The receiver on the other hand will not work. I've tried swapping the modules, as well as my arduinos. I am also using the adapters as you mentioned in your video and have thoroughly checked my wiring and still have not had any luck. Do you know what I might be doing wrong? One additional note, I noticed that when I have my RF24 radio set to (7, 8) in the transmitter, nothing appears in the serial monitor at all. (Even though I know this wiring is correct and true to my CE and CSN pins). However if I change that radio set to anything else, for ex: (8, 7), (7, 7) (9, 7) etc. without changing any of my wiring, the transmitter will then work in the serial monitor while still receiving 0's. Not sure if this could have something to do with my overall issue or if it's even an issue at all.
@RalphBacon
@RalphBacon 3 года назад
Are you using my two sketches without ANY modifications at all? And you say you are using the adapter plates (so these are connected to 5v)? The transmitter side should tell you what it is trying to send (eg 42) but then also tell you it did not get back an auto-acknowledgement from the receiver. If it does not say this then the receiver has received the value and has auto-acknowledged. The receiver side should receive the SAME value (obviously) and tell you this (or you can put in extra Serial.println statements), add 1 to it and send it back, at which point the transmitter will tell you what it got back. You might need further Serial.println statements just to debug these areas. Step 1. Load the two unmodified sketches into two Arduinos and connect up. Step 2. Power up the transmitter only and check what I said above. Get that working first. Step 3. Power up the receiver and follow the notes above. Keep the two units close (eg within 30cm as you are using very low power in the sketches). You can change that in line 22 of the sketches. Try RF24_PA_LOW rather than RF24_PA_MIN. Most problems are caused by: 1. Not using the power adapter plate (the Arduino cannot supply enough 3v3 current) 2. Wiring errors (I've even done this, oops). 3. Faulty (fake) nRF24L01 modules. I had one (fake) module that failed whilst it was running on my workbench. However, they are cheap so buy a few (not fake ones. but difficult to know. Larger suppliers will probably have genuine products; Chinese warehouses not so). Changing the pin numbers in your sketch doesn't show much except you're getting random results because you are not actually connected to the nRF24L01. If you use the same coloured Dupont cables as I did in the DupontWiring folder in my GitHub (github.com/RalphBacon/nRF24L01-transceiver ) it should help check things.
@Brandon-qo6mp
@Brandon-qo6mp 3 года назад
​@@RalphBacon Hi Ralph thank you so much for your speedy reply. After going through your instructions, I re-downloaded your sketches just in case, tested with serialprints, and then finally realized I made a mistake I wouldn't have noticed on my own. I have been using the adapter plates with the same wiring to my arduino that I had before using them, so one dupont cable was still going from the VCC to 3v3 instead of the 5v. I only realized this after reading your instructions and saw what you including in your first paragraph about the 5v. As soon as I swapped over to the 5v pin I restarted the sketches and things seem to work fine with no issues I was experiencing before. Seems like my issue fell directly into the category of a wiring error haha, but I'm glad I asked because I don't think I would have been able to make that realization on my own. Thank you again for your help and time of thoroughly walking me through this. As I said in my previous comment I've been trying to get my nRF24L01 modules to work for the past month (with only having heard about the adapters a few days ago from your video). So this is a huge win for me.
@RalphBacon
@RalphBacon 3 года назад
Excellent! I'm so glad you got it working. Now the world is your (nRF24L01) oyster!
@LucaDiStefano
@LucaDiStefano 4 года назад
Couldn't be any clearer than this. Thanks :)
@RalphBacon
@RalphBacon 4 года назад
Glad it helped!
@tropicaljantie
@tropicaljantie 7 лет назад
I am going to try to apply this.
@RalphBacon
@RalphBacon 7 лет назад
Indeed, Jan, go for it. BUT please take note of the following, to avoid some of the "speed bumps" that others have come across. 1. Use the adapter plates for the nRF24L01 boards! They avoid all sorts of power issues that manifest themselves, and make it easier to connect the device using Dupont cables (as the cables are on TOP of the board not underneath it). 2. Use the EXACT same sketches that I have used (one as the 'master' transmitter, one as the 'slave' receiver that also transmits back a reply. 3. Use the exact same nRFL01+ transceiver modules that I have used - others have discovered that different modules won't, for example, allow you to transmit at 250kbps (and who knows what other differences there might be!). And do let us know when you have it all up and running! Good luck.
@whitefields5595
@whitefields5595 6 лет назад
Transmission of multiple variables As a give-back to the channel, here is the code to use if you want to transmit multiple variables. It uses structures in C. Note each variable can be any data type and all can be different (int, float, unsigned long). However the max size of the whole package is 32 bytes = 256 bits TRANSMITTER ... // Top of file, in declarations, before SetUp typedef struct{ //declare the structure for transmission int A0; // 16 bits float Temp; // 32 bits unsigned long Heartbeat; // 32 bits // add next one(s) here, but keep total struct package size to 256 bits (= 32 bytes) } xfer; // name of the structure above xfer TXpackage; // TXpackage is a type of structure xfer void loop(){ // read the sensors and put the elements into the structure TXpackage.A0 = analogRead(A0); TXpackage.Temp = sensors.getTempCByIndex(0); // Read Dallas18B20 on OneWire TXpackage.Heartbeat = millis()/1000; //used as a heartbeat to confirm transmission // add the next one(s) here radio.write(&TXpackage, sizeof(TXpackage)); --------------------------------------------------------------------------------------------------------------------------------------- RECEIVER ... // Top of file, in declarations, before SetUp typedef struct{ //echo the structure so variables can be received in the same order int A0; float Temp; unsigned long Heartbeat; } xfer; xfer TXpackage; radio.read(&TXpackage, sizeof(TXpackage));
@RalphBacon
@RalphBacon 6 лет назад
Excellent contribution, whitefields5595, very useful and easy to follow using a struct, an underused data structure that is so easy to use. Thanks for contributing this.
@jzmartin11
@jzmartin11 3 года назад
Makes life a lot easier, thanks
@webslinger2011
@webslinger2011 4 года назад
Nice! I didn't notice there was an option to send audio using an rf24. Gotta explore that in the future.
@RalphBacon
@RalphBacon 4 года назад
Sending audio is tricky. Here you have just 32 bytes max to send in a single packet. Given that a simple .mp3 will have some 4Mb for a quality CD track, that's a LOT of packets. There's probably a better way to send audio, probably BT.
@JulioSalim
@JulioSalim 6 лет назад
Hello Halph, I'd love to see your explanation on using XBee modules in a MESH IoT network. Any plans on that?
@RalphBacon
@RalphBacon 6 лет назад
Can't say I have at the moment, Julio, I'm currently experimenting with Sonoffs and ESP8266 modules and the like. But I shall add it to my list to explore and see whether I can do anything with it in the future. Thanks for posting.
@titan_ss78
@titan_ss78 2 года назад
Thank you for the very clear & helpful video!! I was wondering if you could help me troubleshoot! I have done the project exactly how you have done it and followed every step correctly. However, I am still not able to get the transmission across to the receiver. My transmitter serial will say that there is no acknowledgement and that it has sent the number, but has not received it. My receiver serial will just say that this is the receiver code. I have tried changing the channel that I am on and matching both of them so they are on the same channel. I have even tried to increase and decrease the transmit power. I checked to see if I am getting proper power to the module and I am. One weird thing was that I have the adapter, so I should be able to supply from the 5V, however, when I do so, the transmitter serial will basically keep resetting and showing "no response received" and the "timeout". So, I keep it on the 3.3V supply, regardless of having an adapter and external antenna. I am wondering if it could be the antennas that came with the module, but I have even tried swapping those out as well. I am sorry that this was such a long reply, hopefully, I missed something that you caught. Thank you so much for any feedback!
@RalphBacon
@RalphBacon 2 года назад
No, it's not the antennas if you're running this on a workbench. If you have the adapters, and have plugged them in the right way round (so they extend the adapter plate making it long, not on top of it) then you MUST use 5v, as the board has a 5v to 3v3 regulator. Apart from the adapter plates, the most common problem is the pin wiring. Easy to get them muddled up so you need different colours for each, and write down the colours. Ideally, *keep the colours the same as I have in the pictures* on my GitHub: github.com/RalphBacon/nRF24L01-transceiver/tree/master/DupontWiring The transmitter will show the number it transmitted. The receiver, if it received it, will show the same number, increment it by 1 and send it back, at which point the transmitter will display it. If the transmitter gets no (auto) acknowledgment of the number transmitted it will show the "time out" message. Check the wiring and modules - I've had fakes in the past that just didn't work properly. In the meantime, you need to triple check the wiring, it's easy to get it wrong. I have to say at this point, Gurdeep, that my two sketches most certainly do work, and I've recently used them (adapted) for my storage bins and they "just work".
@titan_ss78
@titan_ss78 2 года назад
@@RalphBacon Hello Ralph, thank you so much for your detailed reply!! Yes, I have triple and quadruple checked my wiring, everything was just not working. I actually tried out another RU-vidr’s sketch and that wouldn’t work either. I believe I probably have fakes, so I will get new ones and try them out again! Thank you again for your reply!
@bohaman.
@bohaman. 4 года назад
I'm really new to this I hope someone can help me. I didn't know and purchased a knock off one of the nRF24L01 so it has different connection in as VCC Ground RX TX and CMD, I was just wondering how do I adjust the Pin in the sketch to make it work? I connect the pins via the RX (0) and TX(1) in the arduino uno. THank you so much
@RalphBacon
@RalphBacon 4 года назад
If the pins are just in a different order on the module connect the correct pin from the Arduino (eg the one designated for TX) to the TX on the module. Alternatively, given that you are new to this, buy some non-knock off ones (they are very cheap) *together with the adapter boards, also super cheap* and then your problems go away for just a few dollars. Sometimes it's sensible to take the easy path to your goal rather than spend hours trying to get something to work (that might never work).
@nixtrainz1845
@nixtrainz1845 7 лет назад
Thanks for the concise description of the nRF24L01 programming. Very informative! I wish I had bought it before I bought the nRF905s. They seem to be designed by the same group. Would you think that the programming of data in/out would be the same for each of the two radios? I would like to read serial data from one Arduino and send commands back from a second Arduino. I have the transmit/receive section of the nRF905 sketch working.now.
@RalphBacon
@RalphBacon 7 лет назад
Hey there, NixTrainz, welcome. I think the programming for each of the two Arduinos would be similar but not identical. After all, they might (well, *must*) transmit on the same channel but use different numbered pipes. And the data you're sending to one Arduino (from the other) is going to be different in format to when the receiving Arduino sends back commands to the initiator. What you could do is identify the common code and put that into a library (or even a simple .h file but don't tell anyone I told you this) just so you don't have to write it twice, and if you do have to amend it, you only update it in one place. The nRF905 is a nice transceiver and can operate in different frequency bands far away from the wi-fi/microwave oven 2.4Ghz band, and usually come with "walkie talkie" type antennas thus giving a greater range. But you're right, the nRF2401L is probably a better (and cheaper) bet for Arduino-type projects.
@RahulKumar-zs2wv
@RahulKumar-zs2wv 6 лет назад
Hi ,how can i use nrf24l01 for many to one communication i.e i want multiple nrf24l01(node side) data will comes to one nrf24l01(gateway side)?
@RalphBacon
@RalphBacon 6 лет назад
You can do this, Rahul, either up to a maximum of six nodes connected pretty much as per my demo, *or* if you need more you will have to create a mesh - something I haven't done but there is an example in the library that I use. It will be a step up from this demo though. I would recommend you get this simple demo working so you understand how it all hangs together before moving onto a mesh radio system (frustration is a common source of project failure!)
@ThuanDuong-pv3xu
@ThuanDuong-pv3xu 6 лет назад
TO; Ralph S Bacon: can you make a video send 3byte( 1 byte address, 2 bytes data) to write or read on a 24C08(the EEPRom of a ardruino ) from other ardruino through 2 modules RF24L01 thank and wait your video?
@RalphBacon
@RalphBacon 6 лет назад
I'll add this to my growing list of suggested video topics, Thuan, thanks for the suggestion.
@whitefields5595
@whitefields5595 6 лет назад
I have been using these a lot over the last few days running on 2 Arduino Pro-Minis (8Mhz 3.3V) both on batteries via 3.3V regulator. The Tx code tends to hang up. The Rx code seems OK. I put a 10uF electrolytic across the 3.3V input on both Tx and Rx chips and all is well with the world. There may be a synchronisation issue with the WiFi chip during the Tx pulse.
@RalphBacon
@RalphBacon 6 лет назад
Most issues seem to centre around the 3.3v power to the modules, especially if users are powering them directly from the (cloned) Arduino board's 3.3v pin which can severely limit the amount (and quality) of power available. The solution that always seems to work is the use of adapter boards so you can power them from 5v and let the on-board regulator take control. You've sort of done a similar thing but I'd still lean towards a proper adapter board which is designed to give enough current even for full power transmissions (and you can then connect the cable from the top too). But this is undoubtedly very useful information, Whitefields, given the large number of queries on this topic so thanks for posting. PS there is a post under this video that details the cloned chips' centre frequency is *not* what it should be - another source of potential problems, maybe?
@whitefields5595
@whitefields5595 6 лет назад
Ralph, I was not clear enough above. I want a low weight, compact portable WiFi so I am running on one single 18650 Li-ion cell to power each my Arduino pro-mini and associated nRF. The power supply to the nRF is via a low drop out (80mV) 3.3 V regulator www.ti.com/lit/ds/symlink/lp2951-n.pdf. I have the 10uF capacitor near to the nRF board. All works well, but I will be lowering the voltage down to 3.0 as the data sheet of the (original!) nRF gives a range of 1.9 > 3.6V. The Pro-Mini has its own on-board regulator so the battery goes straight to this, at least for now. I started off using the adapter boards (see post below) but eventually Arduinites are going to need a specific power supply for their projects so I use these regulators which are made for the 3 common TTL voltage levels. So far reliability is perfect, but I'll let you know how things go at 3.0V which I need to get the most out of the battery. fyi a video or 2 on low voltage / wearable projects would be useful. Thanks again.
@EngrShaukatAliKhanIslampur
@EngrShaukatAliKhanIslampur 6 лет назад
This is Clear and the best explanation. Is it possible to do "Master-less serial or parallel communication between multiple arduinos through Nrf24L01? I'm working on a project that will have more than 10 arduinos. I'm looking for a way to have any of the arduinos broadcast a stream of data to any of the other arduinos at any time. when two or more arduinos are in range, they must automatically connect and start communication. it should be two way communication.
@RalphBacon
@RalphBacon 6 лет назад
You probably need a *mesh network* (and Google can be your best friend here). There is an example, I believe, in the library used in this demo. I didn't go down that route as it's more advanced but may be what you need. I hope this helps.
@pranavshinde9529
@pranavshinde9529 4 года назад
Is it possible that one nrf may transmit perfectly but fail to receive data and vice versa or it is a coding issue , because I have one nrf which is transmitting perfectly and receiver recieves it, but it can't recieve the acknowledgment .
@RalphBacon
@RalphBacon 4 года назад
Anything is possible, Pranav, but if you swap the devices over (so the Tx was the Rx and vice versa) do they still exhibit the same half-working behaviour? In which case it's not the devices, it's your wiring!
@whitefields5595
@whitefields5595 6 лет назад
Ralph, Followed this and it all works OK, so thanks. I bought the bare bones NRF24L01 board in Jan 2018 which may not have been available when you first made this video. The board terminates in 8 holes in a line (not breadboard friendly though as pitch is small), but I wanted minimal size. I soldered wires onto these pins and connected as follows nRF pin 1 is TOP RIGHT if you hold it with the pinouts uppermost and chip facing you .... nRF24L01 pin Arduino pin 1 VCC 3.3 V from external source 2 GND GND 3 CE 7 4 CSN 8 5 SCK 13 6 MOSI 11 7 MISO 12 8 IRQ GND note the IRQ is not used here so tied to GND for safety I did not add any external capacitors or other componentry. If you add this to your next update others will benefit.
@RalphBacon
@RalphBacon 6 лет назад
Interesting development there, whitefields5595. Is it one of these (from AliExpress): www.aliexpress.com/item/2PCS-2-4G-nRF24L01-RFID-Wireless-Transmission-Module-2dBm-1mW-2-4GHz-wireless-adaptor-100m/32848645230.html I notice that you are supplying 3.3v from "an external source" - as long as it's not an Arduino then that will prevent a lot of power-related issues that everyone seems to have (who does not use a 5v adapter board). Thanks for the heads up.
@whitefields5595
@whitefields5595 6 лет назад
Ralph, yes it is similar to the one in your link. I traced the terminations back to the chip. It is not a good idea to use the Arduino as a power supply, and you have pointed this out. I think you should stress it every time as newcomers may become complacent. One of the first things to go wonky is the Arduino's A/D converter. The adapter boards you use are as cheap as chips ;)) so there is no excuse for not doing things correctly. You have to do it right in the project, so start the way you mean to go on. Of course, none of this high moralising is a result of experience as I would never dream of doing it..
@RalphBacon
@RalphBacon 6 лет назад
Ha ha! Of course not, we all do it right first time every time, right? That said, my video shows that I didn't use the adapters for the demo, but I was irritated by the wiring from below and as Amazon were doing them cheap as chips it seemed obvious to try them out. Cranking up the power was then fault free. Thanks for the update, I will take note of these new offerings.
@superfatunicorn4758
@superfatunicorn4758 7 лет назад
Does the transmitting and the receiving Arduino have to be the same? I'm using a nano and an uno and it doesn't seem to work, could that bee the problem?
@RalphBacon
@RalphBacon 7 лет назад
Hello Arduinite! I'm currently on vacation 5,000 miles away from home so I'll have to be brief with these comments until my return, mid-July. Not at all, super fat unicorn! As long as it's an Arduino using an Atmel 328P (which both those units do) then it will work, believe me. Detail the problems you have, specific details, and I'll try to help you on my return from East Malaysia!
@muhammadakoodi
@muhammadakoodi 3 года назад
Hi Do you know what version of the library you had at the time, it seems to have updated and the code doesn't work anymore.
@RalphBacon
@RalphBacon 3 года назад
It should be in my GitHub for this video: github.com/RalphBacon/nRF24L01-transceiver
@kondordv
@kondordv 4 года назад
I was looking for send and receive via AcknowledgePayload, I need this for reducing power consumption, but it is not here.
@RalphBacon
@RalphBacon 4 года назад
I'm not using the ACK payload here, just the general auto-acknowledge but you can add it in fairly easily - but not something for a beginner video. I'm not sure that using the ACK payload is going to reduce your power consumption much though?
@kondordv
@kondordv 4 года назад
@@RalphBacon with ack i send and receive an information just one time per minute this is reducing a lot of radio also of power consumption.
@MyBestDayy
@MyBestDayy 4 года назад
Followed the same procedure and code, but the nrfs are only transmitting data but not receiving it. What should I do , I am really confused?
@RalphBacon
@RalphBacon 4 года назад
Are you using the adapter boards? That is definitely the first step in diagnosing this sort of problem, Akanksha.
@Fogaata
@Fogaata 6 лет назад
Masterful, thank you very much!
@RalphBacon
@RalphBacon 6 лет назад
You are most welcome Fogata, I'm glad you like the video. Nice to hear from you.
@wafiyyahamalyris3523
@wafiyyahamalyris3523 2 года назад
I have problem the node 1 always print "No response received - timeout!" and cant receive anything from node 0, how can i fix this?
@RalphBacon
@RalphBacon 2 года назад
Are you using the adapter plates that allow you to power the devices from 5v? If not, do that first. Does the transmitter send out the value OK? Does the receiver receive that value OK? Does it try and send something back? Is that failure part of the auto-acknowledgement? (The transmitter will expect a 'received' type message behind the scenes - is that the one it is complaining about?). Swap over the two modules to see if the same problem persists.
@MrArslanAhmad97
@MrArslanAhmad97 7 лет назад
Thank you so much Ralph for putting up this tutorial video. I finally got my setup up & working..!! Just one question, how can we send and receive multiple analog data from Tx to Rx? Can you please share me a small example of variable declaration & way to use in the code. Much appreciated !
@RalphBacon
@RalphBacon 7 лет назад
Congrats on getting this working, Arslan. I reckon you can code the next bit without an example, because it is very easy: you are limited to something like 30 characters but just concatenate the data you want into a string (instead of a single character like I am doing) and it should 'just work'. Let me know if it doesn't for you.
@moth3833
@moth3833 5 лет назад
Hi, Can I make the arduino(1)send a signal to another arduino(2) to switch the light that is in the arduino(2)? When the arduino(1) is plugged and closes when unplugged. (sorry for bad english)
@RalphBacon
@RalphBacon 5 лет назад
Yes, the *master* transmitter sends a value to the *slave* receiver and if it is, for example, a value of 2, the slave will switch on one of the GPIO pins to turn on the light. Try it with a LED to show it working.
@moth3833
@moth3833 5 лет назад
@@RalphBacon Thank you very much :)
@gsuresh2u
@gsuresh2u 2 года назад
Good explanation is there any library available for Black Pill ? I mean STM34F401CC or STM32F411CE ?
@RalphBacon
@RalphBacon 2 года назад
It looks like the standard libraries for the STM32 should work - but I'm guessing. This video is a good intro though: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-b1123kz_3MM.html
Далее
NRF24 Frustration - Radio module doesn't work?
12:46
Просмотров 87 тыс.
All About nRF24L01 Modules
11:21
Просмотров 32 тыс.
I built my own computer. by hand.
13:03
Просмотров 1,1 млн
Ultimate nRF24L01 range comparison
38:17
Просмотров 138 тыс.
How To Make 6-Channel Radio Control. Range 2000m+
10:43
NRF24L01 Tips and Tricks - Cheap and Easy Wirless
8:37