完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电路图如图所示,当温度<15摄氏度时,加热器导通,开始加热。当温度>25摄氏度时,加热器断开,停止加热.
湿温度传感器的程序已有,传送在arduino串口2上,求程序能够调用串口温度数据来实现温控。谢谢 |
|
相关推荐
9个回答
|
|
最佳答案
|
|
|
|
要收费的
|
|
|
|
|
|
|
|
一看这个就是热带鱼水温控制器~~~~~
|
|
|
|
|
|
|
|
楼上回答正确!!!!!!
|
|
|
|
|
|
|
|
复制上去了,但是编译错误。这是我那个测温度的代码,测温度和湿温度可以实现,麻烦看看怎么把你发的改改,让他编译成功,谢谢1
double Fahrenheit(double celsius) { return 1.8 * celsius + 32; } //摄氏温度度转化为华氏温度 double Kelvin(double celsius) { return celsius + 273.15; } //摄氏温度转化为开氏温度 // 露点(点在此温度时,空气饱和并产生露珠) // 参考: http://wahiduddin.net/calc/density_algorithms.htm double dewPoint(double celsius, double humidity) { double A0= 373.15/(273.15 + celsius); double SUM = -7.90298 * (A0-1); SUM += 5.02808 * log10(A0); SUM += -1.3816e-7 * (pow(10, (11.344*(1-1/A0)))-1) ; SUM += 8.1328e-3 * (pow(10,(-3.49149*(A0-1)))-1) ; SUM += log10(1013.246); double VP = pow(10, SUM-3) * humidity; double T = log(VP/0.61078); // temp var return (241.88 * T) / (17.558-T); } // 快速计算露点,速度是5倍dewPoint() // 参考: http://en.wikipedia.org/wiki/Dew_point double dewPointFast(double celsius, double humidity) { double a = 17.271; double b = 237.7; double temp = (a * celsius) / (b + celsius) + log(humidity/100); double Td = (b * temp) / (a - temp); return Td; } #include dht11 DHT11; #define DHT11PIN 2 void setup() { Serial.begin(9600); Serial.println("DHT11 TEST PROGRAM "); Serial.print("LIBRARY VERSION: "); Serial.println(DHT11LIB_VERSION); Serial.println(); } void loop() { Serial.println("n"); int chk = DHT11.read(DHT11PIN); Serial.print("Read sensor: "); switch (chk) { case DHTLIB_OK: Serial.println("OK"); break; case DHTLIB_ERROR_CHECKSUM: Serial.println("Checksum error"); break; case DHTLIB_ERROR_TIMEOUT: Serial.println("Time out error"); break; default: Serial.println("Unknown error"); break; } Serial.print("Humidity (%): "); Serial.println((float)DHT11.humidity, 2); Serial.print("Temperature (oC): "); Serial.println((float)DHT11.temperature, 2); Serial.print("Temperature (oF): "); Serial.println(Fahrenheit(DHT11.temperature), 2); Serial.print("Temperature (K): "); Serial.println(Kelvin(DHT11.temperature), 2); Serial.print("Dew Point (oC): "); Serial.println(dewPoint(DHT11.temperature, DHT11.humidity)); Serial.print("Dew PointFast (oC): "); Serial.println(dewPointFast(DHT11.temperature, DHT11.humidity)); delay(2000); } |
|
|
|
我没有你那个dht的库,能给我吗?谢谢!
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
7703 浏览 0 评论
1604 浏览 0 评论
VL53L5CX #高达 8x8 多区域测距和 63°对角线宽视场 飞行时间多区域测距传感器
16844 浏览 0 评论
【罗姆传感器评估板试用体验连载】罗姆传感器整合进同一个示例程序
21645 浏览 0 评论
【罗姆传感器评估板试用体验连载】5.试用项目(高原列车车厢环境检测终端)+结语
7630 浏览 0 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-3-29 18:49 , Processed in 0.613373 second(s), Total 81, Slave 63 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 深圳华秋电子有限公司
电子发烧友 (电路图) 粤公网安备 44030402000349 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号