探索pH之谜:自制智能测量计项目

2023-11-171.1万
精华项目
AI 快速预览详细 收起
这个DIY pH计项目通过使用Beetle ESP32-C3、Gravity: 锥形模拟pH计和OLED透明屏幕等组件,帮助用户轻松测量液体的pH值。项目包括材料清单、连接步骤和代码上传。通过DFRobot提供的开源软件库,可以自动识别标准溶液并进行快速校准。最终效果是能够直观地了解液体的酸碱度,适合家长与孩子共同探索科学实验。


在日常的饮食、生活用水以及护肤品中,我们时常会关注液体的酸碱度。而如何深入了解这些液体的 pH 值呢?通过这个DIY pH计项目,我们将为您揭开科技在我们生活中的神秘面纱。让我们更加直观地了解所处环境的酸碱程度。探寻 pH 值的奥秘,让科技赋予我们更多力量和见识。

探索pH之谜:自制智能测量计项目图11


材料清单

DFRobot这些年来推出了一系列的pH传感器。我们可以看到这一系列的pH传感器中,有用于实验室检测的pH传感器,有用于工业使用的pH传感器, 还有更小众的用于测量土壤与食物的pH值的锥形pH传感器。现有的V2.0版本pH传感器都能兼容3.3v和5v电压的使用,可以用于各种主控连接(Arduino,esp32,树莓派)。配备的信号转接板拥有BNC接口和Gravity接口,接插即用,无需焊接。原始信号经过硬件滤波,输出数据抖动小。

探索pH之谜:自制智能测量计项目图10

探索pH之谜:自制智能测量计项目图12


连接
1. 连接好ph传感器

探索pH之谜:自制智能测量计项目图9

2. 连接好屏幕并套上外壳

探索pH之谜:自制智能测量计项目图6

3. 上传代码

探索pH之谜:自制智能测量计项目图4

  1.     /*
  2.      * file DFRobot_PH.ino
  3.      * @ https://github.com/DFRobot/DFRobot_PH
  4.      *
  5.      * This is the sample code for Gravity: Analog pH Sensor / Meter Kit V2, SKU:SEN0161-V2
  6.      * In order to guarantee precision, a temperature sensor such as DS18B20 is needed, to execute automatic temperature compensation.
  7.      * You can send commands in the serial monitor to execute the calibration.
  8.      * Serial Commands:
  9.      *   enterph -> enter the calibration mode
  10.      *   calph   -> calibrate with the standard buffer solution, two buffer solutions(4.0 and 7.0) will be automaticlly recognized
  11.      *   exitph  -> save the calibrated parameters and exit from calibration mode
  12.      *
  13.      * Copyright   [DFRobot](https://www.dfrobot.com), 2018
  14.      * Copyright   GNU Lesser General Public License
  15.      *
  16.      * version  V1.0
  17.      * date  2018-04
  18.      */
  19.     #include "DFRobot_PH.h"
  20.     #include <EEPROM.h>
  21.     #define PH_PIN A1
  22.     float voltage,phValue,temperature = 25;
  23.     DFRobot_PH ph;
  24.     void setup()
  25.     {
  26.         Serial.begin(115200);
  27.         ph.begin();
  28.     }
  29.     void loop()
  30.     {
  31.         static unsigned long timepoint = millis();
  32.         if(millis()-timepoint>1000U){                  //time interval: 1s
  33.             timepoint = millis();
  34.             //temperature = readTemperature();         // read your temperature sensor to execute temperature compensation
  35.             voltage = analogRead(PH_PIN)/1024.0*5000;  // read the voltage
  36.             phValue = ph.readPH(voltage,temperature);  // convert voltage to pH with temperature compensation
  37.             Serial.print("temperature:");
  38.             Serial.print(temperature,1);
  39.             Serial.print("^C  pH:");
  40.             Serial.println(phValue,2);
  41.         }
  42.         ph.calibration(voltage,temperature);           // calibration process by Serail CMD
  43.     }
  44.     float readTemperature()
  45.     {
  46.       //add your code here to get the temperature from your temperature sensor
  47.     }
复制代码


4. 一个简易的PH计就做好了!利用DFRobot提供的开源软件库,可以自动识别标准溶液,快速2点校准。

探索pH之谜:自制智能测量计项目图7

探索pH之谜:自制智能测量计项目图8

5. 校准好之后,就可以测试不同液体的ph值

探索pH之谜:自制智能测量计项目图5

柠檬的ph值如下,

探索pH之谜:自制智能测量计项目图1

牛奶的ph值如下,

探索pH之谜:自制智能测量计项目图2

肥皂水的ph值如下,

探索pH之谜:自制智能测量计项目图3


总结
通过这个DIY pH计项目,希望为大家展示科技是如何赋予我们更多力量和见识的。了解我们所处环境中液体的酸碱度,不再是专业实验室的专利,而是变得更加简单和直观。愿这个项目激发更多人对科技创新的兴趣,成为探索未知的起点。如果您有任何问题或建议,欢迎留言告诉我!

创作许可协议

本项目采用 None(不开放任何权利,保留所有权利) 进行许可。

评论(3)
罗罗罗
罗罗罗
厉害
rzegkly
rzegkly
很好的科学探究案例
hnyzcj
hnyzcj
漂亮
auroraAA
auroraAA
作者
回复hnyzcj
评论内容
- 没有更多了 -