How to Use NRF24L01+ Module
by CHaleBrown in Circuits > Arduino
4225 Views, 28 Favorites, 0 Comments
How to Use NRF24L01+ Module
I have searched the web for a good tutorial on how to use the NRF24L01 wireless transmitter and receiver but was unsuccessful. So after 2 weeks and the help of a friend I finally got it to work! I hope your experience is not as painful and confusing as mine was and this tutorial can hopefully help you get your projects working faster.
In this project I used my universal arduino controller and a robot I through together with spare parts I had sitting around. But all you really need is two arduinos and a set of NRF chips.
Parts List (more in depth)
- Arduino Uno - https://www.sainsmart.com/sainsmart-uno-r3-atmega328p-development-board-compatible-with-arduino-uno-r3-product.html
- NRF24L01+ - https://www.sainsmart.com/nrf24l01-wireless-transceiver-module-2-4ghz-ism-band.html
- L298N Motor Controller - https://www.sainsmart.com/sainsmart-l298n-dual-h-bridge-stepper-motor-driver-controller-board-module-for-arduino-robot.html#customer-reviews
- 12V power supply (power for the robot)
NRF24L01+ the Basics
When using the NRF24L01+ I used the RF24 Library by TMRh20. Now to the wiring, on his page TMRh20 has a great chart on how to wire the arduinos HERE.
*** IMPORTANT ~ Without the base attachment the NRF24L01+ power will attach to the 3.3v on the arduino. With the base chip attached it attaches to the 5v. ***
The Controller
I used my universal arduino controller and wrote some simple code to control it. The controller connects to pins (9, 10) instead of pins (7, 8). The code tells it to send a 1 if one button is pressed and a two if the other is pressed and a three, both combined, if both are pressed.
Code last updated 8/7/2017
*lowered latency by over one second
Downloads
Robot!
This robot uses L298N library and the RF24 library to control the two 12 volt motors. This script reads the sent value of 0 - 7 and acts accordingly.
Code last updated 8/7/2017
*now it can drive froward and backward using buttons