Introduction
Let’s learn to design a low-cost wireless blind stick using the nRF24L01 transceiver module. So the complete project is divided into the transmitter part and receiver part. Thus, the Transmitter part consists of an Arduino Nano microcontroller, ultrasonic sensor, transceiver module. Furthermore, in the receiver part, we have an Arduino Nano microcontroller, Buzzer, transceiver module. Additionally, both are powered using a 7805 voltage regulator from a Battery. Thus we can monitor for objects present in front of blind stick and alert wirelessly.
Hardware Requirements
- Arduino nano Microcontroller
- Ultrasonic sensor
- Buzzer
- 7805 Voltage regulator IC
- nRF24L01 transceiver modules
- 9V Battery
- PCB
Software Requirements
Design of Voltage Regulator
Firstly, it’s necessary to start with designing a voltage regulator. Since we make use of a 9V battery but the requirement is 5V, thus it is necessary to regulate the voltage to 5V. For this reason, we make use of 7805 IC, which regulates the output voltage to 5V. Thus circuit has to be rigged up as shown in the below figure.
Circuit Diagram for Transmitter part
Secondly, we design a transmitter circuit consisting of an Arduino nano microcontroller, nrf24l01 module. Thus the ultrasonic sensor continuously monitors if there is any object in front of the stick. As a result of object detection, immediately a signal is sent to the Receiver section using the nrf24l01 module.
ARDUINO PINS | |
pin 2 | Ultrasonic sensor(Trig pin) |
pin3 | Ultrasonic sensor(Echo pin) |
Pin 7 | nrf(CE) |
Pin 8 | nrf(CS) |
Pin 13 | nrf(SCK) |
Pin 11 | nrf(MOSI) |
Pin 12 | nrf(MISO) |
3.3v | vcc(nrf) |
gnd | gnd(nrf) |
Circuit Diagram for Receiver part
Finally, we design the receiver part consisting of an Arduino nano microcontroller, Nrf24L01module, and a Buzzer. Thus, if any signal is received, immediately buzzer beeps alerting the person. Hence indicating an object is found in front of the stick.
ARDUINO PINS | |
pin 2 | Buzzer |
Pin 7 | nrf(CE) |
Pin 8 | nrf(CS) |
Pin 13 | nrf(SCK) |
Pin 11 | nrf(MOSI) |
Pin 12 | nrf(MISO) |
3.3V | vcc(nrf) |
gnd | gnd(nrf) |
Working part of Transmitter section
As shown in the flow chart, Initially the power is supplied to the components and microcontroller. Therefore the ultrasonic sensor continuously monitors for any object present within a certain limit. If the object is found then it immediately sends a signal to the receiver part, hence alerting about the danger. While if there is no object found then the ultrasonic sensor keeps monitoring.
Working part of Receiver section
As discussed earlier again we provide power to all components of the receiver section as well. However, in the receiver part, the Nrf module keeps monitoring for incoming signals. As a result of receiving a signal from the transmitter, immediately buzzer starts beeping alerting the person about the object present in front of the stick.
Code for Transmitter part
Finally, we have to design two codes for transmitter and receiver separately. Thus, the below code sets the nRF24L01 module as transmitter and we calculate the distance for object detection using an ultrasonic sensor.
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7,8); // CE, CSN
const byte addresses [6] = {"00001"}; //Setting the two addresses. One for transmitting and one for receiving
int trigpin = 2;
int echopin = 3;
long duration;
int distance;
void setup()
{
pinMode(trigpin, OUTPUT);
pinMode(echopin, INPUT);
Serial.begin(9600);
radio.begin(); //Starting the radio communication
radio.openWritingPipe(addresses); //Setting the address at which we will send the data
radio.stopListening();
}
void loop()
{
digitalWrite(trigpin, LOW);
delayMicroseconds(2);
digitalWrite(trigpin, HIGH);
delayMicroseconds(10);
digitalWrite(trigpin, LOW);
duration = pulseIn(echopin, HIGH);
distance = duration * 0.0343 / 2;//distance will be in cm
if(distance<30)
{
radio.write(&distance, sizeof(distance)); //Sending the data
delay(10);
}
}
Code for Receiver part
Similarly, the below code sets nRF24L01 as the receiver and keeps monitoring for the incoming signal. Once the signal is received immediately buzzer beeps alerting the person and stops beeping once object moves away.
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7,8); // CE, CSN
const byte addresses [6] = {"00001"}; //Setting the two addresses. One for transmitting and one for receiving
int distance=0;
int buzz=2;
void setup()
{
pinMode(buzz,OUTPUT);
Serial.begin(9600);
radio.begin(); //Starting the radio communication
radio.openReadingPipe(1, addresses); //Setting the address at which we will receive the data
radio.startListening(); //This sets the module as receiver
}
void loop()
{
distance=0;
if (radio.available()) //Looking for incoming data
{
while(radio.available())
{
radio.read(&distance, sizeof(distance));
Serial.println(distance) ;
if(distance<25)
{
digitalWrite(buzz,HIGH);//Buzzer beeps
delay(50);
digitalWrite(buzz,LOW);
delay(50);
}
}
}
delay(10);
}
Result
Summary
Thus, the transmitter and receiver are working as expected without any delay. In conclusion, the designed wireless blind stick is found to be simple with the object detection part and alertness part. In addition to it, we can notice that latency between transmitter and receiver is absent. Thus making it to be alternative for RF transmitter and RF receiver