# ESP32 MAX30102 Web Oximeter
A MAX3010X Web Oximeter based on ESP32.
The heart rate and blood oxygen calculation and driver codes of this project come from the following project:
https://github.com/coniferconifer/ESP32_MAX30102_simple-SpO2_plotter
This project is reconstructed on the basis of the above project, adding a Fat file system, allowing users to use FTP to manage the file system to upload the web front end; using Bootstrap + ChartJS to redesign the front-end program, adding the historical chart curve function, and adapting to the mobile phone
![1.png]

![230111huk2e645fauu4auf.png]

![230111xqqrf2fgi27qifh3.png]

# [**Demo video**](https://www.bilibili.com/video/BV1DG4y1L7N2/?vd_source=2827e677d6d7e32ef3817579a35304ac)
## AttentionAttention
does not guarantee the accuracy of the heart rate and blood oxygen readings of this project, is not responsible for the stability and reliability of this project, is not responsible for the health problems caused by this project, cannot be used directly as a medical product, and does not provide any guarantee for this project. If there is any ambiguity in the description of this project, the Chinese version shall prevail.
## BackgroundBackgroundIn
the extraordinary period after the opening of the new crown epidemic, you need to monitor the physical condition of you and your family at all times to prevent emergencies to the greatest extent. You urgently need an oximeter to monitor blood oxygen and heart rate, but unfortunately the price of online oximeters has been driven up by J merchants and scalpers. Even if you bite your teeth and buy it, you still face problems such as the merchant unilaterally breaching the contract after the transaction is successful, never delivering the goods, and the courier returning the goods midway. For the health of your family, you have to seek the help of the universal Internet and immediately make a blood oxygen meter.
## Open source code usage and license License
Note: Different parts of the open source code of this project use different open source agreements! If not explicitly stated, the Apache-2.0 agreement is used.
The open source of the hardware part belongs to Public Domain
NameOpen
Source
AgreementLicenseNoteLink ESP32_MAX30102_simple-SpO2_plotter Apache-2.0Used in cal_BPM_SpO2.c blood oxygen core calculation parthttps ://github.com/coniferconifer/ESP32_MAX30102_simple-SpO2_plotter SparkFun_MAX3010x_Pulse_and_Proximity_Sensor_Library CC BY-SA 4.0 and MIT MAX3010X driverhttps
: //github.com/sparkfun/SparkFun_MAX3010x_Sensor_Library ArduinoJson MIT is used to process JSON https://arduinojson.org/ SimpleFTPServer MIT provides FTP file management servicehttps ://github.com/xreef/SimpleFTPServer Bootstrap Apache-2.0 front-end CSS framework https://github.com/twbs/bootstrap ChartJS MIT provides front-end chart drawing https://www.chartjs.org/ IconPark Apache-2.0 provides two front-end icons https://github.com/bytedance/IconPark If you find that this project has incorrect use of open source licenses or omissions in the disclosure of open source code usage, please contact the developer of this project and we will promptly handle possible use issues of mixed open source code licenses. ## Hardware connection The default pin connection can be modified in main.h | MAX30102 | ESP32 | | -------- | ----- | | 3V3 | 3V3 | | GND | GND | | SCL | 22 | | SDA | 21 | ## Install using precompiled firmware - Prepare precompiled release firmware
- Prepare flash_download_tools, [https://www.espressif.com.cn/zh-hans/support/download/other-tools](https://www.espressif.com.cn/zh-hans/support/download/other-tools)
- Open flash_download_tools
- Select the firmware and configure the installation address
- Select the "COM" serial port
- Press the "START" button to download the firmware
- Manually reset after completion
- ESP32 automatically turns on the hotspot "ESP32 Oximeter"
- Connect to the hotspot
- Use a browser to open [http://192.168.4.1](http://192.168.4.1)
- Start using
! [UseESPFlashTool.png]

## Compile and install (omitted)
Vscode uses PlatformIO to compile and download the program
partition table. Please select: After downloading the default_ffat.csv
program to ESP32 and restarting, ESP32 will enable a Wifi hotspot named "ESP32 Oximeter" by default and start the FTP server on port 21 (anonymous login)
The default address of ESP32 is 192.168.4.1
### config.json configuration file
Under the web folder of this project, there is a config.json file, which is the configuration file of ESP32. The file content is as follows```
{
"
STA_ssid": "Your Wifi name",
"STA_passwd": "Your Wifi password",
"AP_ssid": "ESP32 Oximeter",
"AP_passwd": ""
}
```
You can modify the file and upload it to the root directory of the ESP32 file system via FTP, and restart ESP32 to achieve the purpose of network configuration
### Use FTP tools to deploy web pages
Please copy all the contents of the Web folder under this project to the root directory of
ftp://192.168.4.1/
. After completion, your ESP32 The FTP root directory structure should be as shown below
![Snipaste_2023-01-07_15-42-20.png]

FTP defaults to anonymous login
## Open the front-end page
If you use the Wifi AP hotspot enabled by ESP32, you can open the front-end page through the following link
http://192.168.4.1
If you have completed the network configuration and ESP32 is successfully connected to your Wifi, you need to check the IP address of ESP32 in the background of your router.
The front-end interface is as shown below:
![1.png]

![2.png]

![3.png]

## Q&A
### Q: FTP cannot be openedA
: Please check whether the accessed FTP address is correct
### Q: An error occurred while copying files through FTPA
: If you use the file manager that comes with Windows, you can try to copy the files manually one by one. It is recommended to use FTP tools such as WinSCP to copy files
### Q: The files actually exist in FTP, but the directory structure cannot be seenA : The Ffat file system of ESP32 may be damaged. You can program ESP32 to format the file system, or use flash_download_tools to completely erase ESP32
, and then reinstall this program to solve the problem
### Q: MAX30105 cannot be used normallyA
: You need to modify the code in cal_BPM_SpO2.h``` //CUSTOM DEFINITION //#define MAX30105 //if you have Sparkfun's MAX30105 breakout board , try #define MAX30105 `` ` is``` // CUSTOM DEFINITION #define MAX30105 //if you have Sparkfun's MAX30105 breakout board , try #define MAX30105 ``` Then recompile the code and download it to ESP32. For explanation of this part, please refer to https://github.com/coniferconifer/ESP32_MAX30102_simple-SpO2_plotter ### Latest source code open source address The source code in the attachment below this post may not be the latest version. The new version of the program is updated synchronously on Github and Gitee. If you have any questions, you can leave a message below this post, or go to Github or Gitee to publish Issues https://github.com/createskyblue/esp32-web-oximeter https://gitee.com/createskyblue/esp32-web-oximeter ### Contact the developer 1. Reply below this post 2. Publish Issues on Github or Gitee 3. Email: createskyblue@outlook.com or 1281702594@qq.com