Upload
ruben-flores
View
65
Download
1
Embed Size (px)
Citation preview
SENIOR PROJECT ECET494Team Members:
Alex Barkatz
Luis Feliz
Ruben Flores
Emmanuel Torres
Mouthmouse
In our senior project experience, we wouldn’t have been able to accomplish building the prototype of the MouthMouse without the help and support from other people who have helped us grow from this experience. It has been a great experience, and we would like to remember the people who have shared this experience with us as we continue on our career in electronics engineering and technology.
We would like to acknowledge Prof. Duclos for helping us understand the theories behind wireless communication.
We would like to acknowledge Prof. D’Souza for his expertise in coding language.
We would like to acknowledge Prof. Sommer for her clarity in teaching and her expertise in PowerPoint presentations.
Acknowledgement
Develop a mouthpiece that will act as a mouse or touchpad and connect to any device via classical Bluetooth. We created a frame that will fit inside your mouth and control a PC cursor using six force sensors. Each force sensors will have different functions such as up, down, left, right, left click and right click. Our main goal is to develop a product that can be used by, disable people to enhance their computer skills; programmer to increase productivity time; and gamer for speed performance.
First Mouthmouse prototype
Abstract
Force sensor FSR 400
Tinyduino
TinyDuino microcontroller kit
CR1632 Battery
Silicone putty
Components and Materials
Item Price per Unit Quantity Total
Force Sensor $8.00 6 $48.00
Tinyduino Kit $40.00 1 $40.00
Bluetooth Module
$50.00 1 $50.00
Silicone Putty $12.00 1 $12.00
Battery $3.00 10 $30.00
Miscellaneous $100.00 $100.00
$280.00
Budget
A miniaturized Arduino made by a company called Tiny Circuits and it is a derivative of the Arduino, this means that it is made by a different company. It is based on the same Arduino environment, it uses the Arduino IDE. Like the Arduino the Tinyduino also have shield that add capability to the microprocessor and the company is constantly developing new shield for the Tinyduino., for example, Wi-Fi, Bluetooth, BLE, micro SD card, Ethernet, accelerometer, GPS, etc. The processor board has a surface mount chip Atmega328p, the same chip used by the Arduino.
The ATmega328p is a single chip micro-controller created by Atmel and belongs to the mega AVR series. The AVR is a modified Harvard architecture 8-bit RISC single-chip microcontroller, which was developed by Atmel in 1996. The AVR was one of the first microcontroller families to use on-chip flash memory for program storage, as opposed to one-time programmable ROM, EPROM, or EEPROM used by other microcontrollers at the time.
About Tinyduino
int Senpin4=A4;
int Senpin5=A5;
void setup() {
Serial.begin(9600);
}
void loop() {
pot0 = analogRead(Senpin0);
pot1 = analogRead(Senpin1);
pot2 = analogRead(Senpin2);
int pot0;
int pot1;
int pot2;
int pot3;
int pot4;
int pot5;
int Senpin0=A0;
int Senpin1=A1;
int Senpin2=A2;
int Senpin3=A3;
Arduino Code
delay(1);
Serial.print(pot2);
delay(1);
Serial.print(",");
delay(1);
Serial.print(pot3);
delay(1);
Serial.print(",");
delay(25);
Serial.print(pot4);
delay(1);
pot3 = analogRead(Senpin3);
pot4 = analogRead(Senpin4);
pot5 = analogRead(Senpin5);
Serial.print(pot0);
delay(1);
Serial.print(",");
delay(1);
Serial.print(pot1);
delay(1);
Serial.print(",");
Arduino Code
Serial.print(",");
delay(1);
Serial.println(pot5);
delay(25);
delay(500);
}
Arduino Code
This class is used to generate native system input events for the purposes of test automation, self-running demos, and other applications where control of the mouse and keyboard is needed. The primary purpose of Robot is to facilitate automated testing of Java platform implementations. Using the class to generate input events differs from posting events to the AWT event queue or AWT components in that the events are generated in the platform's native input queue. For example, Robot.mouseMove will actually move the mouse cursor instead of just generating mouse move events. Basically, a Robot object makes it possible for your program to temporarily take over control of the mouse and the keyboard. However, this may not be possible on all operating systems. Note that some platforms require special privileges or extensions to access low-level input control. If the current platform configuration does not allow input control, an AWTException will be thrown when trying to construct Robot objects.
Robot Class
double width = screenSize.getWidth();
double height = screenSize.getHeight();
import processing.serial.*;
Serial port;
void setup(){
size(138,100);
Multisimimport java.awt.*;
import java.awt.event.*;
int xx =0, yy =0, nxx =0, nyy =0, count0=0, count1=0, count2=0, count3=0, flag = 5, flag2 =5;
Robot mouse;
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
Processing2 Code
try{
mouse = new Robot();
}
catch (AWTException e){
println("Not Supported robot class!"); exit(); }
}
void leftclick(){
mouse.mousePress(InputEvent.BUTTON1_MASK);
try{
port = new Serial (this,"com3",9600); port.bufferUntil('\n');
}
catch(Exception ex){
text("There is no serial port communication!",10,14);
}
Processing2 Code
mouse.mouseRelease(InputEvent.BUTTON3_MASK);
}
void draw(){
System.out.println("("+nxx+", "+nyy+")");
nxx=MouseInfo.getPointerInfo().getLocation().x;
nyy=MouseInfo.getPointerInfo().getLocation().y;
}
mouse.mouseRelease(InputEvent.BUTTON1_MASK);
mouse.mousePress(InputEvent.BUTTON1_MASK);
mouse.mouseRelease(InputEvent.BUTTON1_MASK);
}
void rightclick(){
mouse.mousePress(InputEvent.BUTTON3_MASK);
Processing2 Code
xx=nxx;
yy=nyy;
}
else{
for(int i=0; i<5;i++){
if(sensor[0]==0 && sensor[1]>0 && sensor[2]>0 && sensor[3]>0 && sensor[4]>0 && sensor[5]>0){
xx++;
count0++;
void serialEvent(Serial myPort){
String incoming = myPort.readStringUntil('\n');
if(incoming != null){
incoming = trim(incoming);
int[] sensor = int(split(incoming, ","));
if(sensor.length >= 0){
if (nxx>xx+10 || nyy>yy+10 || nxx<xx-10||nyy<yy-10){
Processing2 Code
if(count1>200)
yy++;
}
if(count1>200 && sensor[1]>10)
count1=0;
if(sensor[2]==0 && sensor[1]>0 && sensor[0]>0 && sensor[3]>0 && sensor[4]>0 && sensor[5]>0){
yy--;
count2++;
if(count0>200)
xx++;
}
if(count0>200 && sensor[0]>10)
count0=0;
if(sensor[1]==0 && sensor[0]>0 && sensor[2]>0 && sensor[3]>0 && sensor[4]>0 && sensor[5]>0){
yy++;
count1++;
Processing2 Code
if(count3>200)xx--;}if(count3>200 && sensor[3]>10)count3=0;
if(xx>width)
xx=1;
if(xx<1)
xx = (int)Math.round(width);
if(yy>height)
yy=1;
if(yy<1)
if(count2>200)
yy--;
}
if(count2>200 && sensor[2]>10)
count2=0;
if(sensor[3]==0 && sensor[1]>0 && sensor[2]>0 && sensor[0]>0 && sensor[4]>0 && sensor[5]>00){
xx--;
count3++;
Processing2 Code
if(sensor[4]==0 && sensor[1]>0 && sensor[2]>0 && sensor[3]>0 && sensor[0]>0 && sensor[5]>0 && flag == 5){
leftclick();
delay(500);
flag=0;
}
else
flag++;
yy = (int)Math.round(height);
mouse.mouseMove(xx,yy);
delay(1);
}
}
}
if(flag>5)
flag=5;
if(flag2>5)
flag2=5;
Processing2 Code
if(sensor[5]==0 && sensor[1]>0 && sensor[2]>0 && sensor[3]>0 && sensor[4]>0 && sensor[0]>0 && flag2 == 5){
rightclick();
delay(500);
flag2=0;
}
else
flag2++;
}
}
}
Processing2 Code
Flow Charts
Arduino - Software. (n.d.). Retrieved September 29, 2015, from https://www.arduino.cc/en/Main/Software
Fry, B., & Reas, C. (2014, May 19). Download Processing. Processing is available for Linux, Mac OS X, and Windows. Select your choice to download the software below. Retrieved September 29, 2015, from https://processing.org/download/?processing
Monk, D. (2013, February 16). All About Arduino Libraries. Retrieved September 29, 2015, from https://learn.adafruit.com/adafruit-all-about-arduino-libraries-install-use/installing-a-library
Hart, M. (n.d.). Arduino - SoftwareSerial. Retrieved October 6, 2015, from https://www.arduino.cc/en/Reference/SoftwareSerial
References
Universal asynchronous receiver/transmitter. (n.d.). Retrieved October 6, 2015, from https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter
Mouse control arduino uno on the pc. (n.d.). Retrieved October 6, 2015, from http://www.instructables.com/id/Mouse-control-arduino-uno-on-the-pc/
Virtual COM Port Drivers. (n.d.). Retrieved October 16, 2015, from http://www.ftdichip.com/Drivers/VCP.htm
(n.d.). Retrieved October 16, 2015, from https://en.wikipedia.org/wiki/Atmel_AVR#Basic_families
References
CR1632 3V Lithium Battery Swiss Made. (n.d.). Retrieved October 21, 2015, from http://www.renata.com/fileadmin/downloads/productsheets/lithium/3V_lithium/CR1632_v06.pdf
ENERGIZER CR1632. (n.d.). Retrieved October 21, 2015, from http://data.energizer.com/PDFs/cr1632.pdf
Robot (Java Platform SE 7 ). (n.d.). Retrieved October 21, 2015, from http://docs.oracle.com/javase/7/docs/api/java/awt/Robot.html
References