Zul Feen

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Proceedings of International Conference on Circuits, Communication, Control and Computing (I4C 2014)

Virtual Mouse
Ashish Mhetar 1 , B K Sriroop2, Kavya AGS3,Ramanath Nayak4, Ravikumar Javali5, Suma K V6

1, 2, 3, 4, 5 6
Student Assistant Professor
M.Tech – VLSI Design & Embedded Systems ECE Department,
MSRIT, Bangalore MSRIT, Bangalore
Email: mashish@gmail.com Email: sumakv@msrit.edu
Sriroop.91@gmail.com
Kavya.home@gmail.com
ramanathj@gmail.com
ravijavali13@gmail.com

with an IR camera using I2C interface. IR Camera tracks IR


ABSTRACT sources and sends information regarding its position which is
The major aspect in today’s e-learning is the improvement converted to X and Y co-ordinates by Teensy and moves
in the methods of teaching by using technology dependent mouse pointer to the position pointed by co-ordinates.
resourceful products to have a better communication and
interaction between the teacher and the student. In favor of 2. LITERATURE SURVEY
this, we have proposed a product which aims to be a virtual
Multi-point Interactive Whiteboards are available using the
marker and also has additional advantage that it has features
of a Mouse incorporated into it. The existing Virtual Marker Wiimote [4]. The components used are IR pen, computer with
is modified to function more than a marker and act as a Windows XP (installed with Microsoft .NET framework, the
mouse pointer also giving it the advantage of all the Wiimote Connect program and the Wiimote Whiteboard
functionality of a mouse. In this paper, we have proposed a software), wiimote controller, a beamer capable of a 1024 x
hardware implementation of a Virtual Mouse which has an 786 pixel resolution. Here the wiimote controller tracks the
improvement in performance of the existing “Virtual infra-red source on the white board and sends info to PC via
Marker” by making it highly responsive in real time. Bluetooth. The teaching platform comprises of a Wii-mote-
based multi-touch teaching station, a Wii-mote-based
Key Words: Virtual Marker, Virtual Mouse,
interactive whiteboard and a Wii-mote-based stylus input
conversion tool [5]. According to the literature survey, most
people have used the Wii-mote to configure it as a virtual
1. INTRODUCTION
marker.
A virtual mouse is a device used to air-browse the functions of
a system such as a computer, laptop or a smart-pad with the 2.1 MOTIVATION
functions corresponding to a mouse and a marker. It can be
used in class-rooms for teaching without the board and chalk. A lot of virtual markers are available in market, but it can only
This can also be used in conferences as a smart device to work function as a marker alone. A high level processor is used to
as a mouse. A person is just required to make the process the data and used as a virtual marker, but it can do
corresponding gestures imitating a mouse or a marker in front even more function like mouse functions. Its capability is not
of an Infra-red (IR) camera using this hardware device which being utilized fully to its ability to function and hence the
is modeled as a pen and this avoids the use of wired mouse, product becomes under-loaded and hence costlier in terms of
chalks and boards. A virtual marker is already implemented by market price versus function.
using softwares to process the images captured to get the co-
ordinates. A WII-remote is configured to act as a virtual 3. PROPOSED SOLUTION
marker with a IR source. But since it uses software it involves In this paper we propose a method to improve the utilization of
certain delay to process and obtain the co-ordinates and more- resources without wasting its ability to create a virtual mouse
over it acts as a marker alone. and decrease the cost when compared to the functions it can
Using this idea we can build virtual marker provide functions perform. A virtual mouse is more compatible and useful than a
of a mouse by using a high-end microcontrollers configured as marker and performs all the functions of a mouse while it can
a Human Interface Device (HID) for faster response interfaced still act as a marker.

MSRIT, BANGALORE, India, 21-22 NOVEMBER 2014 978-1-4799-6546-5/14/$31.00 © 2014 IEEE 69


Proceedings of International Conference on Circuits, Communication, Control and Computing (I4C 2014)

3.1 Block Diagram: 3.4 Optical Characteristics of IR Camera:


Figure 1 shows general block diagram of virtual mouse. The IR camera has an effective field of view is about 33
Infrared camera is interfaced with Teensy 3.1 using I2C degrees horizontally and 23 degrees vertically (as measured on
Communication which in turn is connected to laptop. one unit). With the IR-pass filter intact, 940nm sources are
detected with approximately twice the intensity of equivalent
850nm sources, but are not resolved as well at close distances.
If the filter is removed, it can track all IR frequencies such as
IR light from tube light, sunlight etc.

3.4.1 Data Formats


The IR Camera can return different sets of data describing the
objects it is tracking. When the IR camera identifies an object,
it assigns it to the first available object slot. If an object moves
out of view, its slot is marked as empty (returns 0xFF data),
but other objects retain their slots. For example, if the camera
is tracking two objects and the first moves out of view, the
data returned will be [empty, second object, empty, empty].
With more than four objects visible, the camera is prone to
rapidly switching between some of them. This could allow
perception of more than four objects, at a reduced response
Figure 1: General block diagram speed and reliability.
IR Camera works in different operating modes which are as
3.2 PIXART'S IR CAMERA: follows: [2]
The Wii Remote includes a 128x96 monochrome camera with 1) Basic Mode
built-in image processing. The camera's built-in image 2) Extended Mode
processing is capable of tracking up to 4 moving IR objects, 3) Full Mode
and these data are the only data available to the host. Raw Each mode has its own data format which is explained below
pixel data is not available to the host, so the camera cannot be The data format MUST match the number of bytes available in
used to take a conventional picture. The built-in processor uses the Reporting Mode selected. Even choosing a mode with
8x sub pixel analysis to provide 1024x768 resolutions for the space for more bytes than necessary will not work, it has to be
tracked points. an exact match. In this project we have chosen extended mode.

Extended Mode
In Extended Mode, the IR Camera returns the same data as it
does in Basic Mode, plus a rough size value for each object.
The data is returned as 12 bytes, three bytes per object. Size
has a range of 0-15.
Figure 2: IR camera The data format for each object is shown in Figure 4:

3.3 IR Camera Interfacing:


The camera outputs the data over an I2C line or what is
sometimes referred to as a Two-Wire-Interface (TWI).
Following Figure 3 shows pin configuration for PixArt IR
Camera.

Figure 4: Extended mode

3.5 HUMAN INTERFACE DEVICE


We have used a microcontroller which can mimic HID mouse
function provided the coordinates. Using this HID
Figure 3: Pin out of Pixart IR camera functionality we can implement Virtual IR Mouse.
A human interface device or HID is a type of computer device
The IR Camera is enabled by setting bit 2 on output ports 0x13 that interacts directly with, and most often takes input from,
and 0x1a: humans and may deliver output to humans. The term "HID"
The first enables a 24MHz pixel clock on pin 7 of the camera. most commonly refers to the USB-HID specification.
The second pulls pin 4 low - probably an active low enable.

MSRIT, BANGALORE, India, 21-22 NOVEMBER 2014 70


Proceedings of International Conference on Circuits, Communication, Control and Computing (I4C 2014)

In the HID protocol, there are 2 entities: the "host" and the
"device". The device is the entity that directly interacts with a
human, such as a keyboard or mouse, in this case device is
Virtual Mouse. Virtual Mouse consists of a IR LED (IR
Source), battery and three buttons for mouse operations. The
host communicates with the device and receives input data
from the device on actions performed by the human. The host
in this case is Teensy (ARM M4) [3]. Output data flows from
the host to the device and then to the human.

3.6 WORKING PRINCIPLE


The algorithm of virtual mouse is as follows:
i. Object recognition.
ii. Trace object.
iii. Co-ordinate calculation.
iv. Setting cursor position.
Figure 6: General setup required for implementing virtual mouse
v. Event generation.
First presenter or tutor will hold the IR Pen(Virtual Mouse) in
Here we are using PixArt's IR Camera from Nintendo Wiimote
hand to do required mouse gestures. To begin with, the
device. This Camera is first initialized using initialization
working area of the Virtual Mouse is defined by the first four
sequence. For this application we have set the Camera in
clicks at the corners of projector screen. IR camera gives one
Extended Mode for its operation. We will use IR Pen as IR
co-ordinate data for each click. After getting the data co-
light source, made by IR LED and battery as shown in figure
ordinates are calculated as follows.
5.

iii. Co-ordinate calculation.


After getting the data the Coordinate conversion command is
sent, to read as follows.
[START condition] [0xB1]
It will give 3 bytes data for each co-ordinate position, those
bytes are referred as XX, YY & SS. X & Y co-ordinates are
calculated using these co-ordinate values as shown by
following equations
Figure 5: Virtual Mouse (IR Pen) X coordinate = (SS & 0x30) << 4 + XX (1)

Sensor assembly contains IR Camera interfaced with a high Y coordinate = (SS & 0xC0) << 2 + YY (2)
end microcontroller Teensy(ARM M4) using two wire
interface I2C protocol, Teensy in turn is connected with laptop iv. Setting cursor position.
or computer by wired or wireless connection. By using these calculations, it is possible to obtain the values
i. Object Recognition: of the coordinates. As mentioned a microcontroller which has
IR camera works with frequency of 24MHz which can be HID function can be used to move the mouse pointer. The
generated using external crystal or using Teensy. This Camera Teensy library has inbuilt HID functions. The X and Y co-
only Recognizes IR source. Hence it will recognize the IR ordinates that we got from IR camera is given as arguments to
light from Virtual Mouse. HID functions which moves the mouse pointer to that position
ii. Trace object. shown by X and Y co-ordinates, hence setting the mouse
We are using teensy for generating this 24MHz clock. IR pointer. If we want to imitate mouse actions such as left click
Camera uses this clock to sweep both X and Y axes. Sweeping and right click we can use inbuilt library and implement mouse
through X and Y axes gives exact position of IR blob (Object) functions.
hence tracing the source. Camera then sends this position data v. Event generation.
to a microcontroller through I2C communication as shown in As you move the mouse, IR camera tracks the IR Led position
block diagram. as co-ordinate of that point and reflects same motion on
Figure 6 shows general setup required for implementing virtual projector. As we move the Virtual mouse; Camera will track
mouse, it shows general distance and angle requirement for its new position and teensy moves the mouse pointer to new
good results. Actually sunrays and tube light also contains IR position. Like this, as you keep on moving the mouse Camera
frequency light and our IR camera also detects these rays. But will go on tracking the blob and Teensy will move the mouse
as we don't want these rays to be detected by camera, we will to that position Hence imitating the gesture. This process is
use a filter glass that will filter out IR rays from sunlight and done at 24MHz frequency, hence the actual series of points
tube light. It will only detect IR Pen. appears as continuous line.

MSRIT, BANGALORE, India, 21-22 NOVEMBER 2014 71


Proceedings of International Conference on Circuits, Communication, Control and Computing (I4C 2014)

4. EXPERIMENTAL RESULTS
Accurate marking of coordinates is crucial for the working of
Virtual Mouse. The Coordinate calculations are done using
equations (1) and (2). The Virtual Mouse can perform
different functions as follows:
1) Virtual Marker: Many times while doing presentation we
may require marker to explain some concept. Instead of actual
writing on board, virtual mouse can be used as marker to write
virtually on screen. As shown in Figure 7, we can write
anything in a Paint document which is reflected on screen.
Figure 10: Interpretation of Figure 9

Then actual co-ordinates are calculated using the equation (1)


& (2) mentioned in the co-ordinate calculation. Then library
function will imitate right click at that point opening right click
dialog box.

5. CONCLUSION
The major aspect in today’s e-learning is the improvement in
the methods of teaching by using technology dependent
Figure 7: Virtual Mouse used as a Virtual Marker resourceful products to have a better communication and
interaction between the teacher and the student. In favor of
2) Mouse Functions (Right Click and Left Click): Virtual this, people have proposed virtual marker; but our proposed
Mouse can be used to perform mouse clicks virtually on screen product aims much more than a marker and can be used even
result of which is actually reflected in computer. As shown in as a mouse. Thus exploring the HID functions of a high end
Figure 8 we can see that when we left click on windows button microcontroller and increasing its utility by amplifying its
on screen we can see on computer that it actually pops functionality is done and the desired results are obtained.
windows option after click. As shown in Figure 9 when we
right click on desktop, a window pops on the screen showing
options after a click. REFERENCES:

[1] Hacking the Nintendo Wii Remote, www.computer.org/pervasive/


lee2008.pdf
[2] http://procrastineering.blogspot.com/2008/09/working-with-pixart-
camera- directly.html
[3] Teensy (ARM M4), https://www.pjrc.com/teensy/
[4] Johnny Chung Lee, http://www.wiimoteproject.com/ Johnny Chung Lee
- Projects - Wii.pdf
[5] Soon Nyean Cheong, Wen Jiun Yap and Mun Leong Chan, “Cost-
effective wiimote-based technology enhanced teaching and learning
platform”, 2nd International Conference of Teaching and Learning
(ICTL) INTI University College, Malaysia, 2009
[6] Nintendo, Consolidated Financial Highlights, www.nintendo.
co.jp/ir/pdf/2008/080124e.pdf, 24 Jan. 2008,
[7] A Murgia1, R Wolff2, P M Sharkey1 and B Clark1, “Low-cost optical
Figure 8: Left Click using Virtual Mouse tracking for immersive collaboration in the CAVE using the Wii
Remote”, Proc. 7th ICDVRAT with ArtAbilitation, Maia, Portugal, pp
104-109, 2008
[8] Andreas Holzinger, Selver Softic, Christian Stickel, Martin Ebner.
“Nintendo Wii Remote Controller in for Higher Education:
Development and Evaluation of a Demonstrator Kit for e-Teaching”,
Graz University of Technology, Institute for Information Systems &
Computer Media (IICM)

Figure 9: Right Click using Virtual Mouse

For right click in figure 9, IR camera tracks IR light and gives


co-ordinates of that point. The graphical representation of
Figure 9 is shown in the Figure 10.

MSRIT, BANGALORE, India, 21-22 NOVEMBER 2014 72

You might also like