监测健康站
组件和用品
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
| × | 2 | ||||
| × | 1 | ||||
| × | 1 |
应用和在线服务
| ||||
|
关于这个项目
带有传感器和应用程序的有线电子设备将提供一种控制健康状况和周围参数的简便方法
代码
- 代码
代码C/C++
#include#include #define AM2302_PIN 7#include #include #define ONE_WIRE_BUS 2OneWire oneWire(ONE_WIRE_BUS);达拉斯温度传感器(&oneWire); AM2302 dht(AM2302_PIN);SoftwareSerial Bluetooth(10, 9);String Data;int pulsePin =0;int flashPin =13;volatile int BPM;volatile int Signal;volatile int IBI =600;volatile boolean Pulse =false;volatile boolean QS =假;易失性整数率[10];易失性无符号长样本计数器 =0; volatile unsigned long lastBeatTime =0;易失性整数 P =512;易失性整数 T =512;易失性整数阈值 =512;易失性 int amp =100;易失性布尔 firstBeat =true;易失性布尔 secondBeat =false;无效中断设置(){TCCR2A =0x02; TCCR2B =0x06; OCR2A =0X7C; TIMSK2 =0x02; sei(); }ISR(TIMER2_COMPA_vect) { cli();信号 =模拟读取(pulsePin);样本计数器 +=2; int N =sampleCounter - lastBeatTime; if (Signal (IBI / 5) * 3) { if (Signal thresh &&Signal> P) { P =Signal; } if (N> 250) { if ( (Signal> thresh) &&(Pulse ==false) &&(N> (IBI / 5) * 3) ) { Pulse =true;数字写入(闪烁针,高); IBI =sampleCounter - lastBeatTime; lastBeatTime =采样计数器; if (secondBeat) { secondBeat =false; for (int i =0; i <=9; i++) { rate[i] =IBI; } } if (firstBeat) { firstBeat =false; secondBeat =真; sei();返回; } 单词 runningTotal =0; for (int i =0; i <=8; i++) { rate[i] =rate[i + 1]; runningTotal +=rate[i]; }率[9] =IBI; runningTotal +=rate[9];运行总计 /=10; BPM =60000 / runningTotal; QS =真; } } if (Signal 2500) { 阈值 =512; P =512; T =512; lastBeatTime =采样计数器; firstBeat =真; secondBeat =假; } sei(); }void setup() { Bluetooth.begin(9600); Serial.begin(9600); dht.begin();传感器开始(); interruptSetup();}void loop() {sensors.requestTemperatures(); dht.readHumidity(); dht.readTemperature();如果(isnan(dht.湿度)|| isnan(dht.温度_C)){返回; } if (QS ==true) { Serial.print(sensors.getTempCByIndex(0)); Serial.print(" "); Serial.print(dht.temperature_C); Serial.print(" "); Serial.print(dht.湿度); Serial.print(" "); Serial.println(BPM); Bluetooth.print(sensors.getTempCByIndex(0));蓝牙.print(" ");蓝牙.打印(dht.温度_C);蓝牙.print(" ");蓝牙.打印(dht.湿度);蓝牙.print(" ");蓝牙.println(BPM); QS =假; } 延迟(1500);}
代码
IDE arduino 代码 https://github.com/dikhalipina/Tutorials-for-arduino定制零件和外壳
监测健康站的安卓应用
https://github.com/dikhalipina/Tutorials-for-arduino示意图
制造工艺