Medical ventilator based on Arduino UNO and STONE HMI Display

Brief

In this project, you can control the Arduino UNO development board by using the HMI serial port screen and carry out data command interaction through serial port communication. The Arduino Uno development board can upload a series of waveform data and display it on the serial port screen. This project is very helpful for making the ventilator display screen.

The ventilator project I do here will have a startup animation effect after power on, then enter a startup initial solution interface, and display the word "open". Click it to have a voice effect, prompt to open the ventilator, and jump to the page selection interface, where there will be an animation effect, which is an animation to show the human breath, and there are two options The first is the oscillogram monitoring chart of respiration. The second is the oxygen and respiratory rate monitoring chart. How to display so many oscillograms at the same time is a problem. After clicking enter, STONE HMI will issue a specific command to control MCU to start to upload the waveform data.

The functions are as follows:

① realize button setting;

② Realize voice function;

③ realize page switching;

④ realize real-time waveform transmission.

Modules required for the project:

STONE TFT LCD

② Arduino Uno module;

voice play module.

connection

GUI design

code sharing

/*

   Serial

*/

//#include

#include "stdlib.h"

int incomedate = 0;

//#define UBRR2H

//HardwareSerial Serial2(2);

uint8_t i = 0, count = 0;

uint8_t StartBreathWaveFlag = 0;

uint8_t StartHeartO2WaveFlag = 0;

 

 

uint8_t EnterBreathWave[9] =    {0xA5, 0x5A, 0x06, 0x83, 0x00, 0x12, 0x01, 0x00, 0x01};//

uint8_t BreathBackToBg[9] =     {0xA5, 0x5A, 0x06, 0x83, 0x00, 0x14, 0x01, 0x00, 0x02};//

 

uint8_t EnterHeartO2Wave[9] =   {0xA5, 0x5A, 0x06, 0x83, 0x00, 0x13, 0x01, 0x00, 0x03};//

uint8_t HeartO2BackToBg[9] =    {0xA5, 0x5A, 0x06, 0x83, 0x00, 0x15, 0x01, 0x00, 0x04};//

 

uint8_t RecievedTemp[9] = {0};

 

uint8_t StartBreathWave[7] = {0xA5, 0x5A, 0x04, 0x84, 0x01, 0x01, 0xFF};//

uint8_t CleanBreathWave[6] = {0xA5, 0x5A, 0x03, 0x80, 0xEB, 0x56};//

 

uint8_t StartHeartO2Wave[9] = {0xA5, 0x5A, 0x06, 0x84, 0x06, 0x00, 0xFF, 0x00, 0x22};//

uint8_t CleanHeartO2Wave[6] = {0xA5, 0x5A, 0x03, 0x80, 0xEB, 0x55};//

 

 

void setup() {

 

  Serial.begin(115200); //115200

 

}

 

void loop() {

 

  if (Serial.available() == 9)//

  {

      for(count = 0; count < 9; count ++)

      {

          RecievedTemp[count] = Serial.read();

      }

      if(RecievedTemp[8] == 0x01)

      {

          StartBreathWaveFlag = 1;

          StartHeartO2WaveFlag = 0;

          Serial.write(CleanBreathWave, 6);

          delay(1000);

      }

      else if(RecievedTemp[8] == 0x02)

      {

          StartBreathWaveFlag = 0;

          Serial.write(CleanBreathWave, 6);

      }

      else if(RecievedTemp[8] == 0x03)

      {

          StartHeartO2WaveFlag = 1;

          StartBreathWaveFlag = 0;

          Serial.write(CleanHeartO2Wave, 6);

          delay(1000);

      }

      else if(RecievedTemp[8] == 0x04)

      {

          StartHeartO2WaveFlag = 0;

          Serial.write(CleanHeartO2Wave, 6);

      }

      

  }

  

  if(StartBreathWaveFlag == 1)

  {

        delay(1);

        Serial.write(StartBreathWave, 7);

              

                i = rand();

            StartBreathWave[6] = i;

  }

  else if(StartHeartO2WaveFlag == 1)

  {

        delay(1);

        Serial.write(StartHeartO2Wave, 9);

              

                i = rand();

            StartHeartO2Wave[6] = i;

            i = rand();

            StartHeartO2Wave[8] = i;

      

  }

}

running effect

It looks like a fun but bad project! What happens if the ventilator fails? Maybe somebody crippled or dies? I would assume you would be liable. In the USA there are very strict requirements for medical equipment which this would be classified as. Be sure your insurance is current and check with them to be sure you would be covered with this type of project.

Worse than that, Gil. No rational medical person would ever risk using a not-certified piece of equipment, no use a NON UL and FDA approved power supply.
Paul

1 Like

None realtime application will use the delay() function.

    Line 95:          delay(1000);
	Line 119:         delay(1000);
	Line 143:         delay(1);
	Line 159:         delay(1);

p.s.
Replace all magic numbers.

Looks interesting.

Always, always document your code.

Build it, if only for the experience. Do not expect to sell it, just build. Learn. Do lots of research about existing commercial hardware: match and try and extend that functionally. If you devise the next great thing, seek professional review. Do not put out cash beyond an attorney.

People do have great ideas and some do invent that needed device. But remember, the odds are someone has considered the very thought you now have. Do not despair; the road to greatness is rarely a short path.

Good luck.

Thanks for your suggestions, I just have such an idea, but at the moment I really can't implement it, I am using some simple components to simulate some scenarios instead of actually implementing it.