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

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 พ.ย. 2024

ความคิดเห็น • 78

  • @philippeplourde406
    @philippeplourde406 3 ปีที่แล้ว +8

    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  3 ปีที่แล้ว

      Thank you! I really appreciate that!

    • @raymondmichael4987
      @raymondmichael4987 3 ปีที่แล้ว +2

      I totally agree,
      Subed to the channel

    • @kevinmcaleer28
      @kevinmcaleer28  3 ปีที่แล้ว +1

      @@raymondmichael4987 Thanks Raymond!

  • @chrisn1847
    @chrisn1847 ปีที่แล้ว +1

    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

  • @mandyli3844
    @mandyli3844 3 ปีที่แล้ว +2

    Raspberry Pi Pico is very helpful for learning programming

  • @corazonblanco6873
    @corazonblanco6873 11 หลายเดือนก่อน

    i use esp32 s2 mini connected with esp32 wroom 32 and it works!! Thankyou for the tutorial!!!!!

  • @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)

  • @gedtoon6451
    @gedtoon6451 3 ปีที่แล้ว +1

    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.

  • @deusprogrammer_thekingofspace
    @deusprogrammer_thekingofspace 2 ปีที่แล้ว +1

    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?

  • @johnchinner7980
    @johnchinner7980 2 ปีที่แล้ว +1

    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

  • @RunningRunner46
    @RunningRunner46 ปีที่แล้ว

    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

  • @josemariaterrazasmarino3190
    @josemariaterrazasmarino3190 2 ปีที่แล้ว +1

    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)

  • @eledikohabib3369
    @eledikohabib3369 3 ปีที่แล้ว +1

    Hi Kevin...can you make video about Nrf51822 interfacing with Pico with BLE and Radio demo

  • @daehojeon4140
    @daehojeon4140 ปีที่แล้ว +1

    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?

  • @anaclaudiapelomundo5545
    @anaclaudiapelomundo5545 2 ปีที่แล้ว +2

    Thanks for the video. Do you know any extension to upload files to ESP32?

  • @ozkanakbas4805
    @ozkanakbas4805 ปีที่แล้ว

    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

  • @alokgkp
    @alokgkp 3 ปีที่แล้ว +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  3 ปีที่แล้ว +2

      It’s all todo with the pipe ID - that’s the channel that the modules send and receive to.

    • @alokgkp
      @alokgkp 3 ปีที่แล้ว +1

      @@kevinmcaleer28 Hi Kevin,I am novice so excuse me, where we can get this pipe ID

    • @kevinmcaleer28
      @kevinmcaleer28  3 ปีที่แล้ว +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 3 ปีที่แล้ว +1

      @@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  3 ปีที่แล้ว +1

      @@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 (th-cam.com/video/fl3UNaUoYzc/w-d-xo.html)

  • @jaydebkarmakar624
    @jaydebkarmakar624 ปีที่แล้ว +1

    is it possible to establish communication between Arduino and Raspberry Pi Pico through nrf24l01 module ??

  • @BQAggie2006
    @BQAggie2006 3 ปีที่แล้ว +1

    Any way you could do a video on LoRa either with the RFM9x modules or the UART LoRa modules?

    • @kevinmcaleer28
      @kevinmcaleer28  3 ปีที่แล้ว +1

      I’ll add that to the ideas list. I’ll have to get hold of some of those modules

  • @Sportacus01
    @Sportacus01 2 ปีที่แล้ว +1

    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.

  • @raymondmichael4987
    @raymondmichael4987 3 ปีที่แล้ว +1

    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  3 ปีที่แล้ว +2

      I'll order some of these and then do a video about it - how does that sound?

    • @raymondmichael4987
      @raymondmichael4987 3 ปีที่แล้ว

      @@kevinmcaleer28, that sounds good; actually better than I expected.
      Thanks buddy, stay blessed

  • @fujiwarachoki
    @fujiwarachoki 4 หลายเดือนก่อน

    Amazing!!

  • @yxhankun
    @yxhankun ปีที่แล้ว

    but there is already pico W! Is nrf24l01 or pico with W better?

  • @skd69
    @skd69 หลายเดือนก่อน

    will it work on raspberry pi zero 2 w

  • @amiramir-mt3de
    @amiramir-mt3de ปีที่แล้ว

    Hi, does this library work on esp8266 or esp32?

  • @sethmenn7815
    @sethmenn7815 2 ปีที่แล้ว

    Hi, do you think it would be possible to have a Raspberry Pico and Raspberry Pi communicate with each other over the SPI interface?

  • @Euforia706
    @Euforia706 2 ปีที่แล้ว +1

    Could this work for CircuitPython?
    I mean, if I import the library in my circuitpython proyect, could it work?

    • @kevinmcaleer28
      @kevinmcaleer28  2 ปีที่แล้ว +1

      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!!

  • @iseosalvadormartinezgonzal4690
    @iseosalvadormartinezgonzal4690 2 ปีที่แล้ว

    Hi Kevin
    I need to send data from the ADC
    how can I do it ?

  • @mikeaelbrecht1907
    @mikeaelbrecht1907 ปีที่แล้ว

    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?

  • @melcushnahan618
    @melcushnahan618 2 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      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?

  • @llicommg4630
    @llicommg4630 2 หลายเดือนก่อน

    I did exactly what you did but I get the OSError: nRF24L01+ Hardware not responding any idea?

    • @kevinmcaleer28
      @kevinmcaleer28  2 หลายเดือนก่อน

      Try swapping over the SDA and SCL cables

    • @llicommg4630
      @llicommg4630 2 หลายเดือนก่อน

      @@kevinmcaleer28 I tried, didn't work.. I tried a lot of other things and I have put a lot of time, I am willing to pay for this hardware working (two Raspberry pico talking with NRF24l01) let me know if you are interested, thank you.

    • @llicommg4630
      @llicommg4630 2 หลายเดือนก่อน

      ⁠@@kevinmcaleer28I did and problem persist… I did too many other things and have spent a lot of time with it, I am willing to pay for this hardware working (two picos communicating each other with NRF24L01) let me know if you could sell me one or know of someone that could.Thank you!

  • @freddiessayers7713
    @freddiessayers7713 ปีที่แล้ว +1

    does anyone know why I get the error hardware not responding and how to fix it?

    • @kdt85
      @kdt85 8 หลายเดือนก่อน

      did you fix it?

  • @So-Now
    @So-Now 2 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      @@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 3 ปีที่แล้ว +5

    You swapped pins MISO and MOSI in your wiring diagram, caused me a lot of wasted time

    • @waltyman2247
      @waltyman2247 3 ปีที่แล้ว +4

      You have saved me! Thanks a lot!!!!

    • @jimkozma
      @jimkozma 2 ปีที่แล้ว +1

      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.