รหัสสินค้า | C18002 |
หมวดหมู่ | ความชื้นในดิน / น้ำฝน / ระดับน้ำ / คุณภาพน้ำ |
ราคา | 1,100.00 บาท |
ขนาด | 2 |
ลงสินค้า | 20 พ.ค. 2562 |
อัพเดทล่าสุด | 16 ก.ย. 2568 |
ความพึงพอใจ | ยังไม่มีความคิดเห็น |
คงเหลือ | 0 ชิ้น |
Sensor สำหรับวัดค่าความเป็น กรด เบส ของสารละลาย (วัดค่า PH) สามารถนำไปใช้วัดคุณภาพน้ำ สำหรับ Sensor รุ่นนี้เป็นรุ่นราคาถูก ที่ตัด Sensor วัดอุณหภูมิให้มีราคาถูกลง กว่า สินค้า Arduino PH Meter Board (PH Sensor) รุ่นแรก แต่ความสามารถไม่ต่างกันมากสามารถใช้ได้เหมือนกัน เหมาะสำหรับน้องๆที่ต้องการนำไปวัดค่าความเป็นกรด ด่างในการปลูกต้นไม้ ไฮโดรโปนิกส์ หรือผักไร้ดิน การวัดคุณภาพของน้ำ โดยช่วงการวัดค่า ph จะสามารถวัดได้อยู่ในช่วง 0-14 ph โดยค่าที่ได้จะเป็นค่า Analog (0-1023) ส่งไปยัง Arduino เพื่อให้ Arduino ประมวลผลต่อไป
ข้อมูลเพิ่มเติม
ในชุดประกอบด้วย
ตัวอย่าง Code PH Sensor Arduino
/*
# This sample code is used to test the pH meter V1.0.
# Editor : YouYou
# Ver : 1.0
# Product: analog pH meter
# SKU : SEN0161
*/
#define SensorPin A0 //pH meter Analog output to Arduino Analog Input 0
#define Offset 0.00 //deviation compensate
#define LED 13
#define samplingInterval 20
#define printInterval 800
#define ArrayLenth 40 //times of collection
int pHArray[ArrayLenth]; //Store the average value of the sensor feedback
int pHArrayIndex = 0;
void setup(void)
{
pinMode(LED, OUTPUT);
Serial.begin(9600);
Serial.println("pH meter experiment!"); //Test the serial monitor
}
void loop(void)
{
static unsigned long samplingTime = millis();
static unsigned long printTime = millis();
static float pHValue, voltage;
if (millis() - samplingTime > samplingInterval)
{
pHArray[pHArrayIndex++] = analogRead(SensorPin);
if (pHArrayIndex == ArrayLenth)pHArrayIndex = 0;
voltage = avergearray(pHArray, ArrayLenth) * 5.0 / 1024;
pHValue = 3.5 * voltage + Offset;
samplingTime = millis();
}
if (millis() - printTime > printInterval) //Every 800 milliseconds, print a numerical, convert the state of the LED indicator
{
Serial.print("Voltage:");
Serial.print(voltage, 2);
Serial.print(" pH value: ");
Serial.println(pHValue, 2);
digitalWrite(LED, digitalRead(LED) ^ 1);
printTime = millis();
}
}
double avergearray(int* arr, int number) {
int i;
int max, min;
double avg;
long amount = 0;
if (number <= 0) {
Serial.println("Error number for the array to avraging!/n");
return 0;
}
if (number < 5) { //less than 5, calculated directly statistics
for (i = 0; i < number; i++) {
amount += arr[i];
}
avg = amount / number;
return avg;
} else {
if (arr[0] < arr[1]) {
min = arr[0]; max = arr[1];
}
else {
min = arr[1]; max = arr[0];
}
for (i = 2; i < number; i++) {
if (arr[i] < min) {
amount += min; //arrmax){
amount += max; //arr>max
max = arr[i];
} else {
amount += arr[i]; //min<=arr<=max
}
}//if
}//for
avg = (double)amount / (number - 2);
}//if
return avg;
}
หน้าที่เข้าชม | 4,526,559 ครั้ง |
ผู้ชมทั้งหมด | 2,482,331 ครั้ง |
ร้านค้าอัพเดท | 3 ต.ค. 2568 |