Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. #include <Wire.h>
  2. #include <LiquidCrystal.h>
  3.  
  4. LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
  5. int pHSense = A0;
  6.  
  7. void setup() {
  8.  
  9. Serial.begin(9600);
  10. delay(100);
  11. //Wire.begin(2,14);
  12. //lcd.init();
  13. //lcd.backlight();
  14. //lcd.setCursor(0,0);
  15. //lcd.print("14CORE | pH Probe ");
  16. //lcd.setCursor(0,1);
  17. //lcd.print(">Initializing...");
  18. //delay(4000);
  19. // lcd.clear();
  20. //lcd.setCursor(0,0);
  21. //lcd.print("14CORE | pH Sense");
  22. Serial.println("14CORE | pH Sense");
  23.  
  24. }
  25.  
  26. void loop(){
  27. int measuringVal = analogRead(pHSense);
  28. Serial.print("Measuring Raw Value > ");
  29. Serial.print(measuringVal);
  30.  
  31. double vltValue = 5/1024.0 * measuringVal;
  32. Serial.print("Voltage Value > ");
  33. Serial.print(vltValue, 3);
  34.  
  35. float P0 = 7 + ((2.5 - vltValue) / 0.18);
  36. Serial.print("");
  37. Serial.print("pH Value > ");
  38. Serial.print(P0, 3);
  39. Serial.print("");
  40. delay(3000);
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement