Tongue Controlled Wheelchair using Hall effect Sensors & arduino progamming
Description:
tongue controlled wheelchair- In this post, you can learn how to use two transmitter circuits to power a wheelchair wirelessly. This wheelchair can be operated by magnetic sensors from Hall Effect as well as by push buttons. RF transmitters and receivers will be used for 433Mhz wireless communication.
This tongue-controlled wheelchair can be operated from two different locations. You can use a Push Buttons RF transmitter circuit or use magnetic hall effect sensors. This wheelchair can be controlled by means of magnetic Hall effect sensors and wirelessly by using pushbuttons
The Amazon Purchase links are given below:
wheelchair: https://amzn.to/2F1wchr
433Mhz tx/rx: offering the best deal: https://amzn.to/2SBLEJi
2n2222 NPN transistors: https://amzn.to/37fp2lC
Arduino Uno: https://amzn.to/39aq6ZT
Mega 2560: https://amzn.to/2SszMsI
lm7805 Voltage Regulator: https://amzn.to/2ERYoTJ
330-ohm resistors pack: https://amzn.to/2Qj1Igg
female DC power jack socket: https://amzn.to/377Pg9M
470uf capacitors: https://amzn.to/2MrN3xR
5×7 cm Vero board: https://amzn.to/37b7KWO
female headers: https://amzn.to/350w6RE
connection wires: https://amzn.to/2MvOJXd
Super Starter kit for Beginners: https://amzn.to/398dliF
Jumper Wires: https://amzn.to/2SrnBwo
Bread Board: https://amzn.to/2MxV5FM
12v Adaptor: https://amzn.to/2MuOlZk
PCB plate: https://amzn.to/2MuwNMB
Variable Supply: https://amzn.to/39d0KdP
Digital Multimeter: https://amzn.to/34WbVoa
Vero Board / stripboard: https://amzn.to/39nL9Zg
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2PVwexF
Solder wire: https://amzn.to/2QlOvTS
Wire Stripper: https://amzn.to/353tYJa
wirecutter: https://amzn.to/2tV2lFj
PCB small portable drill machine: https://amzn.to/2MvQqnx
DISCLAIMER:
Please Note: these are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!
Circuit Diagram:
There are primarily two steps involved in implementing this proposed model. The first step is to locate the hall effect sensor and transmit the desired command wirelessly to the wheelchair. After receiving the commands, the Tongue operated wheelchair will test these commands based on the pre-defined conditions and then operate the wheelchair accordingly.
It consists of 4 buttons, one side of all the buttons are connected to the ground and the other ends are connected to the desired Arduino pins as specified in the programming. The Arduino is wired to the 433Mhz radio transmitter. The data pin is attached to the pin12 and the other pins are connected to the transmitter with 5v and GND.
This circuit consists of 4 sensors for the hall effect, which allow 5v to be operated. All these sensors are attached to the Arduino Analog pins because the presence of the permanent magnet gives different values as per the modified magnetic field.
All magnetic hall effect sensors are connected to the VCC “5v” pins and then connected to the 5 volts of the Arduino. Likewise, all magnetic hall effect sensors ‘ ground pins are wired together and then attached to the Arduino surface. While the magnetic hall effect sensor signal wires are attached to the desired Arduino or mega analog pins as defined in the programming.
The 5v and GND pins are connected to the 5 volts and GND of the Arduino. While the transmitter’s Pin information is connected to Arduino’s Pin number 12.
This is the receiver side’s entire circuit diagram. As there are two motors in the Tongue operated wheelchair, that’s why we need two h-bridges to power each motor. With the support of an H-bridge, each motor is operated and each H-bridge is made up of two relays. To control the direction of the dc motors, H-Bridges are used.
Download: relay hbridge
Programming:
Two programs are written for the two transmitter circuits and one program is written for the receiver in this project 3 separate programs are used.
Transmitter with buttons:
Make sure you install the VirtualWire library before beginning the programming first. This library can be found on the GitHub. So simply copy and pate this library into the Arduino’s library directory after you upload it, which you can find in the file tab.
First, I set Pins for the data pin of the transmitter and 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); } |
tongue controlled wheelchair 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); } |
tongue controlled wheelchair 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(' '); } } } } |