Tongue Controlled Wheelchair using Arduino and Hall effect Sensors
Table of Contents
Tongue Controlled Wheelchair Project Description:
Tongue Controlled Wheelchair based on the Arduino- In this tutorial, you will learn how to control a wheelchair wirelessly using two transmitter circuits. This wheelchair can be controlled through push buttons and also through Hall Effect magnetic sensors. For the wireless communication 433Mhz, RF transmitters and Receivers will be used.
This Tongue controlled wheelchair can be controlled from two different locations. You can use An RF transmitter circuit provided with Push Buttons, or you can use magnetic hall effect sensors. So this Wheelchair can be controlled wirelessly using Push Buttons and Hall effect magnetic sensors.
Amazon Links:
Arduino Nano USB-C Type (Recommended)
433 MHz Transmitter and Receiver Modules:
*Disclosure: These are affiliate links. As an Amazon Associate I earn from qualifying purchases.
Tongue Controlled Wheelchair Circuit Diagram:
The implementation of this proposed model mainly involves two steps. The first step is the identification of which the hall effect sensor is activated and then sending the desired command to the wheelchair wirelessly. The Tongue controlled wheelchair when receives the commands, these commands are tested depending on the predefined conditions and then accordingly operate the wheelchair.
As you can see in the above circuit, It consists of 4 buttons, one side of all the buttons are connected with ground and the other ends are connected with the desired Arduino pins as defined in programming. The 433Mhz radio transmitter is connected with the Arduino. Its data pin is connected with the pin12 and the other pins are connected with 5v and GND to power up the transmitter.
This circuit consists of 4 hall effect sensors, These sensor needs 5v to be powered up. All these sensors are connected with the Arduino Analog pins because it gives different values as per the magnetic field changed due to the presence of the permanent magnet. The VCC “5v” Pins of all the magnetic hall effect sensors are connected together and then connected with the Arduino’s 5 volts. Similarly, the Ground pins of all the magnetic hall effect sensors are connected together and then connected with the Ground of the Arduino. while the signal wires of the magnetic hall effect sensors are connected with the desired analog pins of the Arduino or mega as defined in the programming.
The Transmitter 5v and GND pins are connected with the Arduino’s 5 volts and GND. While the data Pin of the transmitter is connected with Pin number 12 of the Arduino.
This is the complete circuit diagram of the Receiver side. As the Tongue controlled wheelchair has two motors, that’s why we need two h-bridges to control each motor. Each motor is controlled with the help of an H-bridge and each H-bridge consists of two relays. H-Bridges are used to control the direction of the dc motors. If you want to learn the designing of H-bridges then you can visit our YouTube channel “Electronic Clinic”. The H-Bridge PCB looks like this and can be downloaded.
Download: H-bridge PCB board
Programming of the Tongue Controlled Wheelchair:
In this project 3 different programs are used, two programs are written for the two transmitter circuits and one program is written for the Receiver.
Transmitter with buttons:
Before you start the programming first off all make sure that you download the VirtualWire library. This library is available on the GitHub. After you download this library then simply copy and paste it into the Arduino’s library folder, which you can find in the documents folder.
Next, I defined Pins for the transmitter data pin and for the pushbuttons.
1 2 3 4 5 6 7 8 9 10 11 12 |
// transmitter.pde #include <VirtualWire.h> const int led_pin = 11; const int transmit_pin = 12; const int transmit_en_pin = 3; int button = 7; int button1 = 8; int button2 = 2; int button4 = 4; |
In the void setup function, I set all the pushbuttons to input.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
void setup() { // Initialise the IO and ISR vw_set_tx_pin(transmit_pin); pinMode(button, INPUT); pinMode(button1, INPUT); pinMode(button2, INPUT); pinMode(button4, INPUT); vw_setup(2000); // Bits per sec } byte count = 1; void loop() { char msg[7] = {'h'}; char msg1[7] = {'j'}; char msg2[7] = {'l'}; char msg3[7] = {'m'}; char msg8[7] = {'z'}; // msg[6] = count; if(digitalRead(button) == 0 ) { vw_send((uint8_t *)msg, 1); // change this number according to the sensor values vw_wait_tx(); // Wait until the whole message is gone delay(1000); } if(digitalRead(button1) == 0 ) { vw_send((uint8_t *)msg1, 1); // change this number according to the sensor values vw_wait_tx(); // Wait until the whole message is gone delay(1000); } if(digitalRead(button2) == 0 ) { vw_send((uint8_t *)msg2, 1); // change this number according to the sensor values vw_wait_tx(); // Wait until the whole message is gone delay(1000); } if(digitalRead(button4) == 0 ) { vw_send((uint8_t *)msg8, 1); // change this number according to the sensor values vw_wait_tx(); // Wait until the whole message is gone delay(1000); } else digitalWrite(button, HIGH); digitalWrite(button1,HIGH); digitalWrite(button2,HIGH); digitalWrite(button4,HIGH); } |
Transmitter with Hall effect sensors:
hall effect magnetic sensors connected
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
#include <VirtualWire.h> const int led_pin = 11; const int transmit_pin = 12; const int transmit_en_pin = 3; char msg[7] = {'h'}; char msg1[7] = {'j'}; char msg2[7] = {'l'}; char msg3[7] = {'m'}; char msg8[7] = {'z'}; int sensor1 = A0; // staight int sensor2 = A1; // right int sensor3 = A2; // left int sensor4 = A3; // stop // variable for sensors int sdata1 = 0; int sdata2 = 0; int sdata3 = 0; int sdata4 = 0; void setup() { Serial.begin(9600); // Initialise the IO and ISR vw_set_tx_pin(transmit_pin); pinMode(sensor1, INPUT); pinMode(sensor2, INPUT); pinMode(sensor3, INPUT); pinMode(sensor4, INPUT); vw_setup(2000); // Bits per sec } byte count = 1; void loop() { sdata1 = analogRead(sensor1); sdata2 = analogRead(sensor2); sdata3 = analogRead(sensor3); sdata4 = analogRead(sensor4); Serial.println(sdata1); Serial.println(sdata2); Serial.println(sdata3); Serial.println(sdata4); //delay(1000); //Serial.println("************************************"); // msg[6] = count; if(sdata1 < 500 ) { vw_send((uint8_t *)msg, 1); // change this number according to the sensor values vw_wait_tx(); // Wait until the whole message is gone Serial.println("sensor1: straight:"); delay(1000); } if( sdata2 < 500 ) { vw_send((uint8_t *)msg1, 1); // change this number according to the sensor values vw_wait_tx(); // Wait until the whole message is gone Serial.println("sensor2: right:"); delay(1000); } if(sdata3 < 500 ) { vw_send((uint8_t *)msg2, 1); // change this number according to the sensor values vw_wait_tx(); // Wait until the whole message is gone Serial.println("sensor3: left:"); delay(1000); } if(sdata4 < 500 ) { vw_send((uint8_t *)msg8, 1); // change this number according to the sensor values vw_wait_tx(); // Wait until the whole message is gone Serial.println("sensor4: stop:"); delay(1000); } else delay(200); } |
Receiver programming:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
#include <VirtualWire.h> const int led_pin = 13; int rightmotor1 = 2; // right side motor int rightmotor2 = 3; // left side motor int leftmotor1 = 7; int leftmotor2 = 8; const int receive_pin = 11; void setup() { delay(1000); Serial.begin(9600); // Debugging only Serial.println("setup"); // Initialise the IO and ISR vw_set_rx_pin(receive_pin); vw_set_ptt_inverted(true); // Required for DR3100 vw_setup(2000); // Bits per sec vw_rx_start(); // Start the receiver PLL running pinMode(led_pin, OUTPUT); digitalWrite(led_pin, LOW); pinMode(rightmotor1, OUTPUT); pinMode(rightmotor2, OUTPUT); pinMode(leftmotor1, OUTPUT); pinMode(leftmotor2, OUTPUT); } void loop() { uint8_t buf[VW_MAX_MESSAGE_LEN]; uint8_t buflen = VW_MAX_MESSAGE_LEN; if (vw_get_message(buf, &buflen)) // Non-blocking { int i; // Message with a good checksum received, dump it. Serial.print("Got: "); for (i = 0; i < buflen; i++) { char c = (buf[i]); if( c == 'z') { digitalWrite(led_pin , LOW); digitalWrite(rightmotor1 , LOW); digitalWrite(rightmotor2 , LOW); digitalWrite(leftmotor1 , LOW); digitalWrite(leftmotor2 , LOW); Serial.print(c); Serial.print(' '); } if( c == 'j') // for right side { digitalWrite(rightmotor1 , LOW); digitalWrite(rightmotor2 , LOW); digitalWrite(led_pin, LOW); digitalWrite(leftmotor1 , HIGH); digitalWrite(leftmotor2 , LOW); delay(200); digitalWrite(leftmotor1 , LOW); digitalWrite(leftmotor2 , LOW); delay(200); // digitalWrite(leftmotor1 , HIGH); // digitalWrite(leftmotor2 , LOW); Serial.print(c); Serial.print(' '); } if( c == 'h') // for straight { digitalWrite(led_pin, HIGH); digitalWrite(rightmotor1 , HIGH); digitalWrite(rightmotor2 , LOW); digitalWrite(leftmotor1 , HIGH); digitalWrite(leftmotor2 , LOW); Serial.print(c); Serial.print(' '); } if( c == 'l') // for left { digitalWrite(leftmotor1 , LOW); digitalWrite(leftmotor2 , LOW); digitalWrite(rightmotor1 , HIGH); digitalWrite(rightmotor2 , LOW); delay(200); digitalWrite(rightmotor1 , LOW); digitalWrite(rightmotor2 , LOW); delay(200); // digitalWrite(leftmotor1 , LOW); // digitalWrite(leftmotor2 , HIGH); Serial.print(c); Serial.print(' '); } if( c == 'm') { Serial.print(c); Serial.print(' '); } } } } |
bro the circuits were blur and you dont mention what type of hall effect sensor used…can i have the pdf documets and report of this project soon
Sir can I get the PDF documents and the report of this project plz