akhiljacobvp
Published

Hand Motion Controlled Wheel Chair Via Bluetooth

This paper is to develop a wheel chair control which is useful to the physically disabled person with his hand movement or his hand gesture.

IntermediateProtip1,068
Hand Motion Controlled Wheel Chair Via Bluetooth

Things used in this project

Hardware components

HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1
Analog Accelerometer: ADXL335
Adafruit Analog Accelerometer: ADXL335
×1
Arduino Due
Arduino Due
×1

Hand tools and fabrication machines

wheel chair

Story

Read more

Schematics

123213_KzhmTTbktE.bmp

Code

project program in.txt

Arduino
int mode = 1;
#define ch_1 3
#define ch_2 4
#define ch_3 5
#define ch_4 6
#define ch_5 7
void setup()
{
  Serial.begin(9600);
  
  pinMode(ch_1, OUTPUT);
  pinMode(ch_2, OUTPUT);
  pinMode(ch_3, OUTPUT);
  pinMode(ch_4, OUTPUT);
  pinMode(ch_5, OUTPUT);
}
void loop()
{
  bluetooth();
  Serial.write(mode);
  /**/

  if (mode == 0) 
  {
    
      run_when_all_are_on_clockwise();run_when_all_are_on_clockwise();run_when_all_are_on_clockwise();
  run_when_all_are_on_anti_clockwise();run_when_all_are_on_anti_clockwise();run_when_all_are_on_anti_clockwise();
  odd_even_blinking();odd_even_blinking();odd_even_blinking();
  clock_run_three_nos();clock_run_three_nos();clock_run_three_nos();
  anti_clock_run_three_nos();anti_clock_run_three_nos();anti_clock_run_three_nos();
    anti_fill(); anti_fill(); anti_fill();
        fill();
    fill();
    fill();

    
  }
  if (mode == 0) {

  }

  if (mode == 0) {
    blinking();
  }
  if (mode == 0) {
    clock_run_single();
    clock_run_single();
    clock_run_single();
    clock_run_single();
  }
  if (mode == 0) {
    anti_clock_run_single();
    anti_clock_run_single();
    anti_clock_run_single();
    anti_clock_run_single();
  }
  if (mode == 0) {
    bf();
  }
  if (mode == 0) {
    m345();
    m345();
    m345();
  }

  if (mode == 0) {
    m345();
    m345();
    m345();
  }
}

void run_when_all_are_on_clockwise(void) //dial
{
  still();
  ch_1_off();   delay_on_all();
  ch_2_off();     delay_on_all();
  ch_3_off();     delay_on_all();
  ch_4_off();    delay_on_all();
  ch_5_off();    delay_on_all();
}

void run_when_all_are_on_anti_clockwise(void) //dial
{
  still();
  ch_5_off();    delay_on_all();
  ch_4_off();     delay_on_all();
  ch_3_off();     delay_on_all();
  ch_2_off();     delay_on_all();
  ch_1_off();     delay_on_all();
}

void odd_even_blinking(void) //dial
{
  off_all();
  ch_1_on(); ch_3_on();ch_5_on();   delay_off_all();
  ch_2_on(); ch_4_on();  delay1 ();
}

void clock_run_three_nos(void) //anti-clock fill & empty
{
  off_all();
  ch_1_on(); ch_2_on(); ch_3_on(); delay1 (); ch_1_off();
  ch_4_on(); delay1 (); ch_2_off();
  ch_5_on(); delay1 ();
}

void anti_clock_run_three_nos(void) //anti-clock fill & empty
{
  off_all();
  ch_5_on();ch_4_on();ch_3_on();delay1 ();ch_5_off();
  ch_2_on();delay1 ();ch_4_off();
  ch_1_on();delay1 ();
}

void blinking(void) //dial
{
  on_all(); delay1 ();      off_all(); delay1 ();
}

void fill(void) //anti-clock fill & empty
{
  off_all();
  ch_1_on(); delay1 ();
  ch_2_on(); delay1 ();
  ch_3_on(); delay1 ();
  ch_4_on(); delay1 ();
  ch_5_on(); delay1 ();
  ch_5_off(); delay1 ();
  ch_4_off(); delay1 ();
  ch_3_off(); delay1 ();
  ch_2_off(); delay1 ();
  ch_1_off(); delay1 ();
}
void anti_fill(void) //anti-clock fill & empty
{

  off_all();
  ch_5_on(); delay1 ();
  ch_4_on(); delay1 ();
  ch_3_on(); delay1 ();
  ch_2_on(); delay1 ();
  ch_1_on(); delay1 ();


  ch_1_off(); delay1 ();
  ch_2_off(); delay1 ();
  ch_3_off(); delay1 ();
  ch_4_off(); delay1 ();
  ch_5_off(); delay1 ();
}

void m135(void) //anti-clock fill & empty
{
  off_all();

  ch_1_on();    delay_off_all();
  ch_3_on();    delay_off_all();
  ch_2_on();    delay_off_all();
  ch_4_on();    delay_off_all();
}

void m345(void) //anti-clock fill & empty
{
  off_all();

  ch_3_on();    delay_off_all();
  ch_4_on();    delay_off_all();
  ch_5_on();    delay_off_all();
}

void clock_run_single(void) //anti-clock fill & empty
{
  off_all();
  ch_1_on();    delay_off_all();
  ch_2_on();    delay_off_all();
  ch_3_on();    delay_off_all();
  ch_4_on();    delay_off_all();
  ch_5_on();    delay_off_all();
}


void anti_clock_run_single(void) //anti-clock fill & empty
{
  off_all();
  ch_5_on();    delay_off_all();
  ch_4_on();    delay_off_all();
  ch_3_on();    delay_off_all();
  ch_2_on();    delay_off_all();
  ch_1_on();    delay_off_all();
}
void bf(void) //anti-clock fill & empty
{
  off_all();
  ch_1_on();    delay_off_all2();
  ch_2_on();    delay_off_all2();
  ch_1_on();    delay_off_all2();

  ch_1_on();    delay_off_all2();
  ch_2_on();    delay_off_all2();
  ch_3_on();    delay_off_all2();
  ch_2_on();    delay_off_all2();
  ch_1_on();    delay_off_all2();

  ch_1_on();    delay_off_all2();
  ch_2_on();    delay_off_all2();
  ch_3_on();    delay_off_all2();
  ch_4_on();    delay_off_all2();
  ch_3_on();    delay_off_all2();
  ch_2_on();    delay_off_all2();
  ch_1_on();    delay_off_all2();


  ch_1_on();    delay_off_all2();
  ch_2_on();    delay_off_all2();
  ch_3_on();    delay_off_all2();
  ch_4_on();    delay_off_all2();
  ch_5_on();    delay_off_all2();
  ch_4_on();    delay_off_all2();
  ch_3_on();    delay_off_all2();
  ch_2_on();    delay_off_all2();
  ch_1_on();    delay_off_all2();



}

void still(void)
{
  on_all();    delay1 ();
}

void delay_on_all(void)
{
  delay1 ();  on_all();
}
void delay_off_all(void)
{
  delay1 ();  off_all();
}
void delay_off_all2(void)
{
  delay2 ();  off_all();
}
void delay_off_all3(void)
{
  delay3 ();  off_all();
}

void ch_1_on(void)
{
  digitalWrite(ch_1, HIGH);
}
void ch_1_off(void)
{
  digitalWrite(ch_1, LOW);
}
void ch_2_on(void)
{
  digitalWrite(ch_2, HIGH);
}
void ch_2_off(void)
{
  digitalWrite(ch_2, LOW);
}
void ch_3_on(void)
{
  digitalWrite(ch_3, HIGH);
}
void ch_3_off(void)
{
  digitalWrite(ch_3, LOW);
}
void ch_4_on(void)
{
  digitalWrite(ch_4, HIGH);
}
void ch_4_off(void)
{
  digitalWrite(ch_4, LOW);
}
void ch_5_on(void)
{
  digitalWrite(ch_5, HIGH);
}
void ch_5_off(void)
{
  digitalWrite(ch_5, LOW);
}
void off_all(void)
{
  digitalWrite(ch_1, LOW);
  digitalWrite(ch_2, LOW);
  digitalWrite(ch_3, LOW);
  digitalWrite(ch_4, LOW);
  digitalWrite(ch_5, LOW);
}
void on_all(void)
{
  digitalWrite(ch_1, HIGH);
  digitalWrite(ch_2, HIGH);
  digitalWrite(ch_3, HIGH);
  digitalWrite(ch_4, HIGH);
  digitalWrite(ch_5, HIGH);
}
void bluetooth(void)
{
  if (Serial.available() > 0)
  {
    char a = Serial.read();
    if (a == '0')
    {
      mode = 0;
    }
    else if (a == '1')
    {
      mode = 1;
    }
    else if (a == '2')
    {
      mode = 2;
    }
    else if (a == '3')
    {
      mode = 3;
    }
    else if (a == '4')
    {
      mode = 4;
    }
    else if (a == '5')
    {
      mode = 5;
    }
    else if (a == '6')
    {
      mode = 6;
    }
    else if (a == '7')
    {
      mode = 7;
    }
    else if (a == '8')
    {
      mode = 8;
    }
    else if (a == '9')
    {
      mode = 9;
    }

  }
}
void delay1 (void)
{
  //adc_rd = (ADC_Read(2)+300) ;
  //for(i=0; i<adc_rd;i++) ;
  delay(150);
}
void delay2 (void)
{
  //adc_rd = (ADC_Read(2)+300) ;
  //for(i=0; i<adc_rd;i++) ;
  delay(80);
}
void delay3 (void)
{
  //adc_rd = (ADC_Read(2)+300) ;
  //for(i=0; i<adc_rd;i++) ;
  delay(80);
}

Credits

akhiljacobvp
1 project • 0 followers

Comments