Тёмный

Raspberry Pi Pico and the nRF24L01 radio module - how to get this working with MicroPython 

Kevin McAleer
Подписаться 32 тыс.
Просмотров 25 тыс.
50% 1

Do you want to know how to use the Raspberry Pi Pico with nRF24L01 radio modules, how to wire it up and the MicroPython code? Then watch this video.
In this video I'll take you through how to setup an nRF24L01 module (either the version with the antenna or without), how to write the MicroPython code and the library you will need. I'll then demo a small test program to show it sending a full message between the devices.
This video was made possible by 52pi.net
Here are the links to the Raspberry Pi Pico Starter kits featured in this video:
www.amazon.co.uk/dp/B09CM397YW
www.amazon.co.uk/dp/B097266214
www.amazon.co.jp/dp/B093WJR6V1...
www.amazon.co.jp/dp/B0972L153G...
For more information, tutorials, parts and more visit:
www.smarsfan.com​
To join the membership at bronze, silver or gold levels, head over to
www.smarsfan.com/membership
Enjoy this video? Buy me a coffee!
www.buymeacoffee.com/kevinmca...
Follow me on Instagram - @kevinmcaleer
/ kevinmcaleer
Follow me on Twitter - @kevsmac
/ kevsmac
Join the Facebook group - Small Robots
/ smallrobots
Music by Epidemic Sounds
www.epidemicsound.com/referra...
nRF24L01 MicroPython Code on GitHub:
www.github.com/kevinmcaleer/n...
Chapters
00:00 Intro
00:18 Overview
00:30 Bench Cam
09:33 Code Running
09:51 Wiring up the nRF24L01+ Modules to the Pico
#Pico​ #MicroPython​ #nrf24l01

Развлечения

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

 

5 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 73   
@philippeplourde406
@philippeplourde406 2 года назад
You deserve more followers! I've watched tons of tutorials and this is among the best of them. I really appreciate the clear, quick explanations of each lines. I've learned a lot and I'm eager for more!
@kevinmcaleer28
@kevinmcaleer28 2 года назад
Thank you! I really appreciate that!
@raymondmichael4987
@raymondmichael4987 2 года назад
I totally agree, Subed to the channel
@kevinmcaleer28
@kevinmcaleer28 2 года назад
@@raymondmichael4987 Thanks Raymond!
@chrisn1847
@chrisn1847 Год назад
Thank you very much for taking the time to make this video! Two points of constructive encouragement: The on-board IRQ which is designed for an LED activates on the hardware level when data is transferred. So it would be redundant and delay you unnecessarily to activate it yourself. Secondly, the nrf24l01 library "send" function has a boolean return. If it fails once it will attempt to transfer again. If it fails twice then it will return a boolean false. So you don't need to check if your 20 bytes, in this case (max of 32 I believe), of data failed to transfer. Great video! Hope this helps
@fallenrepublic6342
@fallenrepublic6342 Год назад
super cool....thanks for letting us have your code...i learn alot by looking through good working code...(less of a programmer more of a stitcher...i am so newb)
@mandyli3844
@mandyli3844 2 года назад
Raspberry Pi Pico is very helpful for learning programming
@corazonblanco6873
@corazonblanco6873 8 месяцев назад
i use esp32 s2 mini connected with esp32 wroom 32 and it works!! Thankyou for the tutorial!!!!!
@johnchinner7980
@johnchinner7980 2 года назад
Hi Kevin, great video. Looking forward to trying this myself. Can i ask, are you pinouts viewed from above? I have the LNA module, with the pins coming "down" from the PCB (Opposite side to the RF connector). Viewed from above, (looking at RF connector side,) is pin 1 top left? Cheers
@fujiwarachoki
@fujiwarachoki Месяц назад
Amazing!!
@deusprogrammer_thekingofspace
@deusprogrammer_thekingofspace 2 года назад
I’m assuming you need those breakout boards with the regulators for it to work? I tried to use it with just the modules and it fails to send. And that’s even with just using the test program provided with the driver. Or does your code do something different that the test program doesn’t do?
@gedtoon6451
@gedtoon6451 2 года назад
I assume your adaptor has an on-board 3v3 regulator? This can provide more current than the pico 3.3v output.. To get the benefit from the on-board regulator, you need to power the adaptor from 5V. The misi, moso and clk signals will still be 3.3v, so no chance of damaging the pico.
@daehojeon4140
@daehojeon4140 Год назад
When using nrf2401 through raspberry pico, can the value of the gyro sensor be transmitted through RF communication? And the code in the video is too complicated, is there a simpler code?
@ozkanakbas4805
@ozkanakbas4805 11 месяцев назад
I want to change the speed and power settings of the module, but there are few settings. It says on the receiver side of the PA LNA module that it is up to -95dbm. How can I do these settings, thanks
@sethmenn7815
@sethmenn7815 Год назад
Hi, do you think it would be possible to have a Raspberry Pico and Raspberry Pi communicate with each other over the SPI interface?
@eledikohabib3369
@eledikohabib3369 2 года назад
Hi Kevin...can you make video about Nrf51822 interfacing with Pico with BLE and Radio demo
@amiramir-mt3de
@amiramir-mt3de Год назад
Hi, does this library work on esp8266 or esp32?
@iseosalvadormartinezgonzal4690
@iseosalvadormartinezgonzal4690 2 года назад
Hi Kevin I need to send data from the ADC how can I do it ?
@Sportacus01
@Sportacus01 2 года назад
Great video! The sending part i think I got working but when I start the resiving program it just "loads" and says: MPY: soft reboot Initialising the nRF24L0+ Module And the program gets stuck. I wired everything according to your schematic. Any help would be really appreciated!
@kevinmcaleer28
@kevinmcaleer28 2 года назад
What version of the firmware is loaded? I found there was some issues with earlier micropython firmware.
@josemariaterrazasmarino3190
@josemariaterrazasmarino3190 2 года назад
great project Kevin. how I could modify the speed and channel of the modules? thanks for the explanation
@kevinmcaleer28
@kevinmcaleer28 2 года назад
The channel is just that unique id they use to talk. The actual RF channel is fixed in hardware (due to country defined RF legislation)
@yxhankun
@yxhankun Год назад
but there is already pico W! Is nrf24l01 or pico with W better?
@walangpart2
@walangpart2 Год назад
hello there sir! you should have just set SPI() with parameters for its mosi , sck and etc. those pinouts you should us are actually the default so just to make it less messy, I suggest setting up you preffered spi pins first
@mikeaelbrecht1907
@mikeaelbrecht1907 11 месяцев назад
I have a problem where when I send the data I receive nothing and the sender gives an error that the message was not send, but when I disconnect the power from the module at the receiver's end I receive data but not how it should be received.... Any idea what might be causing this?
@BQAggie2006
@BQAggie2006 2 года назад
Any way you could do a video on LoRa either with the RFM9x modules or the UART LoRa modules?
@kevinmcaleer28
@kevinmcaleer28 2 года назад
I’ll add that to the ideas list. I’ll have to get hold of some of those modules
@alokgkp
@alokgkp 2 года назад
Hi Kevin, so we don't need pairing for transmitter and receiver , If there are many modules transmitting and receiving in same work environment/ location how it will figure the receiver which signal from module it need to communicate, thanks
@kevinmcaleer28
@kevinmcaleer28 2 года назад
It’s all todo with the pipe ID - that’s the channel that the modules send and receive to.
@alokgkp
@alokgkp 2 года назад
@@kevinmcaleer28 Hi Kevin,I am novice so excuse me, where we can get this pipe ID
@kevinmcaleer28
@kevinmcaleer28 2 года назад
@@alokgkp Sure - no worries. In the video at 09:34 you'll see two lines 'send_pipe' and 'receive_pipe'; the transmitter node will transmit on the 'send_pipe' and listen on the 'receive_pipe', whereas the receiver node will switch them around. If you have more than one device listening to the same receive pipes they will all get the same message - which can be desired in some use-cases.
@alokgkp
@alokgkp 2 года назад
@@kevinmcaleer28 Hi Kevin thanks, as this module support up to 1100 meters, If I am controlling receiver from far I.e. 500 meter like any irrigation system but I don't know if in that radius someone else using the same device , my question is how my receiver module Will identify the sender , do other people around me using same module Will get same message, is this secure
@kevinmcaleer28
@kevinmcaleer28 2 года назад
@@alokgkp Think of it that this is the mechanics of how data is transmitted - encryption and security can be added to this by change the data before its sent and after its received. People can always listen into the data being transmitted over the air. The encryption could simple be like a caeser cypher where you change the data byte by one value and then shift it back at the other end. Or something much more elaborate. I did a video on simple encryption for people wanting to store Wifi usernames and passwords on Picos, that could be used for this too (ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-fl3UNaUoYzc.html)
@Euforia706
@Euforia706 2 года назад
Could this work for CircuitPython? I mean, if I import the library in my circuitpython proyect, could it work?
@kevinmcaleer28
@kevinmcaleer28 2 года назад
Best way is to give it a try. I had a quick look and there is a circuit python library someone has written - circuitpython-nrf24l01.readthedocs.io/en/latest/
@Euforia706
@Euforia706 2 года назад
@@kevinmcaleer28 Thanks!!
@anaclaudiapelomundo5545
@anaclaudiapelomundo5545 Год назад
Thanks for the video. Do you know any extension to upload files to ESP32?
@kevinmcaleer28
@kevinmcaleer28 Год назад
I think you can do this with Thonny, not sure about VS Code
@anaclaudiapelomundo5545
@anaclaudiapelomundo5545 Год назад
@@kevinmcaleer28 Thanks!
@jaydebkarmakar624
@jaydebkarmakar624 Год назад
is it possible to establish communication between Arduino and Raspberry Pi Pico through nrf24l01 module ??
@kevinmcaleer28
@kevinmcaleer28 Год назад
Totally!
@raymondmichael4987
@raymondmichael4987 2 года назад
If you can help; How will I go about connecting Rfid reader like RC522 and NRF24L01 on the same pico? Greetings from Tanzania 🇹🇿
@kevinmcaleer28
@kevinmcaleer28 2 года назад
I'll order some of these and then do a video about it - how does that sound?
@raymondmichael4987
@raymondmichael4987 2 года назад
@@kevinmcaleer28, that sounds good; actually better than I expected. Thanks buddy, stay blessed
@melcushnahan618
@melcushnahan618 2 года назад
Hi thanks for this tutorial it is just what I needed but I have run into an issue. When I run the code for both send and receive both print the message "Initialising the nRF24L0+ Module", but when the send tries to send anything it fails everytime. I have printed out the OSerror exception and it just says "send failed". To try to debug I have tried a number of nrf2401 chips and I actually found I have a copy of dud ones as they wouldn't even initialise, I also found if I wire the pins incorrectly the chip won't initialise so I think I have good chips and wiring correct because I get the message they have initialised but after that nothing, I have also swapped the roles but again that had the same result the nrf.send command always fails. Do you have any suggestions on what I could try? Thanks
@kevinmcaleer28
@kevinmcaleer28 2 года назад
Try swapping the rx and tx round on one end
@davidbell9470
@davidbell9470 2 года назад
Hey did you manage to get this working? Also having the exact same issue :)
@melcushnahan618
@melcushnahan618 2 года назад
@@davidbell9470 sorry no but haven't really had much time to look at it
@chipmunk1066
@chipmunk1066 Год назад
@@kevinmcaleer28 i have the same error, i swapped the MISO and MOSI around when they're around the wrong way i get the error "OSError: nRF24L01+ Hardware not responding", when they're correct i get the error: "Initialising the nRF24L0+ Module sending message. Yello world send Sorry message not sent"
@maxgreger1099
@maxgreger1099 Год назад
@@chipmunk1066 I'm struggling with the exact same problem. Did you already find a solution?
@freddiessayers7713
@freddiessayers7713 Год назад
does anyone know why I get the error hardware not responding and how to fix it?
@kdt85
@kdt85 5 месяцев назад
did you fix it?
@So-Now
@So-Now 2 года назад
No module named 'nrf24l01'
@kevinmcaleer28
@kevinmcaleer28 2 года назад
Hi Stewart - I’m not sure what you mean? The nRF24L01 is a really common module.
@So-Now
@So-Now 2 года назад
@@kevinmcaleer28 That is the error message I get when I run the example code.
@kevinmcaleer28
@kevinmcaleer28 2 года назад
@@So-Now and did you upload the code to the Pico so it can find it, think I talk about that around the 8 minute mark.
@dylanballback6074
@dylanballback6074 2 года назад
You swapped pins MISO and MOSI in your wiring diagram, caused me a lot of wasted time
@waltyman2247
@waltyman2247 2 года назад
You have saved me! Thanks a lot!!!!
@jimkozma
@jimkozma 2 года назад
Yes, I noticed that the Pico pins were mislabeled, TX and RX reversed, so that matches MISO and MOSI being reversed as well. Confusing, but I guess his wiring should work since both ends are reversed (or mislabeled.) I've yet to try it though.
Далее
Raspberry Pi Pico: nRF24L01 over SPI
19:05
Просмотров 29 тыс.
NRF24 Frustration - Radio module doesn't work?
12:46
Просмотров 88 тыс.
Survive 100 Days In Nuclear Bunker, Win $500,000
32:21
На фейсконтроле 💂
09:41
Просмотров 563 тыс.
The Raspberry Pi Pico WAS Overrated! But that changed!
10:18
Hacking my garage door with the Raspberry Pi Pico W
11:50
Raspberry Pi Pico - Control the (I/O) World
1:03:16
Просмотров 605 тыс.
Это реально работает?!
0:33
Просмотров 1,9 млн