Abdullahi Asimiyu
Created September 19, 2023

AquaVibes Band - Acquatic Vibration for Enhanced Safety

A wearable underwater sensor system that allows visually impaired swimmers to navigate their aquatic environment.

22
AquaVibes Band - Acquatic Vibration for Enhanced Safety

Things used in this project

Hardware components

nRF24 Module (Generic)
×1
Arduino Nano R3
Arduino Nano R3
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Polymer Lithium Ion Battery - 2200mAh 3.7V
Seeed Studio Polymer Lithium Ion Battery - 2200mAh 3.7V
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Solder Wire, Lead Free
Solder Wire, Lead Free
Hot glue gun (generic)
Hot glue gun (generic)
Plier, Long Nose
Plier, Long Nose

Story

Read more

Custom parts and enclosures

Schematics

Schematics

Circuit

circuit2

Schematics

Code

Receiver Code

Arduino
Receiver
#include <SPI.h>
#include <RF24.h>

RF24 radio(2, 15); // CE, CSN pins on ESP8266
int rssi;
bool motorActive = false; // Flag to track motor state
const int motorPin = 5;  // GPIO pin connected to the motor (adjust as needed)

// RSSI to distance calibration parameters (you will need to calibrate these)
int rssiAt1Meter = -45; // RSSI value at 1 meter
float signalLossExponent = 2.0; // Signal loss exponent (free space path loss exponent)

void setup() {
  Serial.begin(115200);
  radio.begin();
  radio.openReadingPipe(1, 0xF0F0F0E1LL); // Set the address to listen for data
  radio.startListening();

  pinMode(motorPin, OUTPUT);
  digitalWrite(motorPin, LOW); // Ensure the motor is initially off
}

void loop() {
  if (radio.available()) {
    char text[32] = "";
    radio.read(&text, sizeof(text));

    // Read and calculate RSSI
    rssi = radio.RSSI();

    // Estimate distance based on RSSI and calibration parameters
    float distance = pow(10, ((rssiAt1Meter - rssi) / (10 * signalLossExponent)));

    Serial.print("Received: ");
    Serial.print(text);
    Serial.print(" - RSSI: ");
    Serial.print(rssi);
    Serial.print(" dBm - Estimated Distance: ");
    Serial.print(distance);
    Serial.println(" meters");

    // Check if the distance is less than 1 meter and activate the motor
    if (distance < 1.0 && !motorActive) {
      digitalWrite(motorPin, HIGH); // Turn on the motor
      motorActive = true;
      Serial.println("Motor activated");
    } else if (distance >= 1.0 && motorActive) {
      digitalWrite(motorPin, LOW); // Turn off the motor
      motorActive = false;
      Serial.println("Motor deactivated");
    }
  }
}

Transmitter Code

Arduino
#include <SPI.h>
#include <RF24.h>

RF24 radio(2, 15); // CE, CSN pins on ESP8266

void setup() {
  Serial.begin(115200);
  radio.begin();
  radio.openWritingPipe(0xF0F0F0E1LL); // Set the address to send data to
  radio.setPALevel(RF24_PA_HIGH); // Set the power amplifier level (you can adjust this)
}

void loop() {
  char text[] = "Hello, NRF24L01!";
  bool success = radio.write(&text, sizeof(text));

  if (success) {
    Serial.println("Message sent successfully");
  } else {
    Serial.println("Message transmission failed");
  }

  delay(1000); // Send the message every 1 second
}

AquaVibes-Band---Acquatic-Vibration-for-Enhanced-Safety

Enter the URL to access the transmitter and receiver code for the project. the code will be modified based on debug results.

Credits

Abdullahi Asimiyu

Abdullahi Asimiyu

3 projects • 2 followers
I am currently an undergraduate student, I started developing after finishing my secondary school and I had interest in embedded systems..

Comments