- The analog port PA5 of the STM32F429I board is connected to the DAC_1 port of the ESP32-WROOM-32 board, so we will monitoring each mmHg of the pressure sensor in real time.
- When we press the user button (blue) that corresponds to port PA0, then the air pump and the pneumatic solenoid valve are turned ON.
- In this solenoid the valve closes and doesn't allow any air leakage, so the air pump begins to inflate the cuff, and the pressure sensor tells us how the pressure increases inside the cuff.
- Each increase in pressure within the cuff is printed on the LCD screen of the STM32F429I board.
- You have to note that before printing the total pressure I do a subtraction of eight units, this is because I found a small error of + 8 mmHg approx in all my readings. I did this verification with an aneroid gauge.
Aneroid gauge
- When the pressure inside the cuff reaches 170 mmHg, then the air pump is stop (OFF), and the solenoid valve continues closed.
Flowchart
if STM32.User_Button.Has_Been_Pressed then -- Btn pressed then go to 170 mmHg
Start_Conversion (Converter);
Poll_For_Status (Converter, Regular_Channel_Conversion_Complete, Successful);
Solenoid_valve.Set; -- solenoid valve is ON
Motor.Set; -- air pump is ON
Enable_a.Set;
Enable_b.Set;
Raw := UInt32 (Conversion_Value (Converter));
Volts := UInt32 ((Float (Raw) / 4096.0) * 3000.0); -- 4096 ADC = 3000 mV
Pressure := UInt32 ((Float (Volts) / 3000.0) * 255.0); -- 3000 mV = 255 mmHg
Pressure_total := UInt32 (float (Pressure) - 8.0); -- 3000 mV = 255 mmHg
Print (0, 0, Pressure_total, " mmHg"); -- print blood pressure
while Pressure_total <= 170 loop
Start_Conversion (Converter);
Poll_For_Status (Converter, Regular_Channel_Conversion_Complete, Successful);
Raw := UInt32 (Conversion_Value (Converter));
Volts := UInt32 ((Float (Raw) / 4096.0) * 3000.0); -- 4096 ADC = 3000 mV
Pressure := UInt32 ((Float (Volts) / 3000.0) * 255.0); -- 3000 mV = 255 mmHg
Pressure_total := UInt32 (float (Pressure) - 8.0); -- 3000 mV = 255 mmHg
Print (0, 0, Pressure_total, " mmHg"); -- print blood pressure
delay until Clock + Milliseconds (75);
end loop;
Solenoid_valve.Set; -- solenoid valve is ON
Motor.Clear; -- air pump is OFF
Enable_a.Set;
Enable_b.Clear;
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.