Cảm Biến Đo Độ Ph

Share:

*
Sơ thứ kết nối cảm biến Đo Độ pH

Ngõ ra của cảm biến ở đơn vị mili Voltage tỉ lệ với độ pH nghỉ ngơi 25 độ C

*

Hình ảnh thực tế của sản phẩm

*
Cảm đổi mới Đo Độ pH
*
Cảm biến đổi Đo Độ pH
*
Cảm đổi thay Đo Độ pH phiên bản trắng
*
Cảm biến chuyển Đo Độ pH phiên bản trắng
*
Cảm trở thành Đo Độ pH
*
Sơ đồ gia dụng chân cảm ứng Đo Độ pH

————————-CODE demo SẢN PHẨM———————–

Code đo pH:

/* * Kết nối: * VCC ---- 5V (Arduino) * GND ---- GND (Arduino) * P0 ---- A0 (Arduino) * * */#define SensorPin A0 //pH meter Analog output to Arduino Analog input 0#define Offset 0.70 //deviation compensate Bù TRỪ PHunsigned long int avgValue; //Store the average value of the sensor feedbackvoid setup() pinMode(13,OUTPUT); Serial.begin(9600); Serial.println("Ready"); //Test the serial monitorvoid loop() int buf<10>; //buffer for read analog for(int i=0;i10;i++) //Get 10 sample value from the sensor for smooth the value buf=analogRead(SensorPin); delay(10); for(int i=0;i9;i++) //sort the analog from small to lớn large for(int j=i+1;j10;j++) if(buf>buf) int temp=buf; buf=buf; buf=temp; avgValue=0; for(int i=2;i8;i++) //take the average value of 6 center sample avgValue+=buf; float phValue=(float)avgValue*5.0/1024/6; //convert the analog into millivolt phValue=2.0*phValue+Offset; //convert the millivolt into pH value biến đổi milivolt thành quý hiếm pH Serial.print(" pH:"); Serial.print(phValue,2); Serial.println(" "); digitalWrite(13, HIGH); delay(800); digitalWrite(13, LOW); Code đo sức nóng độ cảm biến LM35:

/* Kết nối: LM35 (Cảm biến chuyển nhiệt độ) Arduino VCC 5V T1 A1 GND GND*/int sensorPin = A1; void setup() Serial.begin(9600); void loop() int reading = analogRead(sensorPin); float voltage = reading * 5.0 / 1024.0; float tempF = voltage * 100.0; float tempC = (tempF-32)/1.8000; Serial.println(tempC); delay(500); Serial.println(tempF);Code đo sức nóng độ cảm biến DS18B20:

/* * Kết nối: * VCC ---- 5V (Arduino) * GND ---- GND (Arduino) * T2 ---- 2 (Arduino) * * */ #include OneWire.h> #include DallasTemperature.h>#define ONE_WIRE_BUS 2 OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire);void setup(void) Serial.begin(9600); // Start up the library sensors.begin(); void loop(void) Serial.print(" Requesting temperatures..."); sensors.requestTemperatures(); Serial.println("DONE"); Serial.print("Temperature is: "); Serial.print(sensors.getTempCByIndex(0)); delay(1000);

Bài viết liên quan