Cov txheej txheem:

Yuav Qhia Li Cas Lub Plawv Tus Kheej Ntawm Lub Pob Zeb LCD Nrog Ar: 31 Kauj Ruam
Yuav Qhia Li Cas Lub Plawv Tus Kheej Ntawm Lub Pob Zeb LCD Nrog Ar: 31 Kauj Ruam

Video: Yuav Qhia Li Cas Lub Plawv Tus Kheej Ntawm Lub Pob Zeb LCD Nrog Ar: 31 Kauj Ruam

Video: Yuav Qhia Li Cas Lub Plawv Tus Kheej Ntawm Lub Pob Zeb LCD Nrog Ar: 31 Kauj Ruam
Video: G-Shock Gulfmaster Showdown | Мастер G Gulfmaster Сравнение | GN-1000 | GWN-1000 | GW... 2024, Kaum ib hlis
Anonim
Yuav Qhia Li Cas Lub Plawv Tus Kheej ntawm Lub Pob Zeb LCD Nrog Ar
Yuav Qhia Li Cas Lub Plawv Tus Kheej ntawm Lub Pob Zeb LCD Nrog Ar

qhia me ntsis

Qee lub sijhawm dhau los, Kuv pom lub ntsuas ntsuas lub plawv ntsuas MAX30100 hauv khw hauv online. Cov qauv no tuaj yeem khaws cov pa oxygen thiab cov ntaub ntawv ntsuas lub plawv ntawm cov neeg siv, uas kuj yog qhov yooj yim thiab yooj yim siv. Raws li cov ntaub ntawv, Kuv pom tias muaj cov tsev qiv ntawv ntawm MAX30100 hauv Arduino cov tsev qiv ntawv cov ntaub ntawv. Ntawd yog hais, yog tias kuv siv kev sib txuas lus ntawm Arduino thiab MAX30100, Kuv tuaj yeem hu ncaj qha rau Arduino cov tsev qiv ntawv cov ntaub ntawv yam tsis tas yuav rov sau cov ntaub ntawv tsav tsheb. Qhov no yog qhov zoo, yog li kuv yuav qhov qauv ntawm MAX30100.

Kauj Ruam 1: Kuv Txiav Txim Siab Siv Arduino Txheeb Xyuas Lub Plawv Lub Plawv thiab Cov Ntshav Ntshav Ntshav Qab Zib Ua Haujlwm ntawm MAX30100

Kuv Txiav Txim Siab Siv Arduino Txheeb Xyuas Lub Plawv Lub Plawv thiab Ntshav Cov Pa Pa Muaj nuj nqi ntawm MAX30100
Kuv Txiav Txim Siab Siv Arduino Txheeb Xyuas Lub Plawv Lub Plawv thiab Ntshav Cov Pa Pa Muaj nuj nqi ntawm MAX30100

Nco tseg: qhov qauv no tsuas yog nrog 3.3 V qib MCU kev sib txuas lus, vim tias nws tsis siv IIC tus pin rub tawm qhov kev tiv thaiv ntawm 4.7 K txog 1.8 V, yog li tsis muaj kev sib txuas lus nrog Arduino los ntawm lub neej ntawd, yog tias koj xav koom nrog Arduino thiab xav tau ob qho 4.7 K ntawm IIC tus pin rub tawm tus tiv thaiv txuas nrog VIN tus pin, cov ntsiab lus no yuav qhia nyob rau tom qab ntawm tshooj.

Kauj Ruam 2: Cov Haujlwm Ua Haujlwm

Ua ntej pib qhov haujlwm no, kuv xav txog qee qhov yooj yim:

  • Cov ntaub ntawv plawv dhia thiab cov ntaub ntawv ntshav oxygen tau sau
  • Lub plawv dhia thiab cov pa oxygen cov ntaub ntawv tau tshwm los ntawm lub vijtsam LCD

Cov no tsuas yog ob yam nkaus xwb, tab sis yog tias peb xav siv nws, peb yuav tsum xav ntau dua:

  • Tus tswv MCU siv dab tsi?
  • Dab tsi ntawm lcd zaub?

Raws li peb tau hais ua ntej, peb siv Arduino rau MCU, tab sis qhov no yog Arduino LCD cov phiaj xwm phiaj xwm, yog li peb yuav tsum xaiv qhov tsim nyog LCD zaub module. Kuv npaj yuav siv lub vijtsam LCD nrog chaw nres nkoj. Kuv muaj STONE STVI070WT-01 tus tso tawm ntawm no, tab sis yog tias Arduino xav tau kev sib txuas lus nrog nws, MAX3232 xav tau los ua kev hloov pauv qib. Tom qab ntawd cov khoom siv hluav taws xob yooj yim tau txiav txim siab raws li hauv qab no:

1. Arduino Mini Pro pawg thawj coj loj

2. MAX30100 lub plawv dhia thiab ntshav oxygen sensor module

3. STONE STVI070WT-01 LCD serial port display module

4. MAX3232 module

Kauj Ruam 3: Qhia Kho Vajtse

MAX30100

MAX30100 yog kev sib xyaw mem tes oximetry thiab lub plawv dhia saib xyuas qhov ntsuas qhov ntsuas. Nws ua ke ob lub LEDs, lub khoos phis tawj duab, kho qhov muag tau zoo, thiab lub suab qis qis ua lub teeb liab ua kom pom lub plawv dhia thiab ntsuas lub plawv dhia.

MAX30100 ua haujlwm los ntawm 1.8V thiab 3.3V cov khoom siv hluav taws xob thiab tuaj yeem siv hluav taws xob los ntawm software nrog qhov tsis tsim nyog tos tam sim no, tso cai rau lub zog txuas kom txuas nrog txhua lub sijhawm.

Kauj Ruam 4: Cov ntawv thov

Dev Cov cuab yeej siv tau

● Cov Pabcuam Qoj Qoj

● Kev Tshuaj Xyuas Kev Kho Mob

Kauj Ruam 5: Cov txiaj ntsig thiab Nta

1, Ua kom tiav Pulse Oximeter thiab Lub Plawv Tus Nqi SensorSolution Yooj Yim Tsim

  • Kev sib xyaw ua ke ntawm LEDs, Duab Sensor, thiab Kev Ua Tau Zoo Analog Pem Hauv Ntej -End
  • Me me 5.6mm x 2.8mm x 1.2mm 14-Pin OpticallyEnhanced System-in-Package

2 Operation Ultra-Tsawg-Lub Hwj Chim Ua Haujlwm Ua Ntej Ua Ntej Roj Teeb rau Cov Khoom Siv Hnav

  • Cov Qauv Piv Txwv thiab LED Tam Sim No rau Kev Txuag Lub Hwj Chim
  • Ultra-Low Shutdown Tam Sim No (0.7µA, hom)

3, Kev Ua Haujlwm Zoo Tshaj Plaws Txhim Kho Kev Ntsuas Zoo

  • Siab SNR Muab Kev Ruaj Ntseg Ruaj Ntseg Ruaj Ruaj
  • Kev tshem tawm Ambient Light Ambient
  • Cov Qauv Muaj Peev Xwm Siab
  • Peev Xwm Cov Ntaub Ntawv Tawm Tsam Muaj Peev Xwm

Kauj Ruam 6: Ntsiab Cai Ntsiab Cai

Ntsiab Cai Ntsiab Cai
Ntsiab Cai Ntsiab Cai

Tsuas yog nias koj tus ntiv tes tiv thaiv lub ntsuas kom kwv yees cov pa oxygen saturation (SpO2) thiab mem tes (sib npaug rau lub plawv dhia).

Pulse oximeter (oximeter) yog lub tshuab ntsuas hluav taws xob me me uas siv cov hauv paus ntsiab lus ntawm kev sib txawv ntawm cov xov tooj liab sib nqus los tshuaj xyuas cov pa oxygen ntawm cov ntshav. Lub sijhawm ntsuas thiab ntsuas nrawm no kuj tseem siv dav hauv ntau qhov chaw kuaj mob. Kuv yuav tsis qhia MAX30100 ntau dhau, vim cov ntaub ntawv no muaj nyob hauv Is Taws Nem. Cov phooj ywg txaus siab tuaj yeem nrhiav cov ntaub ntawv ntawm qhov ntsuas ntsuas lub plawv hauv Is Taws Nem, thiab nkag siab tob dua ntawm nws txoj cai tshawb nrhiav.

Kauj Ruam 7: STONE STVI070WT-01

Lub pob zeb STVI070WT-01
Lub pob zeb STVI070WT-01

Taw qhia rau tus tso saib

Hauv txoj haujlwm no, kuv yuav siv STONE STVI070WT-01 los tso saib lub plawv dhia thiab cov ntaub ntawv ntshav oxygen. Tus tsav tsheb tau muab tso ua ke sab hauv ntawm lub vijtsam, thiab muaj software rau cov neeg siv siv. Cov neeg siv tsuas yog xav tau ntxiv cov nyees khawm, cov ntawv ntawv thiab lwm cov laj thawj los ntawm cov duab tsim UI, thiab tom qab ntawd tsim cov ntaub ntawv teeb tsa thiab rub lawv mus rau hauv lub vijtsam zaub kom khiav. Cov zaub ntawm STVI070WT-01 sib tham nrog MCU los ntawm uart-rs232 teeb liab, uas txhais tau tias peb yuav tsum ntxiv MAX3232 nti los hloov RS232 teeb liab rau hauv TTL teeb liab, yog li peb tuaj yeem sib tham nrog Arduino MCU.

Kauj Ruam 8: Yog Koj Tsis Paub Tias Yuav Siv MAX3232 Li Cas, Thov Xa Mus Rau Cov Duab hauv qab no:

Yog tias Koj Tsis Paub Yuav Ua Li Cas Siv MAX3232, Thov Xa Mus Rau Cov Duab hauv qab no
Yog tias Koj Tsis Paub Yuav Ua Li Cas Siv MAX3232, Thov Xa Mus Rau Cov Duab hauv qab no

Yog tias koj xav tias kev hloov pauv qib yog teeb meem dhau los, koj tuaj yeem xaiv lwm hom kev qhia ntawm STONE, qee qhov tuaj yeem tso ncaj qha uart-ttl teeb liab.

Lub vev xaib raug cai muaj cov ncauj lus ntxaws thiab qhia:

Kauj Ruam 9: Yog tias Koj Xav Tau Cov vis dis aus qhia thiab cov lus qhia siv, Koj tseem tuaj yeem pom nws ntawm Lub Vev Xaib raug cai

Yog tias Koj Xav Tau Cov vis dis aus qhia thiab cov lus qhia siv, Koj tseem tuaj yeem pom nws ntawm Lub Vev Xaib raug cai
Yog tias Koj Xav Tau Cov vis dis aus qhia thiab cov lus qhia siv, Koj tseem tuaj yeem pom nws ntawm Lub Vev Xaib raug cai

Kauj Ruam 10: Cov Txheej Txheem Txhim Kho

Peb cov kauj ruam ntawm STONE display screen development:

  • Tsim cov duab tso tawm thiab khawm cov ntsiab lus nrog STONE TOOL software, thiab rub tawm cov ntawv tsim tawm mus rau cov qauv duab.
  • MCU sib txuas lus nrog STONE LCD zaub module los ntawm cov chaw nres nkoj.
  • Nrog cov ntaub ntawv tau txais hauv qib 2, MCU ua lwm yam haujlwm.

Kauj Ruam 11: STONE TOOL Software Installation

STONE TOOL Software Installation
STONE TOOL Software Installation

Rub tawm qhov hloov tshiab kawg ntawm STONE TOOL software (tam sim no TOOL2019) los ntawm lub vev xaib, thiab teeb tsa nws.

Tom qab lub software tau teeb tsa, lub interface hauv qab no yuav qhib:

Nyem rau "Cov ntaub ntawv" khawm nyob rau sab saud sab saud los tsim txoj haujlwm tshiab, uas peb yuav tham tom qab.

Kauj ruam 12: Arduino

Arduino yog lub hauv paus qhib hluav taws xob tsim qauv uas yooj yim siv thiab siv tau yooj yim. Nws suav nrog ntu kho vajtse (ntau yam kev txhim kho cov laug cam uas ua raws li Arduino kev qhia tshwj xeeb) thiab software ib feem (Arduino IDE thiab cov khoom siv txhim kho ntsig txog).

Cov kho vajtse ib feem (lossis pawg tswj hwm kev txhim kho) suav nrog microcontroller (MCU), Flash nco (Flash), thiab txheej txheej ntawm cov tswv yim/tso tawm thoob ntiaj teb cuam tshuam (GPIO), uas koj tuaj yeem xav tias yog microcomputer motherboard. Ib feem ntawm software feem ntau yog tsim los ntawm Arduino IDE hauv PC, cuam tshuam txog pawg tswj hwm qib txhawb nqa pob (BSP) thiab nplua nuj thib peb ua haujlwm lub tsev qiv ntawv. sau koj cov program. Arduino yog lub platform qhib qhib. Txog tam sim no, tau muaj ntau tus qauv thiab ntau tus tswj tau los, suav nrog Arduino Uno, Arduino Nano, ArduinoYun thiab lwm yam Ntxiv rau ntawd, Arduino IDE tam sim no tsis tsuas yog txhawb nqa Arduino series kev txhim kho cov laug cam, tab sis kuj ntxiv kev txhawb nqa rau cov pawg txhim kho nrov xws li raws li Intel Galileo thiab NodeMCU los ntawm kev qhia BSP.

Arduino hnov ib puag ncig los ntawm ntau yam kev ntsuas, tswj lub teeb, lub cev muaj zog thiab lwm yam khoom siv los pub rov qab thiab cuam tshuam ib puag ncig. rau Arduino tau ua tiav nrog Arduino cov lus programming (raws li Kev Txuas) thiab Arduino kev txhim kho ib puag ncig (raws li Kev Ua Haujlwm). Arduino raws cov phiaj xwm tuaj yeem muaj Arduino nkaus xwb, nrog rau Arduino thiab lwm yam software khiav hauv PC, thiab lawv sib tham nrog txhua tus lwm yam (xws li Flash, Ua, MaxMSP).

Kauj Ruam 13: Kev Txhim Kho Ib puag ncig

Ib puag ncig kev loj hlob
Ib puag ncig kev loj hlob

Ib puag ncig kev txhim kho Arduino yog Arduino IDE, uas tuaj yeem rub tawm los ntawm Is Taws Nem.

Nkag mus rau hauv lub vev xaib raug cai ntawm Arduino thiab rub tawm software https://www.arduino.cc/en/Main/Software?setlang=c… Tom qab kev txhim kho Arduino IDE, qhov sib txuas hauv qab no yuav tshwm sim thaum koj qhib lub software:

Arduino IDE tsim ob txoj haujlwm los ntawm lub hauv paus: teeb tsa muaj nuj nqi thiab ua haujlwm lub voj voos. Muaj ntau qhov kev qhia Arduino hauv Is Taws Nem. Yog tias koj tsis nkag siab qee yam, koj tuaj yeem mus rau Is Taws Nem kom pom nws.

Kauj Ruam 14: Arduino LCD Project Kev Txhim Kho Txheej Txheem

Arduino LCD Kev Txhim Kho Txoj Haujlwm
Arduino LCD Kev Txhim Kho Txoj Haujlwm

kho vajtse kev twb kev txuas

Txhawm rau kom ntseeg tau tias cov kauj ruam tom ntej hauv kev sau cov cai mus tau yooj yim, peb yuav tsum xub txiav txim siab qhov kev ntseeg tau ntawm kev kho vajtse txuas.

Tsuas yog plaub daim kho vajtse tau siv hauv txoj haujlwm no:

1. Arduino Mini pro board txhim kho

2. STONE STVI070WT-01 tft-lcd zaub screen

3. MAX30100 lub plawv dhia thiab ntshav oxygen sensor

4. MAX3232 (rs232-> TTL) Pawg Arduino Mini Pro txoj kev txhim kho thiab STVI070WT-01 TFT-LCD zaub screen tau txuas nrog los ntawm UART, uas yuav tsum tau hloov pauv los ntawm MAX3232, thiab tom qab ntawd Arduino Mini Pro pawg thawj coj loj thiab MAX30100 module tau txuas nrog los ntawm IIC sib tham. Tom qab xav meej, peb tuaj yeem kos cov duab txuas hauv qab no:

Kauj ruam 15:

Duab
Duab

Xyuas kom tsis muaj qhov yuam kev hauv kev kho vajtse txuas thiab mus rau kauj ruam tom ntej.

Kauj Ruam 16: TFT LCD Tus Neeg Siv Tus Qauv Tsim

TFT LCD Tus Neeg Siv Tus Qauv Tsim
TFT LCD Tus Neeg Siv Tus Qauv Tsim

Ua ntej tshaj plaws, peb yuav tsum tsim tus qauv duab UI, uas tuaj yeem tsim los ntawm PhotoShop lossis lwm yam cuab yeej tsim duab. Tom qab tsim cov duab UI pom, khaws cov duab hauv-j.webp

Qhib lub software STONE TOOL2019 thiab tsim txoj haujlwm tshiab:

Kauj Ruam 17: Tshem Tawm Cov Duab uas Loaded los ntawm Default hauv Txoj Haujlwm Tshiab, thiab Ntxiv UI Duab uas Peb Tsim

Tshem Tawm Cov Duab uas Loaded los ntawm Default hauv Txoj Haujlwm Tshiab, thiab Ntxiv UI Duab uas Peb Tsim
Tshem Tawm Cov Duab uas Loaded los ntawm Default hauv Txoj Haujlwm Tshiab, thiab Ntxiv UI Duab uas Peb Tsim

Kauj Ruam 18: Ntxiv Cov Ntawv Qhia Zaub

Ntxiv Cov Ntawv Qhia Zaub
Ntxiv Cov Ntawv Qhia Zaub

Ntxiv cov ntawv qhia ua ntu, tsim cov duab zauv thiab cov lej zauv, tau txais qhov chaw khaws cia ntawm cov ntawv tso saib cov khoom hauv cov khoom tso saib.

Cov nyhuv yog raws li hauv qab no:

Kauj ruam 19:

Cov ntawv nthuav qhia qhov chaw nyob:

  • Kev sib txuas sta: 0x0008
  • Lub plawv dhia: 0x0001

Cov pa oxygen: 0x0005 Cov ntsiab lus tseem ceeb ntawm UI interface yog raws li hauv qab no:

  • Cov xwm txheej sib txuas
  • Lub plawv dhia zaub
  • Cov pa oxygen pom

Kauj Ruam 20: Tsim Cov Ntaub Ntawv Kho

Tsim cov ntaub ntawv teeb tsa
Tsim cov ntaub ntawv teeb tsa

Thaum qhov tsim UI tau ua tiav, cov ntawv teeb tsa tuaj yeem tsim thiab rub tawm mus rau STVI070WT-01 zaub.

Ua ntej, ua ntu 1, tom qab ntawd ntxig USB flash drive rau hauv lub khoos phis tawj, thiab lub cim disk yuav tshwm. Tom qab ntawv nyem "Download rau u-disk" Txhawm rau rub tawm cov ntawv teeb tsa mus rau USB flash drive, thiab tom qab ntawd ntxig USB flash drive rau hauv STVI070WT-01 kom ua tiav qhov hloov tshiab.

Kauj ruam 21: MAX30100

MAX30100
MAX30100

MAX30100 sib tham ntawm IIC. Its txoj haujlwm ua haujlwm yog tias ADC tus nqi ntawm lub plawv tuaj yeem tau txais los ntawm infrared coj irradiation. Muaj MAX30100 tus lej tuaj yeem faib ua tsib pawg: xeev sau npe, FIFO, tswj npe, ntsuas kub thiab ID sau npe. nyeem qhov ntsuas kub ntawm tus nti kom kho qhov sib txawv los ntawm qhov kub. Qhov ID sau npe tuaj yeem nyeem tus lej tus lej ID.

MAX30100 txuas nrog Arduino Mini Pro pawg thawj coj loj los ntawm IIC kev sib txuas lus sib tham. Vim tias tau npaj ua tiav MAX30100 cov tsev qiv ntawv cov ntaub ntawv hauv Arduino IDE, peb tuaj yeem nyeem lub plawv dhia thiab cov pa oxygen cov ntaub ntawv yam tsis tau kawm txog kev sau npe ntawm MAX30100. Rau rau cov uas txaus siab tshawb nrhiav MAX30100 rau npe, saib MAX30100 Cov Ntawv Teev Npe.

Kauj Ruam 22: Hloov kho MAX30100 IIC Pull-up Resistor

Hloov kho MAX30100 IIC Pull-up Resistor
Hloov kho MAX30100 IIC Pull-up Resistor

Nws yuav tsum tau sau tseg tias 4.7k rub tawm tsis kam ntawm IIC tus pin ntawm MAX30100 tus qauv txuas nrog 1.8v, uas tsis yog teeb meem hauv kev xav. Txawm li cas los xij, kev sib txuas lus logic qib ntawm Arduino IIC tus pin yog 5V, yog li nws tsis tuaj yeem sib txuas lus nrog Arduino yam tsis hloov kho vajtse ntawm MAX30100 tus qauv. Kev sib txuas lus ncaj qha tuaj yeem ua tau yog MCU yog STM32 lossis lwm 3.3v logic qib MCU.

Yog li, cov kev hloov pauv hauv qab no yuav tsum tau ua:

Tshem tawm peb 4.7k resistors cim hauv daim duab nrog hluav taws xob txuas hluav taws xob. Thaum txuas ob lub resistors ntawm 4.7k ntawm tus pin ntawm SDA thiab SCL rau VIN, yog li peb tuaj yeem sib tham nrog Arduino.

Kauj ruam 23: Arduino

Arduino
Arduino

Qhib Arduino IDE thiab nrhiav cov nyees khawm hauv qab no:

Kauj Ruam 24: Tshawb nrhiav "MAX30100" txhawm rau Nrhiav Ob Lub Tsev Qiv Ntawv rau MAX30100, Tom Qab Nyem Download thiab Nruab

Nrhiav rau
Nrhiav rau

Kauj Ruam 25: Tom Qab Kev Txhim Kho, Koj tuaj yeem Pom Qhov Demo ntawm MAX30100 hauv LIB Cov Tsev Qiv Ntawv Folder ntawm Arduino:

Tom qab Kev Txhim Kho, Koj tuaj yeem Pom Qhov Demo ntawm MAX30100 hauv LIB Lub Tsev Qiv Ntawv Folder ntawm Arduino
Tom qab Kev Txhim Kho, Koj tuaj yeem Pom Qhov Demo ntawm MAX30100 hauv LIB Lub Tsev Qiv Ntawv Folder ntawm Arduino

Kauj Ruam 26: Ob npaug nias rau Cov Ntaub Ntawv kom Qhib Nws

Nyem ob npaug rau Cov Ntaub Ntawv kom Qhib Nws
Nyem ob npaug rau Cov Ntaub Ntawv kom Qhib Nws

Kauj Ruam 27: Tus lej ua tiav raws li hauv qab no:

Qhov Demo no tuaj yeem sim ncaj qha. Yog tias kev kho vajtse txuas tau zoo, koj tuaj yeem rub cov lej tso ua ke rau hauv Arduibo pawg thawj coj txhim kho thiab pom cov ntaub ntawv ntawm MAX30100 hauv cov cuab yeej siv debugging.

Txoj cai ua tiav yog raws li hauv qab no:

/* Arduino-MAX30100 oximetry /heart rate integrated sensor library Copyright (C) 2016 OXullo Intersecans Qhov program no yog software pub dawb: koj tuaj yeem faib nws thiab /lossis hloov kho nws raws li GNU General Public License raws li luam tawm los ntawm Free Software Foundation, version 3 ntawm Daim Ntawv Tso Cai, lossis (ntawm koj qhov kev xaiv) ib qho tom qab ntawv. Txoj haujlwm no tau faib rau hauv kev cia siab tias nws yuav muaj txiaj ntsig, tab sis TSIS YOG LEEJ TWG YUAV TSUM PAUB; yam tsis muaj qhov kev lees paub ntawm MERCHANTABILITY lossis FITNESS FOR A LUS QHIA PURPOSE Saib GNU General Public License rau cov ncauj lus kom ntxaws. Koj yuav tsum tau txais daim ntawv theej ntawm GNU General Public License nrog rau txoj haujlwm no. Yog tsis yog, saib. */ #include #include "MAX30100_PulseOximeter.h" #define REPORTING_PERIOD_MS 1000 // PulseOximeter yog qib sib cuam tshuam ntau dua rau lub sensor // nws muab: // * ntsuas kev ntsuas qhia tawm // * ntsuas lub plawv dhia // * SpO2 (qib oxidation) xam PulseOximeter pox; uint32_t tsLastReport = 0; // Hu rov qab (sau npe hauv qab no) raug rho tawm thaum lub plawv dhia pom tsis muaj qhov khoob ntawmBeatDetected () {Serial.println ("Yeej!"); } tsis muaj teeb tsa teeb tsa () {Serial.begin (115200); Serial.print ("Initializing pulse oximeter.."); // Pib ua piv txwv PulseOximeter // Kev ua tsis tau zoo feem ntau yog los ntawm I2C thaiv tsis raug, tsis muaj lub zog siv hluav taws xob // lossis cov phiaj tsis raug yog tias (! Pox.begin ()) {Serial.println ("FAILED"); rau (;;); } lwm {Serial.println ("SUCCESS"); } // Lub neej tam sim no rau IR LED yog 50mA thiab nws tuaj yeem hloov pauv // los ntawm tsis ua raws cov kab hauv qab no. Kos MAX30100_Registers.h rau txhua qhov // muaj kev xaiv. // pox.setIRLedCurrent (MAX30100_LED_CURR_7_6MA); // Sau npe rov qab rau qhov ntsuas pom pox.setOnBeatDetectedCallback (onBeatDetected); } void loop () {// Nco ntsoov hu xov tooj hloov kho kom sai li sai tau pox.update (); // Asynchronously dump lub plawv dhia thiab cov qib oxidation rau cov lej // Rau ob qho tib si, tus nqi 0 txhais tau tias "tsis raug" yog (millis () - tsLastReport> REPORTING_PERIOD_MS) {Serial.print ("Lub plawv dhia:"); Serial.print (pox.getHeartRate ()); Serial.print ("bpm / SpO2:"); Serial.print (pox.getSpO2 ()); Serial.println ("%"); tsLastReport = millis (); }}

Kauj ruam 28:

Duab
Duab

Cov cai no yooj yim heev, Kuv ntseeg tias koj tuaj yeem nkag siab nws ib nrais muag. Kuv yuav tsum hais tias qhov kev hloov kho ntawm Arduino yog qhov yooj yim heev, thiab kuv tsis tas yuav nkag siab tias kev siv tus lej tsav tsheb ntawm Uart thiab IIC tau siv li cas.

Tau kawg, cov cai saum toj no yog ib qho Demo raug cai, thiab kuv tseem yuav tsum tau hloov qee yam los tso saib cov ntaub ntawv rau STONE's displayer.

Kauj Ruam 29: Muab Cov Ntaub Ntawv rau Lub Pob Zeb Qhia Los Ntawm Arduino

Ua ntej, peb yuav tsum tau txais qhov chaw nyob ntawm cov khoom siv uas qhia txog lub plawv dhia thiab cov ntaub ntawv ntshav oxygen hauv STONE's displayer:

Hauv kuv qhov haujlwm, qhov chaw nyob yog raws li hauv qab no: Lub plawv dhia saib qhov chaw nyob: 0x0001 Chaw nyob ntawm cov ntshav oxygen zaub module: 0x0005 Sensor qhov xwm txheej sib txuas chaw nyob: 0x0008 Yog tias koj xav tau hloov cov ntsiab lus tso rau hauv qhov chaw sib xws, koj tuaj yeem hloov cov ntsiab lus tso saib los ntawm kev xa cov ntaub ntawv mus rau qhov chaw nyob sib xws ntawm lub vijtsam tso tawm los ntawm kab ntawv txuas ntawm Arduino.

Kauj Ruam 30: Txoj Cai Hloov Kho Raws Li Hauv Qab no:

/* Arduino-MAX30100 oximetry /heart rate integrated sensor library Copyright (C) 2016 OXullo Intersecans Qhov program no yog software pub dawb: koj tuaj yeem faib nws thiab /lossis hloov kho nws raws li GNU General Public License raws li luam tawm los ntawm Free Software Foundation, version 3 ntawm Daim Ntawv Tso Cai, lossis (ntawm koj qhov kev xaiv) ib qho tom qab ntawv. Txoj haujlwm no tau faib rau hauv kev cia siab tias nws yuav muaj txiaj ntsig, tab sis TSIS YOG LEEJ TWG YUAV TSUM PAUB; yam tsis muaj qhov kev lees paub ntawm MERCHANTABILITY lossis FITNESS FOR A LUS QHIA PURPOSE Saib GNU General Public License rau cov ncauj lus kom ntxaws. Koj yuav tsum tau txais daim ntawv theej ntawm GNU General Public License nrog rau txoj haujlwm no. Yog tsis yog, saib. */ #include #include "MAX30100_PulseOximeter.h" #define REPORTING_PERIOD_MS 1000 #define Heart_dis_addr 0x01 #define Sop2_dis_addr 0x05 #define connect_sta_addr 0x08 unsigned char heart_rate_send, 0x00; ib. unsigned char Sop2_send [8] = {0xA5, 0x5A, 0x05, 0x82, 0x00, / Sop2_dis_addr, 0x00, 0x00}; unsigned char connect_sta_send [8] = {0xA5, 0x5A, 0x05, 0x82, 0x00, / connect_sta_addr, 0x00, 0x00}; // PulseOximeter yog qib qib sib cuam tshuam rau lub sensor // nws muab: // * ntsuas qhov ntsuas pom // * ntsuas lub plawv dhia // * SpO2 (qib oxidation) suav PulseOximeter pox; uint32_t tsLastReport = 0; // Kev hu rov qab (sau npe hauv qab no) raug rho tawm thaum lub plawv dhia pom tsis muaj qhov khoob ntawmBeatDetected () {// Serial.println ("Yeej!"); } tsis muaj teeb tsa teeb tsa () {Serial.begin (115200); // Serial.print ("Initializing mem tes oximeter.."); // Pib ua piv txwv PulseOximeter // Kev ua tsis tau zoo feem ntau yog los ntawm I2C thaiv tsis raug, tsis muaj lub zog siv hluav taws xob // lossis cov phiaj tsis raug yog tias (! Pox.begin ()) {// Serial.println ("FAILED"); // connect_sta_send [7] = 0x00; // Serial.write (txuas_sta_send, 8); rau (;;); } lwm {connect_sta_send [7] = 0x01; Serial.write (connect_sta_send, 8); // Serial.println ("SUCCESS"); } // Lub neej tam sim no rau IR LED yog 50mA thiab nws tuaj yeem hloov pauv // los ntawm tsis ua raws cov kab hauv qab no. Kos MAX30100_Registers.h rau txhua qhov // muaj kev xaiv.pox.setIRLedCurrent (MAX30100_LED_CURR_7_6MA); // Sau npe rov qab rau qhov ntsuas pom pox.setOnBeatDetectedCallback (onBeatDetected); } void loop () {// Nco ntsoov hu xov tooj hloov kho kom sai li sai tau pox.update (); // Asynchronously dump lub plawv dhia thiab qib oxidation mus rau ntu // Rau ob qho tib si, tus nqi 0 txhais tau tias "tsis raug" yog (millis () - tsLastReport> REPORTING_PERIOD_MS) {// Serial.print ("Lub plawv dhia:"); // Serial.print (pox.getHeartRate ()); // Serial.print ("bpm / SpO2:"); // Serial.print (pox.getSpO2 ()); // Serial.println ("%"); heart_rate_send [7] = (uint32_t) pox.getHeartRate (); Serial.write (heart_rate_send, 8); Sop2_send [7] = pox.getSpO2 (); Serial.write (Sop2_send, 8); tsLastReport = millis (); }}

Kauj Ruam 31: Qhia Lub Plawv Tus Nqi ntawm LCD Nrog Arduino

Qhia Lub Plawv Tus Nqi ntawm LCD Nrog Arduino
Qhia Lub Plawv Tus Nqi ntawm LCD Nrog Arduino

Ua ke cov cai, rub nws mus rau Arduino pawg thawj coj txhim kho, thiab koj tau npaj los pib ntsuas.

Peb tuaj yeem pom tias thaum cov ntiv tes tawm ntawm MAX30100, lub plawv dhia thiab cov pa oxygen tso tawm 0. Muab koj tus ntiv tes tso rau ntawm MAX30100 tus neeg sau khoom kom pom koj lub plawv dhia thiab qib ntshav oxygen hauv lub sijhawm tiag.

Cov nyhuv tuaj yeem pom hauv daim duab hauv qab no:

Pom zoo: