Function of the speech recognition of the smartphone to automatically operate a portable sample pretreatment microfluidic system
Khang Hoang Bui & Tae Seok Seo
const int valve1 = 12;
const int valve2 = 11;
const int valve3 = 10;
const int valve4 = 9;
const int valve5 = 8;
const int valve6 = 7;
const int valve7 = 6;
const int valve8 = 5;
// prepare, all block
void setup() {
Serial.begin(9600);
pinMode(valve1, OUTPUT);
pinMode(valve2, OUTPUT);
pinMode(valve3, OUTPUT);
pinMode(valve4, OUTPUT);
pinMode(valve5, OUTPUT);
pinMode(valve6, OUTPUT);
pinMode(valve7, OUTPUT);
pinMode(valve8, OUTPUT);
digitalWrite(valve1, LOW);
digitalWrite(valve2, LOW);
digitalWrite(valve3, LOW);
digitalWrite(valve4, LOW);
digitalWrite(valve5, LOW);
digitalWrite(valve6, LOW);
digitalWrite(valve7, LOW);
digitalWrite(valve8, LOW);
}
void loop() {
char c = Serial.read();
//FastestTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
if(c == 'a'){
digitalWrite(valve7, HIGH);
// sample solution - solution 1 loading
digitalWrite(valve2, HIGH);
digitalWrite(valve6, HIGH);
delay(1000);
digitalWrite(valve8, HIGH);
delay(6000);
///clean
digitalWrite(valve8, HIGH);
delay(3000);
digitalWrite(valve2, LOW);
digitalWrite(valve8, LOW);
digitalWrite(valve6, LOW);
//washing 1
delay(1000);
digitalWrite(valve4, HIGH);
digitalWrite(valve6, HIGH);
delay(1000);
digitalWrite(valve8, HIGH);
delay(6000);
///clean
digitalWrite(valve8, HIGH);
delay(3000);
digitalWrite(valve4, LOW);
digitalWrite(valve8, LOW);
digitalWrite(valve6, LOW);
//Washing 2
delay(1000);
digitalWrite(valve3, HIGH);
digitalWrite(valve6, HIGH);
delay(1000);
digitalWrite(valve8, HIGH);
delay(6000);
///clean
digitalWrite(valve8, HIGH);
delay(3000);
digitalWrite(valve3, LOW);
digitalWrite(valve8, LOW);
digitalWrite(valve6, LOW);
//Elution
digitalWrite(valve1, HIGH);
digitalWrite(valve5, HIGH);
delay(1000);
digitalWrite(valve8, HIGH);
delay(6000);
///clean
digitalWrite(valve8, HIGH);
delay(3000);
digitalWrite(valve1, LOW);
digitalWrite(valve8, LOW);
digitalWrite(valve5, LOW);
digitalWrite(valve7, LOW);
}
//Normallllllllllllllllllllllllllllllllllllllllllllll
else if(c == 'b'){
digitalWrite(valve7, HIGH);
digitalWrite(valve2, HIGH);
digitalWrite(valve6, HIGH);
delay(1000);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
///clean
digitalWrite(valve8, HIGH);
delay(3000);
digitalWrite(valve2, LOW);
digitalWrite(valve8, LOW);
digitalWrite(valve6, LOW);
//washing 1
delay(1000);
digitalWrite(valve4, HIGH);
digitalWrite(valve6, HIGH);
delay(1000);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
///clean
digitalWrite(valve8, HIGH);
delay(3000);
digitalWrite(valve4, LOW);
digitalWrite(valve8, LOW);
digitalWrite(valve6, LOW);
//Washing 2
delay(1000);
digitalWrite(valve3, HIGH);
digitalWrite(valve6, HIGH);
delay(1000);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
///clean
digitalWrite(valve8, HIGH);
delay(3000);
digitalWrite(valve3, LOW);
digitalWrite(valve8, LOW);
digitalWrite(valve6, LOW);
//Elution
digitalWrite(valve1, HIGH);
digitalWrite(valve5, HIGH);
delay(1000);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(1000);
digitalWrite(valve8, LOW);
delay(500);
///clean
digitalWrite(valve8, HIGH);
delay(3000);
digitalWrite(valve1, LOW);
digitalWrite(valve8, LOW);
digitalWrite(valve5, LOW);
digitalWrite(valve7, LOW);
}
//SLOWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
else if(c == 'c'){
digitalWrite(valve7, HIGH);
digitalWrite(valve2, HIGH);
digitalWrite(valve6, HIGH);
delay(1000);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
///clean
digitalWrite(valve8, HIGH);
delay(3000);
digitalWrite(valve2, LOW);
digitalWrite(valve8, LOW);
digitalWrite(valve6, LOW);
//washing 1
delay(1000);
digitalWrite(valve4, HIGH);
digitalWrite(valve6, HIGH);
delay(1000);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
///clean
digitalWrite(valve8, HIGH);
delay(3000);
digitalWrite(valve4, LOW);
digitalWrite(valve8, LOW);
digitalWrite(valve6, LOW);
//Washing 2
delay(1000);
digitalWrite(valve3, HIGH);
digitalWrite(valve6, HIGH);
delay(1000);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
///clean
digitalWrite(valve8, HIGH);
delay(3000);
digitalWrite(valve3, LOW);
digitalWrite(valve8, LOW);
digitalWrite(valve6, LOW);
//Elution
digitalWrite(valve1, HIGH);
digitalWrite(valve5, HIGH);
delay(1000);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(500);
digitalWrite(valve8, LOW);
delay(500);
///clean
digitalWrite(valve8, HIGH);
delay(3000);
digitalWrite(valve1, LOW);
digitalWrite(valve8, LOW);
digitalWrite(valve5, LOW);
digitalWrite(valve7, LOW);
}
//SLOWEST
if(c == 'd'){
digitalWrite(valve7, HIGH);
// sample solution - solution 1 loading
digitalWrite(valve2, HIGH);
digitalWrite(valve6, HIGH);
delay(1000);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
///clean
digitalWrite(valve8, HIGH);
delay(3000);
digitalWrite(valve2, LOW);
digitalWrite(valve8, LOW);
digitalWrite(valve6, LOW);
//washing 1
delay(1000);
digitalWrite(valve4, HIGH);
digitalWrite(valve6, HIGH);
delay(1000);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
///clean
digitalWrite(valve8, HIGH);
delay(3000);
digitalWrite(valve4, LOW);
digitalWrite(valve8, LOW);
digitalWrite(valve6, LOW);
//Washing 2
delay(1000);
digitalWrite(valve3, HIGH);
digitalWrite(valve6, HIGH);
delay(1000);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
///clean
digitalWrite(valve8, HIGH);
delay(3000);
digitalWrite(valve3, LOW);
digitalWrite(valve8, LOW);
digitalWrite(valve6, LOW);
//Elution
digitalWrite(valve1, HIGH);
digitalWrite(valve5, HIGH);
delay(1000);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
digitalWrite(valve8, HIGH);
delay(250);
digitalWrite(valve8, LOW);
delay(500);
///clean
digitalWrite(valve8, HIGH);
delay(3000);
digitalWrite(valve1, LOW);
digitalWrite(valve8, LOW);
digitalWrite(valve5, LOW);
digitalWrite(valve7, LOW);
}
else{
}
delay(25);
}