Created
November 24, 2017 06:57
-
-
Save winhtut/5c45653503467240c853e21143228440 to your computer and use it in GitHub Desktop.
water_Salt_Sugar_Calculation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This Code is tested by WinHtut | |
* Green Hackers Team | |
* Whatever you do | |
* Whatever you want | |
* As you like! | |
*/ | |
int water=A0; | |
int sugarwater=A1; | |
int saltwater=A2; | |
int normal_water=0; | |
int normal_sugarwater=0; | |
int normal_saltwater=0; | |
float V_of_NormalWater=0; | |
float V_of_SugarWater=0; | |
float V_of_SaltWater=0; | |
float Resistance_of_NormalWater=0; | |
float Resistance_of_SugarWater=0; | |
float Resistance_of_SaltWater=0; | |
void setup() { | |
Serial.begin(9600); | |
Serial.println("Welcome To GreenHackersTeam"); | |
Serial.println("_________WinHtut__________"); | |
delay(2000); | |
} | |
void loop() { | |
normal_water=analogRead(water); | |
Serial.print("AnalogValueOf_normal_water= "); | |
Serial.println(normal_water); | |
V_of_NormalWater=normal_water*(5.0/1023.0); | |
Serial.print("Voltage of NormalWater = "); | |
Serial.print(V_of_NormalWater); | |
Serial.println(" V"); | |
Resistance_of_NormalWater=V_of_NormalWater/(40.0/1000.0); | |
Serial.print("Resistance_of_NormalWater = "); | |
Serial.print(Resistance_of_NormalWater); | |
Serial.println(" Ohm"); | |
Serial.println(" ---"); | |
normal_sugarwater=analogRead(sugarwater); | |
Serial.print("AnalogValueOf_sugarwater= "); | |
Serial.println(normal_sugarwater); | |
V_of_SugarWater=normal_sugarwater*(5.0/1023.0); | |
Serial.print("Voltage of SugarWater= "); | |
Serial.print(V_of_SugarWater); | |
Serial.println(" V"); | |
Resistance_of_SugarWater=V_of_SugarWater/(40.0/1000.0); | |
Serial.print("Resistance_of_SugarWater = "); | |
Serial.print(Resistance_of_SugarWater); | |
Serial.println(" Ohm"); | |
Serial.println(" ----"); | |
normal_saltwater=analogRead(saltwater); | |
Serial.print("AnalogValueOf_saltwater= "); | |
Serial.println(normal_saltwater); | |
V_of_SaltWater=normal_saltwater*(5.0/1023.0); | |
Serial.print("Voltage of Salt Water = "); | |
Serial.print(V_of_SaltWater); | |
Serial.println(" V"); | |
Resistance_of_NormalWater=V_of_SaltWater/(40.0/1000.0); | |
Serial.print("Resistance_of_SaltWater = "); | |
Serial.print(Resistance_of_NormalWater); | |
Serial.println(" Ohm"); | |
Serial.println(" ---"); | |
delay(10000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment