Ujval R
Created September 4, 2024

Head Motion Controlled Wheelchair for Independent Mobility

A hands-free wheelchair that empowers quadriplegics to navigate independently using head movements for control.

14
Head Motion Controlled Wheelchair for Independent Mobility

Things used in this project

Hardware components

nRF52 Development Kit
Nordic Semiconductor nRF52 Development Kit
×1
Dual H-Bridge motor drivers L298
SparkFun Dual H-Bridge motor drivers L298
×1
Analog Accelerometer: ADXL335
Adafruit Analog Accelerometer: ADXL335
×1

Hand tools and fabrication machines

Multitool, Screwdriver
Multitool, Screwdriver
Extraction Tool, Han-Modular Modules in Plastic Frames
Extraction Tool, Han-Modular Modules in Plastic Frames

Story

Read more

Code

Head Motion Controlled Wheelchair for Independent Mobility

C/C++
This code provides a basic framework for controlling the motors based on head tilt readings from an analog sensor.
#include <Wire.h>
#include <Servo.h>

Servo motor1; // Define motor 1
Servo motor2; // Define motor 2
Servo motor3; // Define motor 3
Servo motor4; // Define motor 4
Servo motor5; // Define motor 5
Servo motor6; // Define motor 6

void setup() {
  motor1.attach(9); // Attach motor 1 to pin 9
  motor2.attach(10); // Attach motor 2 to pin 10
  motor3.attach(11); // Attach motor 3 to pin 11
  motor4.attach(12); // Attach motor 4 to pin 12
  motor5.attach(13); // Attach motor 5 to pin 13
  motor6.attach(14); // Attach motor 6 to pin 14
}

void loop() {
  int headTilt = analogRead(A0); // Read head tilt angle from sensor

  // Map the head tilt value to motor commands
  if (headTilt < 300) {
    moveForward();
  } else if (headTilt > 700) {
    moveBackward();
  } else {
    stopMotors();
  }
}

void moveForward() {
  motor1.write(180); // Move forward
  motor2.write(180);
  motor3.write(180);
  motor4.write(180);
  motor5.write(180);
  motor6.write(180);
}

void moveBackward() {
  motor1.write(0); // Move backward
  motor2.write(0);
  motor3.write(0);
  motor4.write(0);
  motor5.write(0);
  motor6.write(0);
}

void stopMotors() {
  motor1.write(90); // Stop motors
  motor2.write(90);
  motor3.write(90);
  motor4.write(90);
  motor5.write(90);
  motor6.write(90);
}

Credits

Ujval R

Ujval R

2 projects • 1 follower

Comments