You are on page 1of 22

ELECTRONIC WHEEL CHAIR 2020

ELECTRONIC WHEEL CHAIR

ABSTRACT: detecting those movements. We have created a

This paper delivers a new method to device where a patient sitting on the Wheel

guide and control the wheelchair for disabled Chair assembly looking directly at the camera,

people based on ‘Human-Computer Interaction is able to move in a direction just by looking in

(HCI). An eye control device based on image that direction.

processing is developed to assist mobility. The The camera signals are monitored

eye movement is detected using a camera which by a MATLAB script, which will then guide the

is attached to the wheelchair. motors wired to the AtMega1284P

This concept can be used for multiple Microcontroller over the Serial Interface to

applications, but this paper focuses the move in a particular direction. The system is

application to mobile and communication aid cost effective and thus can be used by patients

for handicapped patients suffering from spread over a large economy range.

quadriplegic and paraplegic diseases. The This project is one small step

proposed system involves two stages; first eye forward in the vast avenue of “Human

movement detection and second, sending of Machine Interface” HMI. There are various

control signals to the powered wheelchair. biological signals emitted from the human body

Statistics suggests that there are viz. EEG, EOG, EMG etc. In this project our

11,000 new cases of quadriplegia every year in main focus is on the acquisition and analysis of

United States of America. Great people like EEG waves so that it can be used as an input to

Stephen Hawking and Max Brito have been drive a D.C motor which in turn drives the

suffering from this crippling phenomenon. subject’s wheelchair.

Our project is an attempt to make lives


1. INTRODUCTION
of the people suffering from this phenomenon
The number of persons who
simple and by simpler we mean self-reliant,
are paralyzed and therefore dependent on
which will thereby reinstate their confidence
others due to loss of self-mobility is
and their happiness. The idea is to create an
growing with the population. The
Eye Monitored System which allows movement
development of the wheelchair for
of the patient’s wheelchair depending on the
paralyzed users is surprisingly recent
eye movements.
starting with the conventional manually
We know that a person suffering from
powered wheelchairs and advancing to
quadriplegia can partially move his eyes and tilt
electrical wheelchairs.
his head, thus presenting an opportunity for

DEPARTMENT OF ECE, AITS, RAJAMPET Page 1


ELECTRONIC WHEEL CHAIR 2020

Conventional wheelchair
use tends to focus exclusively on manual
use which use which assumes users still
able to use their hands which excludes
those unable to do so. Diseases or
accidents injuring the nervous system
also frequently because people lose their
ability to move their voluntary muscle
. Because voluntary muscle is Figure1. Stephen hacking

the main actuator enabling people to The idea of an eye-monitored


move their body, paralysis may cause a wheelchair was inspired by a past project of one
person not move their locomotor organ of the group members, Ankur Thakkar, where he
such as arm, leg and others. Paralysis had created a glove based wheel chair. In that
may be local, global, or follow specific project, the finger movements of the
patterns. Most paralysis are constant, handicapped person were used to guide the
however there are other forms such as wheel chair in the desired direction.
periodic paralysis (caused by genetic He wanted to take the idea forward
diseases), caused by various other by making the system completely isolated from
factors. the person physically, and extend the usability of
Scientist Stephen W. the system to a person suffering from
Hawking is perhaps the most well-known quadriplegia.
victim of major paralysis – Hawking was
2. DEVELOPMENT:
diagnosed with incurable Amyotrophic
We wanted to come up with the
Lateral Sclerosis (ALS) in 1962,
system that is not expensive and thus can be
thereafter using a wheelchair to move.
afforded by all. The main task in the design was
Many of those suffering close
to accurately detect the eye movements. Since,
to or complete paralysis usually however
the system is for human use we have to take an
still can control their eye movement
extra care about the safety of the system.
which inspired us to develop an eye-
For the eye detection, we came up
controlled electric wheelchair. Where he
with multiple strategies. One was to detect the
had created a glove based wheel chair. In that
eye moments using the infrared light. The idea
project, the finger movements of the
behind this method was to concentrate the
handicapped person were used to guide the
infrared light onto the eyes from the forehead.
wheel chair in the desired direction.

DEPARTMENT OF ECE, AITS, RAJAMPET Page 2


ELECTRONIC WHEEL CHAIR 2020

The voltage rating of the infrared of the system and needs to be done with great
light is under the permissible levels that can be precision.
used to concentrate in the eyes. The infrared The second alternative that we came
light concentrated through the forehead of the up with was to connect the web camera to the
user will be collimated through the pupil of the RaspberyPi directly which would then process
eye and we can use this collimated light to obtain the snapshots, eliminating the need to have the
a voltage drop across the photodiode which will camera attached to the laptop.
drive the motors But, we found out that the time taken
to understand the new controller board is a lot.
Also, normally these days such users have a
laptop somehow attached to their wheel chair
and thus we decided to rather go ahead with a
microcontroller board that we already
understand.
The alternative design which we
finalized, captures the images using a webcam
that will be attached to the laptop placed on the
wheelchair of the user.
These captured images will be used

Figure2. Electronic wheel chair


to detect the eyes and hence detect the
movements using a MATLAB script running on
We built the photo detector circuit and the laptop, which then sends serial commands to
tested this method on one of the group members. the microcontroller circuitry driving the motors
During the testing of the circuitry, we found that attached to the wheel chair.
we were not able to obtain accurate results and For the above mentioned reasons, we
the voltage drop across the photo diode was not finalized to work with this idea. detection. We
constant and kept on varying. used the ‘Cascade Object Detector’ capable of
Thus, the issue with this idea was that detecting eye-shaped objects based on their
the voltage drop obtained across the diode was shape and size.
just 0.7 Volts and it was not sufficient to detect It uses the Viola Jones Algorithm [5]
accurately. Thus, we had to come up with an for the same. Just 0.7 Volts and it was not
alternative in order to obtain an accurate method sufficient to detect a description of the
to detect the eye as that is the most crucial part Algorithm is given in the software section of the
report.

DEPARTMENT OF ECE, AITS, RAJAMPET Page 3


ELECTRONIC WHEEL CHAIR 2020

Viola Jones Algorithm [5] for the same. A


description of the Algorithm is given in the
software section of the report.

Continuous snapshots of every 25th frame are


taken and feature points extracted are saved i.e.
we capture approximately 1 snapshot every
second and process it. Based on the position of
the feature points in previous snapshot and
current snapshot, a movement is detected and
Figure3. Light weight electronic wheel chair this is communicated to the wheelchair assembly
3. DESIGNING via the serial port.
3.1. HIGH LEVEL DESIGN
There are two major components 3.1.2ATMEGA1284P CONTROLLED
from the system design standpoint - WHEEL CHAIR
a) Eye-Detection and motion tracking. A decision based on the processing
b) ATMega1284P controlled Wheel Chair done by the MATLAB application is
Assembly. communicated and received by the
3.1. 1. EYE DETECTION ATMega1284P. The controller on reception
A webcam is mounted on a cap, forces the port pin high on which the motors
continuously staring at the user’s eyes. The have been connected for desired motion of the
webcam wired to the patient’s laptop, is running Wheel Chair.
a MATLAB application designed to monitor and
react to eye movements.
Based on a series of snapshots taken
and thereafter processed, the motion of the user’s
eyes are detected, decision to move the Wheel
Chair in a particular direction is taken and
communicated serially to ATMega1284P
microcontroller. MATLAB 2013 has an image
processing toolbox which we utilized for the eye
detection. We used the ‘Cascade Object
Detector’ capable of detecting eye-shaped Figure4. Block diagram
objects based on their shape and size. It uses the

DEPARTMENT OF ECE, AITS, RAJAMPET Page 4


ELECTRONIC WHEEL CHAIR 2020

So, now we will have a look at the But sometimes, it may be possible that
overall code structure of our algorithm and the only one of the either eye will be detected. In
logic behind the decision making. that case, we will give preference to the eye that
There are two parts in the code is detected currently.
structure. The first part is to detect the eye 5. Error Handling: To avoid detection
movements and the other part is to drive the errors, we incorporated an error handling
motors. The code structure can be explained in mechanism, which specifies a threshold for the
the following steps: height and width of a valid eye, by calibrating it
1. Initialization: Initially we set up the for the user.
serial communication that will be used later for If the detection results give a height
the interface between MATLAB and the and width value lesser or greater than the
controller, the video capture and the program threshold, the value is voided and not considered
variables. for the decision making.
2. Image and Video Processing: We then 6. Motion: Now after detecting the eye
take continuous video frames and sample the movements, we have to come up with a decision
input and save it as the screen shots. Each frame algorithm that will help the controller to drive
is then converted into the black and white the motors accordingly:
frames. For the accurate results, we perform a. Valid Left: The decision to turn left will be
contrast stretching on each frames to make the considered as valid if the eye turns left and stays
dark region darker and bright region brighter. there for a cycle. This action will be detected as
This will enable the detection of the eyes better. a left turn request. After that, the patient will turn
3. Estimation: Now, after working on the right to again look forward. Thus, this signal
each frame we try to detect the eyes. This we do should be considered as void.
by estimating the position of left as well as the b. Valid Right: Similarly, the decision to turn
right eye. Thus, we set the threshold and detect right will be considered as valid if the eye turns
the position of the eyes which can be used for the right and stays there for a cycle. This action will
further processing. be detected as a right turn request. After that, the
4. Detection: Now, in this step we actually patient will turn left to again look forward. Thus,
detect the eye movements. The idea is to this signal should be considered as void.
compare the current position of the eye with the c. Valid Straight: The signal to go straight is
previous position. Thus, the difference in the when a person looks left and right or right and
coordinates will help us to predict the motion in then left. This will be detected as to go straight.
the particular eye. 7. Safety Considerations: Given the
application of the system, we incorporated a

DEPARTMENT OF ECE, AITS, RAJAMPET Page 5


ELECTRONIC WHEEL CHAIR 2020

safety mechanism, wherein based on the blink MATLAB 2013 can easily be configured to
detection the wheel chair halts. If the user wants serially transmitting data on the Port mentioned
to halt the wheel chair in case of an emergency, in the code. Initially all the already set up serial
he can blink thrice, causing the wheel chair to ports are disabled.
halt. After which, we need to mention the
8. Serial Communication: Now according current port, by checking the ‘Device Manager’
to the detected command, the MATLAB which indicates the port in use. The baud rate of
application will transmit 0, 1 or 2 for left, right communication is set to 9600. The
and straight respectively to the controller which communication is set to have no flow control and
will drive the motors. parity check is disabled.
3.2. SOFT WARE DESIGN After setting up the serial

There are multiple aspects to the communication to enable the data link between

software design of this project. Since majority of MATLAB and AtMega1284P, we reset the

computational work is done in software, a lot of variables needed in the course of the program to

our time went in software design and testing. their initial valuables.

The MATLAB component is


responsible for capture of regular snapshots, ii. Image Capture and Eye Detection –

processing of those snapshots, determining the MATLAB 2013 equips an Image

movement of eyes, algorithm for movement of Processing Toolbox, which we have used

wheelchair and serial transmission of the majorly in this section of the Software Design.

decision to move. We use a Microsoft LifeCam HD-5000 web

The firmware component deals with camera which is connected via a USB cable to

receiving the serial signal, based on which drive the Computer on which the MATLAB script is

the motor connected to the port pins, forcing the running.

wheelchair in the direction it is supposed to We can stream continuous video signals

move in. on MATLAB coming from the camera using the

3.2.1 MATLAB COMPONENT video processing toolbox available. The function

The MATLAB design can be ‘imaqhwinfo’ is used to recognize all video

structured into many small sub-parts each of capture adaptors. Identifying the correct device

which is described below – and then using it to stream the video signal is the
next step. A which are fundamentally feature

i. Initialization of variables and setting points on a human face.

up serial communication –

DEPARTMENT OF ECE, AITS, RAJAMPET Page 6


ELECTRONIC WHEEL CHAIR 2020

rectangles, which are fundamentally feature


points on a human face.
(iii) Image Processing
Initially, all we do is monitor if any
eye feature points have been detected or not. If
not set a flag and display it on the debug screen.

To increase the detection accuracy,


we wanted to neglect all other points on the
screen except the actual eye of the person. The
Figure5. image capturing camera
reason being, if anyone except quadriplegic
The requirement of our design was
person comes in front of the camera, the person
to continuously look at different frames, based
should not affect the system.
on which determine motion. It is practically
Also certain things seemingly
impossible to do a lot of processing on a per
looking like eyes should be rejected as well. The
frame basis.
way we incorporated this is taking into account
That is why we try to sample every
the height and length of the eye. After repeated
25th frame. So, a snapshot of every 25th frame is
testing, we decide a length and height of a valid
captured and processed. We used the
eye, sets a range around the threshold and reject
‘getsnapshot’ command to capture these
everything which is outside it.
snapshots.
The blink detection section is not
The image is then converted to
compute intensive. We use a flag which is set
grayscale image, as we do not need color
each time no valid eyes are detected. If in
information to detect eye feature points. The
corresponding frames the flag value sets, it
conversion infact makes the detection easier. The
indicates a blink. A series of 3 such blinks
‘imadjust’ command is used then to contrast
command the motors to freeze, halting the wheel
stretch the image to make darker sections even
chair.
darker, enhancing the eye feature points useful
We define the threshold for the
for the application.
minimum movement of the eye required to be
The algorithm is designed to work on
qualified as a valid attempt. In each snapshot the
sum of pixels in a rectangular area. Viola-Jones difference is evaluated, and if this difference above
algorithm[5] says that face can be detected by the threshold in any direction left or right, the flags
looking for rectangle. And then the large indicating left movement or right movement seen in
rectangle is made up of many such smaller the casual way.

DEPARTMENT OF ECE, AITS, RAJAMPET Page 7


ELECTRONIC WHEEL CHAIR 2020

The firmware constantly monitoring the serial


input

Figure6. image processing

(iv) Movement Detection –


The movement detection is done
with a very basic principle. We take in the
feature points for both left and right eyes and
save it.
Figure7. eye capturing
Thereafter take the difference in
Sometimes due to non-linearity, both
pixels of the left eye position and right eye
the eyes are not detected. At such instances
position in the current snapshot from the
while evaluating the difference for detecting
previous snapshot. We define the threshold for
movement, we would give a bias to the eye
the minimum movement of the eye required to
which was detected in the previous snapshot.
be qualified as a valid attempt.
After detecting the eye movements, we can
In each snapshot the difference is
proceed to determining and sending serial signal
evaluated, and if this difference above the threshold
to the micro-controller.
in any direction left or right, the flags indicating left
movement or right movement are set. If the
3.3. FIRM WARE DESIGN
difference is not above the threshold, the flag which
The firmware design is fairly straight
says that no movement has occurred is set.
forward as all the computation has been done on
Has to do is control the motors to
MATLAB and the only thing which the micro-
move in a particular direction. Left or right, the
flags indicating left movement or right movement are controller has to do is control the motors to move

set. If the motors to move in a particular. in a particular direction.

DEPARTMENT OF ECE, AITS, RAJAMPET Page 8


ELECTRONIC WHEEL CHAIR 2020

The firmware constantly monitoring for left, right and straight direction. The circuit
the serial input. The firmware turns ON the port shown below is fairly safe and used to drive the
pin based on this received signal. After turning motors.
ON the port pin, a small delay is given, giving An optoisolator completely isolates
the chair time to move for a fixed time in the the microcontroller from the motor. The diode
desired direction. placed across the motor shorts out spikes when
As far as the firmware design is the motor is turned off. The resistor grounding
concerned, it is fairly simple. All that is required the base of the phototransistor is set for best fall
is take in the serial input, move in a direction, time, probably around 1Mohm.
give a delay and keep doing this repeatedly. The motor capacitor should start
3.4. HARD WARE DESIGN around 0.1uf. The pinout of the 4N35
The hardware part consists only to optoisolator and BUZ73 are also shown. Note
control the motor. The motor controller circuit is that the bandwidth of the 4N35 is very small, so
given below we use a low PWM frequency, perhaps about
1000 Hz.

Figure8.hardware design

3.4.1 Motor Control


The signal that we obtain from the Figure9. block diagram 2

MATLAB script, we then use that to drive the 3.5. Mechanical Design

motors. The MATLAB program does all the For the mechanical part, we worked on

decision making for the motor to run in which two things:

direction. So, the script sends the bit 0,1 and 2


DEPARTMENT OF ECE, AITS, RAJAMPET Page 9
ELECTRONIC WHEEL CHAIR 2020

For the mechanical part, we worked on two


things: the wheel chair prototype and the web
camera mount. For the wheel chair mount, we
have tried to build the small prototype from
wood with four wheels that are connected to the
motors. The photo shown below shows the wheel
chair prototype.

Figure11. lab designing

4. TESTING STRATEGY
The debug screen was the most useful
aspect of our testing strategy. The debug screen
showed whenever nothing was detected as a
valid eye by the cascade object detector.
Figure10.drive motor design When a valid eye is seen, the length,
Now, in order to detect the eye height, x and y pixel co-ordinates are displayed
movements, we need to have a web camera in on the debug screen. This is done for every
front of the user. For simplicity, we are attaching snapshot. After taking the difference between
the web camera onto the head mount like helmet two snapshots, a tilt movement is indicated by
that will be used to detect the eye motion. either saying ‘moved right’ or ‘moved left’.
Since, we are not making the actual Now, in order to detect the eye
wheel chair, thus, we have to use an independent movements, we need to have a web camera in
head mount. Otherwise, we can use the web cam front of the user. For simplicity, we are attaching
directly attach to the chair. The photo of the head the web camera onto the head mount like helmet
mount is given below. After taking the difference that will be used to detect the eye motion.
between two snapshots, a tilt movement is Otherwise, we can use the web cam
indicated by either saying ‘moved right’ or directly attach to the chair. The photo of the head
‘moved left’. mount is given below

DEPARTMENT OF ECE, AITS, RAJAMPET Page 10


ELECTRONIC WHEEL CHAIR 2020

eye is an electric dipole with a negative pole at


the fundus and positive pole at the cornea.
one electrode is placed to the side of
the left eye and another to the side of the right
eye. This pair shall detect horizontal eye
movements. One electrode is placed above the
left eye and another below the left eye.
This pair shall detect vertical eye
movements. A fifth electrode is attached by the
ear to provide reference voltage.
These electrodessend the electrical
signalsto twoEOG circuits of similar design to
detect the horizontal and vertical movement of
the pupil.This information is sent for
Figure12. MATLAB design
computation.
After determining if the motor has
The big advantage of this method
to be moved or not and before transmitting the
is the ability to detect eye movements even when
serial signal, on the debug screen, we indicate
they are closed.
the intended motion of the motor. This allows us
5.2.Lens Tracking Systems
to debug if any error.
In this method a non slipping contact
If the movement suggested on the
lens fits over corneal bulge.The tracking of the
debug screen and then movement of the wheel
pupil is recorded by affixing a magnetic coil or
chair are in conjunction. This allowed us to test
mirror to the lens.
consistently with ease.

5. DIFFERENT EYE TRACKING


MECHANISMS
There are there eye tracking mechanisms to
compute the position of pupil.
5.1 Electro-Oculogram (EOG) Method:
The Electro-Oculogram method obtains the gaze
direction by sensing the electrooculographic Figure 13. Lens tracking system

potential.This is done by measuring the potential The integrated mirror in the contact lens
using electrodes placed on face where human allows measuring reflected light; alternatively,

DEPARTMENT OF ECE, AITS, RAJAMPET Page 11


ELECTRONIC WHEEL CHAIR 2020

the integrated coil in the contact lens allows The ADXL335 is a small, thin, low
detecting the coil’s orientation in magnetic field. power, complete 3-axis accelerometer with
The big advantage of this method is high signal conditioned voltage outputs. The product
accuracy and nearly unlimited resolution in time. measures acceleration with a minimum full-scale
Both methods explained so far are range of ±3 g.
obtrusive and are not suited well for interaction It can measure the static acceleration
by gaze. The third and preferred method for eye- of gravity in tilt-sensing applications, as well as
gaze interaction is using videocamera. dynamic acceleration resulting from motion,
5.3 Head Mounted Camera System shock, or vibration.
The most common mechanical setup involves The user selects the bandwidth of the
use of desktop computer with integrated eye accelerometer using the CX, CY, and CZ
tracker camera. The desktop computer is loaded capacitors at the XOUT, YOUT, and ZOUT
with software package for analyzingthe eye gaze pins. Bandwidths can be selected to suit the
data. This setup require head fixation and hence application, with a range of 0.5 Hz to 1600 Hz
restricts the head movements. for the X and Y axes, and a range of 0.5 Hz to
An alternative method uses a head mounted eye 550 Hz for the Z axis.
tracking

Figure14. Head Mounting Tracking

6. WORKING
6.1 Input Sensing
The input sensor for the smart wheel chair is an
Accelerometer, Joystick, Ultrasonic Sensor,
speech synthesizer and gyroscope.
6.2.Accelerometer Figure15.blockdiagram 3

DEPARTMENT OF ECE, AITS, RAJAMPET Page 12


ELECTRONIC WHEEL CHAIR 2020

6.3. Joystick - The Module automatically sends eight 40 kHz


Analog joystick has two variable and detect whether there is a pulse signal back.
resistors for two axes. Each variable resistor has - If the signal back, through high level , time of
three pins; two extreme pins are connected to high output IO duration is the time from sending
Vcc (5v in our case) and ground. ultrasonic to returning. Test distance = (high
The center pin is the output pin. The level time×velocity of sound (340M/S) / 2
output voltage is between Vcc and GND 6.6 Speech Synthesizer
depending on the position of stick. By measuring Speech Synthesizer module EasyVR is
the voltage output of two variable resister from the second generation version of the successful
which the joystick is built, we can determine the VRbot Module. It is a multi-purpose speech
position of stick in x and y axis. recognition module designed to easily add
6.4. Gyroscope (L3G4200D) versatile, robust and cost effective speech
The L3G4200D is a low-power three- recognition.
axis angular rate sensor able to provide Capabilities to virtually any
unprecedented stability of zero rate level and application. The EasyVR module can be used
sensitivity over temperature and time. with any host with an UART interface powered
It includes a sensing element and an IC at 3.3V – 5V, such as PIC and Arduino boards.
interface capable of providing the measured EasyVR features:
angular rate to the external world through a  Supports up to 32 user-defined Speaker
digital interface (I2C/SPI). Dependent (SD) triggers or commands as well as
The L3G4200D has a full scale of Voice Passwords. SD custom commands can be
±250/±500/±2000 dps and is capable of spoken in ANY language.
measuring rates with a user-selectable  Easy-to-use and simple Graphical User
bandwidth.. Interface to program Voice Commands and
6.5. Ultrasonic Ranging Module audio.
Ultrasonic ranging module HC - SR04  Module can be used with any host with an
provides 2cm - 400cm non-contact measurement UART interface (powered at 3.3V - 5V)
function, the ranging accuracy can reach to  3 GPIO lines (IO1, IO2, IO3) that can be
3mm. The modules includes ultrasonic controlled by new protocol commands.
transmitters, receiver and control circuit.  PWM audio output that supports 8 ohm
The basic principle of work: speakers.
-Using IO trigger for at least 10us high level  Sound playback feature.
signal The modules includes ultrasonic
transmitters, receiver and control circuit

DEPARTMENT OF ECE, AITS, RAJAMPET Page 13


ELECTRONIC WHEEL CHAIR 2020

6.6. Working principle of EasyVr:


The voice command of user is send to
sample and hold circuit and it is sampled by
obeying Nyquist criterion. After that it is send to
ADC which convert the value in digital form.
The voice command which we give
through module is saved to internal flash
memory and we program it through host
microcontroller and it compares pre stored
command and real time command and perform
the specified task.
7.MODES OF OPERATION
Electronic wheel chair has two modes of Figure16. modes of operation
operation Joystick mechanism has also been provided
7.1. Mode 1: Eye directive mode as an additional feauture to ensure movement in
The users eye movement forms the basis of case of tired version. A stop is provided on the
the entire system. The movement of the eye ball wheelchair which will cease the working at the
is continuously tracked using a wireless camera . very instance it is pressed
This camera is mounted in front the eye, such 7.3.HOW TO EXECUTE MATLAB
that the focus remains on the eye movement. APPENDIX1:
7. 2. Mode 2: Joystick mode STEP 1: Install the webcam that is mounted on
Joystick mechanism has also been the helmet.
provided as an additional feauture to ensure STEP 2: Connect the hardware circuit (motors
movement in case of tired version. A stop is connected to the controller) to the 6 volt supply
provided on the wheelchair which will cease the and also power the micro controller.
working at the very instance it is pressed STEP 3: Wear the helmet on the head that will
The users eye movement forms the basis have the camera attached to it.
of the entire system. The movement of the eye STEP 4: Program the microcontroller with the
ball is continuously tracked using a wireless code given and also run the MATLAB script.
camera . This camera is mounted in front the This will initiate the serial communication
eye, such that the focus remains on the eye between the MATLAB script and the
movement. microcontroller.

DEPARTMENT OF ECE, AITS, RAJAMPET Page 14


ELECTRONIC WHEEL CHAIR 2020

STEP 5: Make the head movements that will be


tracked which thereby will control the motors to while(vid.FramesAcquired<=25)
move in the expected direction. I = getsnapshot(vid);
APPENDIX 2: MATLAB SCRIPT I = rgb2gray(I);
%% Initialization of variables and serial I = imadjust(I);
communication I = adapthisteq(I);
clc; I = imrotate(I,180);
clear all; faceDetector =
close all; vision.CascadeObjectDetector('LeftEyeCART');
delete(instrfind); j=0;
% Set up the COM port for serial communication left_flag=0;
disp('Setting up serial communication...'); right_flag=0;
% Determine which COM port is for bboxes = step(faceDetector, I);
microcontroller and change [m,n] = size(bboxes);
s = IFaces = insertObjectAnnotation(I, 'rectangle',
serial('COM4','Parity','none','FlowControl','none', bboxes, 'Eye');
'BaudRate',9600); imshow(IFaces), title('Detected eye');
% Open serial COM port for communication %% Image Processing
fopen(s); TF = isempty(bboxes);
set(s,'Timeout',10); if (TF==1) disp('nothing');
prev_left = [0 0 0 0]; k=1;
prev_right = [0 0 0 0]; else
prev_left_flag=0; k=0;
prev_right_flag =0; end
prev_flag = 2; for i=1:1:m
check_left = 0;
check_right = 0; if (bboxes(i,3) < 150)
check_straight_right = 0; % display('invalid eye');
check_straight_left = 0; elseif (bboxes(i,3) > 300)
check_left_right = 0; % display('invalid eye');
check_right_left = 0;
%% Image Capture and Eye Detection else
vid=videoinput('winvideo',1); j=j+1;
start(vid) eye(j,:) = bboxes(i,:);

DEPARTMENT OF ECE, AITS, RAJAMPET Page 15


ELECTRONIC WHEEL CHAIR 2020

end flag = 0;
end display('moved left');
if (j>0) elseif ((right_eye(1,1) - prev_right(1,1))<-50)
for (i=1:1:j) flag = 1;
if(eye(i,1)>300) && (eye(i,1)<600) display('moved right');
left_eye = eye(i,:); else
disp('Left:'); flag = 2;
disp(left_eye); display('stayed');
left_flag=1; end
elseif(eye(i,1)>600) && (eye(i,1)<900) prev_right = right_eye;
right_eye = eye(i,:); elseif(left_flag==1)
disp('Right:');
disp(right_eye); prev_left_flag = 1;
right_flag=1; if((left_eye(1,1) - prev_left(1,1))>50)
end flag = 0;
end display('moved left');
elseif ((left_eye(1,1) - prev_left(1,1))<-50)
%% Movement Detection flag = 1;
if((left_flag==1)&& (prev_left_flag ==1)) display('moved right');
prev_left_flag = 1; else
if((left_eye(1,1) - prev_left(1,1))>50) flag = 2;
flag = 0; display('stayed');
display('moved left'); end
elseif ((left_eye(1,1) - prev_left(1,1))<-50) prev_left = left_eye;
flag = 1; elseif(right_flag==1)
display('moved right'); prev_right_flag = 1;
else if((right_eye(1,1) - prev_right(1,1))>50)
flag = 2; flag = 0;
display('stayed'); display('moved left');
end elseif ((right_eye(1,1) - prev_right(1,1))<-50)
prev_left = left_eye; flag = 1;
elseif((right_flag==1)&&(prev_right_flag==1)) display('moved right');
prev_right_flag = 1; else
if((right_eye(1,1) - prev_right(1,1))>50) flag = 2;

DEPARTMENT OF ECE, AITS, RAJAMPET Page 16


ELECTRONIC WHEEL CHAIR 2020

display('stayed'); check_left = 1;
end end
prev_right = right_eye;
end elseif ((prev_flag == 1) && (flag == 2)) % right
if (left_flag == 0) movement
prev_left_flag=0; if ((check_left == 1) || (check_straight_left == 1)
|| (check_left_right))
elseif (right_flag == 0) move = 3;
prev_right_flag=0; display('motor stays');
end check_left = 0;
%% Motor Control Signals check_straight_left = 0;
if ((prev_flag == 0) && (flag == 1)) % straight check_left_right = 0;
movement else
display('motor moved straight'); move = 1;
move = 2; display('motor moved right');
check_straight_right = 1; check_right = 1;
check_left_right = 1; end
elseif ((prev_flag ==1) && (flag == 0)) else % no movement
move = 2; move = 3;
display('motor moved straight'); display('motor stays');
check_straight_left = 1; end
check_right_left = 1; prev_flag = flag;
elseif ((prev_flag == 0) && (flag == 2)) % left %% Serial Transmission
movement fprintf(s,'%1d\n',move);
if ((check_right == 1) || (check_straight_right == disp('done');
1)||(check_right_left)) end
move = 3; hold on;
display('motor stays');
check_right = 0; end
check_straight_right = 0; stop(vid);
check_right_left = 0; flushdata(vid);
else pause(0.04);
move = 0; fclose(s);
display('motor moved left'); delete(s);

DEPARTMENT OF ECE, AITS, RAJAMPET Page 17


ELECTRONIC WHEEL CHAIR 2020

clear s; The micro-controller sends of the signals to the


clear all; wheelchair controller so as to get following
8. SPEED OF EXECUTION results.
We were never actually limited by Forward Motion
the speed of execution. We could go upto 15 The wheelchair moves in the forward direction if
frames a second, evaluating and determining the the left wheel moves in the clockwise direction
face tilt. But there were couple of issues because and the right wheel moves in the anti-clockwise
of which we limited the speed of execution. direction. Thus the status of the output port A1
One being, we do not want the A2 A3 A4 is ‘1 0 0 1’.
person to get a jerk whenever he wants to move.
Hence we compute and drive the motor at a slow
pace, as compared to the ability we can escalate
the speed to.
Also, we want to keep the system
secure by taking a while to evaluate the
movement and thereafter making a decision,
given the criticality of the application.
9.RESULT
The micro-controller
isinterfacedwith the wheelchair controller as
Figure18.forward direction
shown in FIG
Right Motion
The wheelchair moves in the forward
direction if the both the wheels move in the
clockwise direction. Thus the status of the output
port A1 A2 A3 A4 is ‘1 0 1 0’.
The project performs satisfactory with
performance accuracy of around 70-90%. to
move in a random direction The results after
testing it for 100 to 200 attempts were made by
both the project members. The results were
tabulated as shown. The results after testing it
for 100 to 200 attempts. . Thus the status of the
output port A1 A2 A3 A4 is ‘1 0 1 0’.
Figure17.block diagram 4

DEPARTMENT OF ECE, AITS, RAJAMPET Page 18


ELECTRONIC WHEEL CHAIR 2020

Accuracy
The project performs satisfactory with
performance accuracy of around 70-90%. The
results after testing it for 100 to 200 attempts to
move in a random direction were made by both
the project members. The results were tabulated
as shown.

Figure19.right direction

Left Motion
The wheelchair moves in the
forward direction if the both the wheels move in
the anti-clockwise direction. Thus the status of
the output port A1 A2 A3 A4 is ‘0 1 01’.
For the system to be accurate, each
time a system is configured for a person, alter the
height

Table1. accuracy table

Successful attempts were counted


as all those attempts which resulted in movement
of the wheel chair in the desired direction. For
the system to be accurate, each time a system is
configured for a person, alter the height and
length of the specified eye so that the system
recognizes the eye of the person with high
precision.
For the system to be accurate, each
time a system is configured for a person, alter the
height and length of the specified eye so that the
system recognizes the eye of the person with
Figure 20. left direction
high precision.

DEPARTMENT OF ECE, AITS, RAJAMPET Page 19


ELECTRONIC WHEEL CHAIR 2020

10. ADVANTAGES: c) Controlled movement in either direction for


 They do the work for you limited time period.
d) Less jerk by incorporating delay in the wheel
 They are ideal for going long distances
chair drive.
 They are ideal if you no longer have the e) Halt control using blink detection.
strength to use a manual wheelchair 12. APPLICATIONS:
 They can use used on many surfaces Smart Wheel Chair has a wide range of
application and scope in following areas:
 They offer customable options to improve
 Physically Challenged People
your comfort level
Physically Disabled People can use it as per their
 Less expensive than the congenital automatoc purposes. People who are able to use their hand
wheel chair. can use Joystick; People suffering from certain

 Obstacle detection using IR sensors. paralysis can use either voice or head movement
as per requirement.
 Capable of controlling the wheel chairs
 Patients in the Hospitals
motion for disabled people using hand
People suffering from certain paralysis can use
gestures.
either voice or head movement as per
 Front wheel povides high muerability. requirement.
 Old Age Homes
 DISADVANTAGES:
People at old age homes can use this chair as per
 They can be cost prohibitive their requirement.
 They are significantly heavier than manual • In hospitals for handicapped patients .
wheelchairs • It can be used b elderly and physically
challenged person to move inside the
 They are difficult to transport – you may
home with out an difficulty
require a customized vehicle

 You’ll need to be conscious of power usage


13. CONCLUSION:
11. SAFTY FEAUTURES This systemconsists of a camera,
The safety features incorporated in the system micro-controller and wheelchair controller. This
were - hardware along with the software can prove to be
a) Controlled speed of detection and wheel chair an effective system to make the life of the
drive. paraplegic patients independent.
b) Eye height and width threshold. The critical part of the system is
image processingat real time whichcan be
DEPARTMENT OF ECE, AITS, RAJAMPET Page 20
ELECTRONIC WHEEL CHAIR 2020

addressed by using better high end image 1. http://rvsn.csail.mit.edu/wheelchair/ The MIT


processing software. Intelligent Wheelchair Project
The system functions with an 2. Mazidi, Muhammad Ali. The 8051
accuracy rate of 70-90 % which was above our Microcontroller and Embeded system. Secand.
expectations. The image capture, eye movement New Delhi : Prentice-Hall of India Pvt.Ltd,
detection and the algorithm for validating 2007. pp. 282-283.
movement attempts perform very reliably as our 3. Fowler, Kim R. Electronic Instrument
results suggest. Design. 7th. New Delhi: Oxford University
The aim of this project is to contribute Press, 2009.
to the society in our small way by setting out an 4. Sedra, Adel S. and Smith, Kenneth
idea for a system which could actually better the C,”Microelectronic Circuits”, Oxford University
lives of millions of people across the globe. We Press, 1998.
believe we have done great justice to the idea, 5. Mehta, V.K. Principle Of Electronics.
and ended up getting more than satisfying Second. New Delhi : S Chand and Company
results. Limited, 2002.
14.FUTURE MODIFICATIONS 7.wwwmicrocontrollershop.com.

Though our prototype performs [Online].http://microcontrollershop.com/

satisfactorily, but a lot of work needs to be done product_

before making the product commercially viable. info.php?products_id=1078.

Some sort of sequence of events should trigger 8.www.hvwtech.com[Online].http://

start of detection, because we do not want the www.hvwtech.com/products_view.asp?Produc

wheel chair to move. tID=341.

When the person is just casually glaring 9.Journal of Rehabilitation Research and

in different directions. Similarly, we can Development Vol . 37 No . 3, May/June 2000

incorporate certain sequence for turning ON and Pages 353—360 by Department of Veterans

OFF electrical devices, or door locks. Affairs

Also since the criticality of the 10.Wooding, D.S. (2002). Fixation Maps:
application is so high, lot of safety precautions quantifying eye-movement traces.
need to be incorporated. It needs to be made sure In:Proceedings of the Eye Tracking Research &
that the system is not fatal to the health of the Applications Symposium 2002. 31-36.New York,
person. A lot of testing needs to be done before ACM.
making such a product a reality. 11. Salvucci, D.D. &Goldberg, J.H. (2000).
Identifying fixations and saccades in eye-
15. REFERENCES:
tracking protocols. In: Proceedings of the Eye
DEPARTMENT OF ECE, AITS, RAJAMPET Page 21
ELECTRONIC WHEEL CHAIR 2020

Tracking Research and Applications Symposium


2000,71-78. NY: ACM Press.
12. “OpenEyes: a low-cost head-mounted eye-
tracking solution” [Li, Babcock,Parkhurst 2006]
13. Raj kamal,Microcontrollers: Architecture,
Programming, Interfacing and System Design,
Prentice Hall.
14. www.mathwork.com

DEPARTMENT OF ECE, AITS, RAJAMPET Page 22

You might also like