Raspberry Pi Tutorial 34 - Wireless Pi to Arduino Communication with NRF24L01+ Part 1

preview_player
Показать описание
How to send bytes of data between a Raspberry Pi and Arduino using a NRF24L01+ transceiver! These low cost transceivers allow for communication ranges on the order of 30m using only a few jumper wires.
Рекомендации по теме
Комментарии
Автор

Great tutorial! Raspberry Pi 3 users: note that Ground is at Pin6, different from the diagram in the video. Worked great as soon as I made the change.

RahulPopuri
Автор

Thanks for this video! There's a lot of confusing/problematic info and tutorials out there, this worked perfectly the first time I tried it!

jeffbowles
Автор

Fantastic tutorial, worked out great for me. I would recommend adding "GPIO.cleanup()" to the very end of the program on the RPi due to constant "pin-in-use" warnings before the program is run after previously being executed

burningombre
Автор

Excellent tutorial! Just received my first two NRF24L01 and this was the first video I found. Thanks for sharing!

rgetty
Автор

If it helps anyone i had a lot of trouble with setting the radio on the pi with the python script. The displayed data (printDetails) was not what i set, just random. I added a line in the lib : self.spidev.max_speed_hz = after spidev.open and it fixed it. 1MHz may be a bit conservative but i'm guessing the default speed was just too fast and was causing corrupted data to be set on the radio. All good now and great tutorial!

TheElchardo
Автор

*IMPORTANT FOR PIE 4 B USERS WITH ARUDINO NANO*

and use "radio.begin(0, 17, instead of "radio.begin(0, 17)"

trueToastedCode
Автор

Is it me or the wiring for the Raspberry Pi to NRF24 is wrong ?
Looks like the ground of the module is connected to the 5V of the Raspberry Pi

iCorx
Автор

Great tutorial! I love how you have a drive called POOP at 15:42 :)

sethueapen
Автор

Perfect tutorial. Easiest way to make communication I've found in the internet. It's awesome how easy it is to build own devices now. Best wishes

Gonczor
Автор

I am trying to run this on Raspberry pi version 1, but I get no signal on Rpi,
pin configuration are as follow:
nrf24l01 RPi
vcc 3v3
GND ground (pin 6)
CE GPIO22 (pin 15)
CSN GPIO8(pin 24)
MOSI GPIO10( pin 19)
MISO GPIO9 (pin 21)
SCK GPIO11(pin 23)
I changed the code line
radio.begin(0, 17) to radio.begin(0, 22) and still have no signal to RPi.
Looking forward for a reply.
Thank you.

sokol
Автор

Around 40sec, the table is correct, but the scheme is wrong at the connection of Ground. It should be connected to pin 6 (GND), not pin 2 (5V)

paimi
Автор

Thank you, Alexander Baran-Harper, for sharing your knowledge! A long way to go for me to learn as much as you :)

aurelijuscerniauskas
Автор

Hi, when I run the script on the pi, it prints "Received: [195, 0, 0, 0, 0 ...0] and there is no decoded message. Could you offer any reason why this may be?

CurvedHalo
Автор

I followed your video exactly and used the same coding on the same hardware, but when I run I get a totally different result( meaning a bad one). When I run it an error occurs that causes the while loop to continue to run infinitely at full speed. And when i stop the program this is displayed

"
Traceback (most recent last):
File "/home/pi/Desktop/NRF24L01?arduinotopi.py", line 34, in <module>
print("translating received...")
File "/usr/lib/python3.4/idlelib/PyShell.py", line 1352, in write
return self.shell.write(s, self.tags)

I was hoping you could help me with this issue as I have been struggling with these modules and your tutorial has been most helpful

Thanks,
Danny

danielbright
Автор

It has taken me a bit of work to get the RasPi 3 Model B+ working with the Arduino Uno, but there are a few things you need to check, first make sure your PIN config is right for the RP3, if you look close enough on this video you will see that Alexander is using RPi2 so make sure you change the GND PIN on your RPi3 to PIN 6 NOT PIN2 (5V), next if you are getting a whole lot of screen messages coming up with UNI codes like 251 etc then you need to add the line that RCHype put into the Lib_nrf24.py file ... that fixed my problem and now I can move onto the next tutorial, hope that helps everyone!

cdellis
Автор

I have no idea if this will randomly help anyone, but it threw me off for 2 days until I stumbled up a "solution". If your RPi printout is not saying it's receiving anything, try unplugging your CSN pin on the arduino. With that pin floating, mine works as intended... but when I plug it back in? The RPi stops getting data. No clue what causes this, but I figured I'd put a note here for any other people in my situation.

cotter
Автор

I get this Error: Message recieved: [128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Anyone know Why?

cashdogg
Автор

For anyone having the same troubles as me. My raspberry was undervoltaged. I changed the power adapter. It worked

izepox
Автор

For the Raspberry Pi pin mapping...you verbally say "GND to GND", the table says GND/GND/6...but on the visual of your Pi, you show the NRF24L01+ "GND" connected to pin 2 of Raspberry Pi, which is 5V.

Did you make a mistake in your visual of RaspPi? I assume if you connect the table pins, it all works out (but some confirmation would be great). Thanks!

GAment_
Автор

hi Alexander Baran-Harper thank u for uploading this video, this was really helpful but i m having trouble with receiving the data sent from arduino to raspbery pi.My arduino is sending and the contents are visibile in serial monitor but raspberry pi is not receiving.The code is stuck in the radio.avaliable function and it is going to continuous sleep.How can i fix this??
Thanks in :)

sunilbarakoti