ヘルスステーションの監視
コンポーネントと消耗品
> ![]() |
| × | 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); DallasTemperatureセンサー(&oneWire); AM2302 dht(AM2302_PIN); SoftwareSerial Bluetooth(10、9);文字列データ; intpulsePin =0; int flashPin =13; volatile int BPM; volatile int Signal; volatile int IBI =600; volatile boolean Pulse =false; volatile boolean QS =false; volatile int rate [10]; volatile unsigned long sampleCounter =0; volatile unsigned long lastBeatTime =0; volatile int P =512; volatile int T =512; volatile int thresh =512; volatile int amp =100;揮発性ブール値firstBeat =true; volatile boolean secondBeat =false; void InterruptSetup(){TCCR2A =0x02; TCCR2B =0x06; OCR2A =0X7C; TIMSK2 =0x02; sei(); } ISR(TIMER2_COMPA_vect){cli();シグナル=analogRead(pulsePin); sampleCounter + =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; digitalWrite(blinkPin、HIGH); IBI =sampleCounter-lastBeatTime; lastBeatTime =sampleCounter; if(secondBeat){secondBeat =false; for(int i =0; i <=9; i ++){rate [i] =IBI; }} if(firstBeat){firstBeat =false; secondBeat =true; sei();戻る; }単語runningTotal =0; for(int i =0; i <=8; i ++){rate [i] =rate [i + 1]; runningTotal + =rate [i]; } rate [9] =IBI; runningTotal + =rate [9]; runningTotal / =10; BPM =60000 / runningTotal; QS =true; }} if(Signal 2500){thresh =512; P =512; T =512; lastBeatTime =sampleCounter; firstBeat =true; secondBeat =false; } sei(); } void setup(){Bluetooth.begin(9600); Serial.begin(9600); dht.begin(); Sensors.begin(); InterruptSetup();} void loop(){sensors.requestTemperatures(); dht.readHumidity(); dht.readTemperature(); if(isnan(dht.humidity)|| isnan(dht.temperature_C)){return; } if(QS ==true){Serial.print(sensors.getTempCByIndex(0)); Serial.print( ""); Serial.print(dht.temperature_C); Serial.print( ""); Serial.print(dht.humidity); Serial.print( ""); Serial.println(BPM); Bluetooth.print(sensors.getTempCByIndex(0)); Bluetooth.print( ""); Bluetooth.print(dht.temperature_C); Bluetooth.print( ""); Bluetooth.print(dht.humidity); Bluetooth.print( ""); Bluetooth.println(BPM); QS =false; } delay(1500);}
コード
IDEarduinoのコードhttps://github.com/dikhalipina/Tutorials-for-arduino カスタムパーツとエンクロージャー
ヘルスステーションを監視するためのAndroidアプリ
https://github.com/dikhalipina/Tutorials-for-arduino 回路図










製造プロセス