1-Day Project: Arduino and nRF24L01+ Data Transceiver

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
morning all and today I'm going to do a one-day project to try and use these little wireless transceiver modules the n RF 24 lo1 plus modules so here are some of the standard modules that have the PCB antenna and also I have this high power module which I opened in my post bag number six video that comes with its own and tenor and there's a power amplifier on the board I also have this which is some sort of interface unit for the NRF modules but I've since done some reading on this and I don't think there's any code in here someone is someone has made code for this thing but I'm not intending to use that today I got a couple of these base boards and these are for the NRF modules to plug in and they provide a nice easy access to the data pins and also a 3.3 volt regulator to provide a power source for this thing that these things are apparently a bit flaky on the 3.3 volts so there are lots of capacitors on here as well but I don't think I'm going to use these today because for people watching this video that don't have these it would be the wrong thing to do I think now also here I've got a couple of ribbon cable strips I normally tear these into runs of 10 we only need eight but I'll just keep them as ten I've got a uno this is a clone uno I like this one because it has both the female and the male pins and my wire strips are only female to female and also here I've got a nano with a nano breakout board again that gives me the male pins so that I can attach my female headers I just need to solder this nano onto its head of strips so just going back to my post bag number six video where I opened the high-power transceiver I had a little conversation with super Dale and super Dale was saying how he'd Howard these things up and got them to work and I said which library did you use and he said this one which is the maniac burg RF 24 library and he also pointed me to this link which goes to a page let me go to the top of that and that gives lots of information on how to use these n RF 24 lo1 transceiver modules so one of the first things you come across in the how-to is no two power problems people have been having trouble with this thing because of the 3.3 volts connect a point 1 microfarad to 10 microfarad capacitor directly on the module from 3.3 volts to ground and this provides a little sort of power supply local charge source so that when the transceiver fires up and starts transmitting and draws a lot of current it has some pool of energy that it can draw on so I'm going to put those capacitors on right away because I just don't want to have any problems with intermittency so I can do that right now so soldering iron warming up I'm going to use a 3 point 3 micro farad tantalum capacitor for fairly obvious reasons I've got quite a lot of them and I've got my an RF module ready to be soldered on to now the capacitor will go directly between ground and 3.3 volt VCC pins 1 and 2 so brown and red here pin 1 you can see is identified by that bit of silks that silkscreens square on the corner there and it goes 1 2 and then 3 4 5 6 7 8 so the capacitor I'm going to put on the top side of the board directly on pins 1 and 2 so there's my 3 point 3 micro farad capacitor soldered between pins 1 & 2 1 is ground 2 is VCC 3.3 volts got to get the press to the right way around of course I've done that on two of the modules and while I was at it I just salted the header on my nano as well so I think we're done with the soldering iron now we can get on with the wiring so just flipping through the how-to we've got some nice photos there including the high power transceiver unit and then you come to this diagram of the pins the board layout with its pins and also this chart which shows the RF module pins and the signal names on the Left color codes for the wiring I'm going to stick rigidly to those color codes so Brown is one red is - to make things nice and easy and the Arduino pins for the RF 24 library so it looks like from this column we're going to be using 9 10 13 11 12 and possibly 2 but I don't think we're going to use the irq line so I've already connected up one of the ribbon cables to the first NRF module Brown red orange yellow and so on and that follows this numbering sequence where you can see the pin number and The Associated signal and also the way the pins are actually laid out on the board it's 1 2 3 4 5 6 7 8 so I've connected the first two wires which are brown and red Brown goes to ground now crucially important let me get a pencil yes critically important is that the NRF modules are 3.3 volt so I've connected my red wire there to 3.3 volts not 5 volts now they have 5 volt tolerant data lines so when I start connecting up all the D connections here it doesn't matter that we're squirting 5 volts signals into the data inputs because they're 5 volt tolerant but the VCC must be 3.3 now where does this 3.3 come from well it comes from this chip here the CH 340 USB to serial driver actually has a 3.3 volt inside it this one here is a five volt regulator for the the high voltage input there so this is where 3.3 volt comes from doesn't have huge amounts of power but apparently according to the how-to it's enough for these regular modules the one with the onboard antenna probably isn't enough of the high power one with the external antenna but there it is read on 3.3 volts so now let's start connect amp the rest of the signals so what do we go up we've got orange on nine yellow on 10 and then there's a break so let's do those two first yes a fact it's orange on nine yellow on ten blue on eleven purple on twelve and green on thirteen and those are all visible from that table there so now I've connected an identical ribbon cable to this second transceiver module but there's a bit of an issue with the 3.3 volts on the Nano and the breakout board it seems that the 3.3 volts here on the nano this pin here comes from the CH 340 chip usb-to-serial chip here but it doesn't go anywhere on where it plugs into the breakout board 3.3 volts is available on these pins here but that appears to come from this 3.3 volt regulator on the board now I don't suppose that matters it doesn't matter where the 3.3 volts comes from and that's the only accessible point that has a male pin so I'm going to take the 3.3 volts on the ground for pins 1 and 2 from here and then the remaining connectors will go on to the digital's in exactly the same way as I did for the uno so scrolling down on this how to and we're reminded that there are problems with 3.3 volts stick your capacitor across pins 1 & 2 and a reminder here in red VCC must go to 3.3 volts not 5 okay so now we come to software and libraries and of course the first thing to do is to go to github and get the RF 24 library and install it in my arduino ide so get maniac bugs excellent RF 24 library download it here that takes me to maniac bug r 24 on github and down here there is the download zip button so i'm going to do that i probably won't go through the entire process of installing this where's that yes that's downloaded there de carros 24 master if you go back to the how-to it does give information on renaming the or is it renaming the zip folder that comes down removing the master bit and so on it's all there the main issue seems to be characters like dashes which have to be removed so i've just shorten that to RF 24 i've gone into my ide and installed it so now in examples and come down right down to the bottom I've just nudged the mouse where is it RF 24 and there are a set of examples files that can be installed into the arduino so on how to it says see our page about installing libraries here that's fine when you have the library installed you can run the examples below and i think that's what i'm going to do i'm not going to use the examples that came in with the library and use these examples there are two here there's a transmit joystick example and a bit further down there's the receive joystick what this is doing is it's taking two analog pins here they are a 0 and a 1 and transmitting the values that are on those analog pins to the other arduino and then they are in the receive file they are printed using serial print so they'll go to the print monitor so let's load those two pieces of code in i'm probably going to have to just simply copy and paste the code straight off this page try to compile it and put it into the to Arduino let's give it a try so the first one I've simply called n RF TX and I've managed to successfully install that into the you know no errors course there's not much indication that it's doing anything apart from the led d13 let me just shield that you can see that that's lit now I can see that that's dimly lit in fact compare it with the on LED so that is flickering that is switching on and off now d13 if you look at this list here pin 13 is s o'clock so there's a little hint there that s clock is actually oscillating so I'm hopeful that that's transmitting let's put the receiver program in the other Arduino and see what we get so here's my other Arduino file which I've called NRF Rx for the receiver and I've just clicked the serial monitor and look what we've got this is a Eureka moment actually got some data coming out of the Nano in this case there's my Nano there with it's a transceiver set to receive the uno now I've just um powered up with one of my little power banks so that's transmitting there's the transceiver for that transceiver for the receiver is here nano and serial monitor data is coming out there now of course on the transmitter you know I've not connected anything to analog pins a 0 and a 1 they're just floating which explains why we're getting this rather nonsensical data but if I just put my finger on analog a 0 and a 1 you can see that immediately we get noise and different data as I sort of connect those analog pins to various other pins so it's definitely working it's definitely reading analog a 0 and a 1 and transmitting the data result so I'm now going to take my stand-alone transmitter consisting of the mobile power bank the uno and the transceiver with it's soldered on capacitor and I'm going to walk it down the hall to the front door and just stick it there on the mat and see whether we can pick it up from that distance so there it is near the front door that's about seven or eight meters away and what have we got yep we're still getting the a 0 and a 1 data coming through time to take it out into the garden I think so I've now put the transmitter on this table in the garden there's the module there and my workshop is down these steps there's my solar power battery bank and the workshop is there can we see the module on the bench not quite Venera let's see if the data is coming through well now this is interesting the data is there if I hold the transceiver up with my hand like that if I push that down onto the bench and let go it says no radio available if I lift it back up we've got the data drop it back down sometimes got the data sometimes no radio available so that seems to be the limit of its transmission which is not unexpected it's about 20 meters with a couple of walls in the way I think that's pretty reasonable and here's the module in my hand I'm trying to show both at the same time if I sort of tilt it no radio tilt it back the other way and we have data so typical of wireless transmission systems highly sensitive to sort of you know orientation and obstacles and things like that but that's sir that's a result in my book
Info
Channel: Julian Ilett
Views: 288,077
Rating: 4.9033818 out of 5
Keywords: Arduino, uno, nano, nRF24L01+
Id: wlhuO82IZjQ
Channel Id: undefined
Length: 15min 25sec (925 seconds)
Published: Fri Aug 08 2014
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.