Water transportation system | w1

Haven’t record the video yet, will post it after class.

The final device is going to be a muti-channels water transportation system, that could pump the water out from a lower height to muti-holes on a higher place based on the physical interaction with the other components.  I have not dicided what is going to be the physical interaction part of the component yet.

The first week iteration of this is a tiny device controlled by keyboard and wake up the pump and a solenoid. The solenoid here is acting as a sound player’s role.

teensy-solenoid

This is the original circuitry for just the solenoid. I switch the board from teensy to Arduino uno, and also switched the 2 npn transistors into a TIP120. The connections for the pump is exactly the same as solenoid, so it is two parallel motor connection in on circuitry. Here is the prototype connection.

img_7114

 

-Part list

  1. 12v pump
  2. 4.5v solenoid
  3. 2 * TIP120 Power Darlington Transistors
  4. Aduino UNO
  5. 2 * 1N4148 Signal Diodes

-Arduino code for it

/* Simple Serial ECHO script : Written by ScottC 03/07/2012 */

/* Use a variable called byteRead to temporarily store
the data coming from the computer */
byte byteRead;
int state = 0;
int solenoidPin = 8;
int pumpPin = 7;
//int touchSensor = 6;

void setup() {
// Turn the Serial Protocol ON
Serial.begin(9600);
pinMode(solenoidPin, OUTPUT);
pinMode(pumpPin, OUTPUT);
// pinMode(touchSensor, INPUT);
}

void loop() {
/* check if data has been sent from the computer: */
if (Serial.available()) {
/* read the most recent byte */
byteRead = Serial.read();
Serial.println(byteRead);
/*
* 0- no sound, 1 slow, 2 fast
* 3 switch to manual mode, 4 in manual mode triggers sound
* 5 switch to water only, on mode
* 6 is water off
*/
if (byteRead == 48) state = 0;
if (byteRead == 49) state = 1;
if (byteRead == 50) state = 2;
if (byteRead == 51) state = 3;
if (byteRead == 53) state = 5;
if (byteRead == 54) state = 6;

}
switch (state) {
case 0:
break;
case 1:
digitalWrite(solenoidPin, HIGH);
// digitalWrite(pumpPin, HIGH);
delay(500);
digitalWrite(solenoidPin, LOW);

// digitalWrite(pumpPin, LOW);
delay(500);
break;
case 2:
digitalWrite(solenoidPin, HIGH);

delay(300);
digitalWrite(solenoidPin, LOW);
delay(300);
break;
case 3:
//type 4 in keyboard to triger sound
if (byteRead == 52) {
digitalWrite(solenoidPin, HIGH);
delay(50);
digitalWrite(solenoidPin, LOW);
delay(50);
}
byteRead = 51;
break;
// case 5:
// digitalWrite(solenoidPin, LOW);
// digitalWrite(pumpPin, HIGH);
// break;
// case 6:
// digitalWrite(solenoidPin, LOW);
// digitalWrite(pumpPin, LOW);
// break;

}
if (state == 5) {
digitalWrite(solenoidPin, LOW);
digitalWrite(pumpPin, HIGH);
}

else if(state == 6){
digitalWrite(solenoidPin, LOW);
digitalWrite(pumpPin, LOW);

}

// int touchInput = digitalRead(touchSensor);
// if (touchInput == 1) {
// digitalWrite(pumpPin, HIGH);
// delay(50);
//
// }
// else {
// digitalWrite(pumpPin, LOW);
// delay(50);
// }
}

Leave a Reply

Your email address will not be published. Required fields are marked *