Wireless distance measuring with ultrasonic

In this Arduino tutorial you will learn how to make a wireless communication between two Arduino boards using the NRF24L01. Also you can measure distance with ultrasonic sensor and transmit it to another Arduino with transceiver module.

Wiring Instructions

To wire your NRF24L01+ wireless receiver to your Arduino, connect the following pins:

  • Connect the VCC pin to 3.3 Volts
  • Connect the GND pin to ground (GND)
  • Connect the SCK pin to Arduino 13
  • Connect the MISO pin to Arduino 12
  • Connect the MOSI pin to Arduino 11
  • Connect the CSN pin to Arduino 10
  • Connect the CE pin to Arduino 9

To wire your ultrasonic sensor to your Arduino, connect the following pins:

  • Connect the VCC pin to Arduino 5Volts
  • Connect the GND pin to ground (GND)
  • Connect the Trig pin to Arduino 5
  • Connect the Echo pin to Arduino 6

To wire your NRF24L01+ wireless transmitter to your Arduino, connect the following pins:

  • Connect the VCC pin to 3.3 Volts
  • Connect the GND pin to ground (GND)
  • Connect the SCK pin to Arduino 13
  • Connect the MISO pin to Arduino 12
  • Connect the MOSI pin to Arduino 11
  • Connect the CSN pin to Arduino 10
  • Connect the CE pin to Arduino 9

Required Hardware

Recommended Software

Instructions and Code

Firstly import the library to the Arduino IDE , follow the schematic above to connect the ultrasonic sensor and NRF module. Then upload the code named “transmiter”.  Finally upload the second code to the other arduino named as receiver.

Code :

Tagged with: , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*