Portable Monitor with STONE serial Touch Screen 19

[otw_is sidebar=otw-sidebar-1]

Using STONE serial touch screen portable monitor, the hardware
department decided to use NXP's 32-bit microprocessor chip as the
whole machine monitoring, ECG analysis, control center, by ECG
bioelectricity acquisition amplification, right leg drive, import MIT ECG
database to do algorithm, but also monitor SpO2 sensor electrical
signal, blood pressure, respiratory electrical signal amplification and
filtering processing, through high speed baud rate communication,
drive STONE serial touch screen to display waveform and parameter
changes in real time, and compare with reference value to make
judgment, and monitor and alarm the changes of human body
parameters. If there is a range deviation, it automatically issues voice
prompts.

Portable Monitor with STONE serial Touch Screen

The new version of STONE serial touch screen perfectly supports curve depiction and display, communication protocol is simple and
easy to remember, microcontroller engineers can use it after reading the manual, there are many examples of drivers in the command set,
directly copied to modify the name and parameters can be used.
Serial connection is simple, you can use the official adapter board,
whether it is a direct serial connection, or USB to serial, it is very
convenient and easy to use. The monitor displays multiple groups of
vital parameters at the same time, especially 3 curves are
dynamically drawn and displayed at the same time very smoothly, and
should be able to draw more groups of curve graphics at the same
time, you can try as needed. Of course, the command set curve
function has an example of multiple data pushed at the same time,
but the actual use of the current hardware does not respond, I hope
the official can be optimized as soon as possible. It may also be
solved by updating the firmware. This new version of the drawing
curve function, I first tried how can not be tuned out, and finally
learned that the serial screen has a new firmware, brushed the new
firmware to see the "real face of the mountain". Seeing the smooth
ECG curve coming out of the serial screen with the firmware brushed,
the mood is happy, huh ……
The design picture of this project is shown in Figure (1). The
interface is based on STWI101WT-01 serial screen with 1024*600
resolution, the left side shows 2/3 of the waveform curve and the right

1/3 shows the value.
This article will focus on the creation and depiction of the curve chart view. It is
completely according to the production process of the project demo, no
classification, maybe you feel messy, but it is the real process of real development.

 

 

 

First, we decided to fix the curve depiction of ECG.

 

Figure (1) Project Design Expected Interface
This demo simulates 75bpm heart rate, which is equivalent to
800ms heartbeat, i.e. one point every 40ms, one cycle every 20
points, based on the whole chart view control X axis divided into 100
equal parts, 4s waveform per screen, screen refresh rate 25Hz, looks
very smooth. The line series element of this chart view control is set
to smooth = false (ECG waveform is sharp), the lower envelope is not
displayed, and the point marker is not displayed. area. Here see
Figure (4), min = 0, max = 140 for the Y axis, the maximum value
given in the program is 130, and the range is relatively full. See
Figure (2) – Figure (7) for other parameters, which are set for chart
view1 and its elements X axis1, Yaxis2, bar series1, line series1. We
choose transparent rgba (0,0,0,0) for the bg color of the chart view
control, which reveals the base color (black), and other controls, such
as view, have the same characteristics.

Figure (2) Property settings of chart view1 Figure (3) X axis1 property setting of
chart view1

Figure (4) Y axis1 property setting of chart view1 Figure (5) bar series1 property setting of chart
view1

Figure (6) The line series1 property setting of chart view111 Figure (7) line series1 property
setting of chart view12

The programming code to simulate the ECG waveform (75bpm)
according to the above settings is as follows.
First, define two variables as follows.
Int num19_1 = 0;
Int num19_2 = 0;
Then generally in the main loop main.c, the ECG curve is depicted
by the following code.
delay(10);
num19_1 += 1;
if(num19_1 >= 4){ // Draw one point every 40ms.
num19_1 = 0;
num19_2 += 1;
if(num19_2 == 3){
Serial.println("ST<{\"cmd_code\":\"set_value\",\"type\":\"line_series\",\"
widget\":\"line_series1\",\"mode\":\"push\",\"value\" :10}>ET");
}else if(num19_2 == 4){
Serial.println("ST<{\"cmd_code\":\"set_value\",\"type\":\"line_series\",\"
widget\":\"line_series1\",\"mode\":\"push\",\"value\" :130}>ET");
}else{
Serial.println("ST<{\"cmd_code\":\"set_value\",\"type\":\"line_series\",\"
widget\":\"line_series1\",\"mode\":\"push\",\"value\" :40}>ET");
}
if(num19_2 >= 20){ //every 20 data is a cycle
num19_2 = 0;
}
}

Then you want to take care of the CO2 curve, focusing  on scan synchronization.

The 3 curves of this project, chart view2 is for SpO2 blood oxygen sensor and
chart view3 is for CO2 respiration.
Chart view2, chart view3 X axis axis are set min = 0, max = 100, and ECG chart view1
the same, curve sweep to keep synchronized, chart view2 Y axis2 max = 100, so the
preparation of the program Y axis value is given to 95 maximum, the algorithm is
shown in the following program code.
First, define 3 variables as follows.
Int num19_3 = 0;
Int num19_4 = 0;
Int num19_5 = 0;
The CO2 curve is then generally depicted in the main loop, main.c,
by the following code.

num19_3 += 1;
if(num19_3 >= 4){ //one point every 40ms
num19_3 = 0;
num19_4 += 1;
if(num19_4 <= 10){
num19_5 = num19_4*9; //the first 10 points increase linearly
Serial.print("ST<{\"cmd_code\":\"set_value\",\"type\":\"line_series\",\"widget\":\"
line_series3\",\"mode\":\"push\",\"value\":" );
Serial.print(num19_5);
Serial.println("}>ET");
}else if(num19_4 <= 40){ // the last 30 points decrease linearly
num19_5 = 95 – (num19_4 – 10)*3;
Serial.print("ST<{\"cmd_code\":\"set_value\",\"type\":\"line_series\",\"widget\":\"
line_series3\",\"mode\":\"push\",\"value\":" );
Serial.print(num19_5);
Serial.println("}>ET");
}else{
num19_4 = 0;
Serial.println("ST<{\"cmd_code\":\"set_value\",\"type\":\"line_series\",\"widget\"
:\"line_series3\",\"mode\":\"push\",\"value\" :5}>ET");
} }

Figure (8) shows the ECG waveform at the top and the CO2 waveform at the bottom
(symbol round radius = 4)

Figure (9) shows the ECG waveform at the top and the CO2 waveform at the bottom
(symbol round radius = 30)
The following CO2 waveform in Figure (8) is the effect of the above
program when the attribute symbol round radius = 4 for line series3. We try to
modify symbol round radius = 30, hoping that the curve transition is more
rounded, but the test result is no different from Figure (8), see Figure (9),
which shows that when the points are denser, the rounding effect is not
obvious. This can only be achieved by changing the point coordinates.

Figure (10) with coordinates separating axes
Let's take a look at the properties of the X axis in Figure (3) by
using Figure (10). In Figure (3), when show = true for split line, the
long vertical bar (separator bar) will be displayed; when show = true
for line, the horizontal line of X-axis will be displayed (such as the
horizontal line at the bottom of the top chart view); when show = true
for tick, the thin line of the scale below the horizontal line of X-axis
will be displayed; when show = true for label, the number below the

horizontal line of X-axis (the value filled in data) will be displayed. =
true, it will show the number below the horizontal line of the X-axis
(the value filled in the data). That's all.

Now it was down to the SpO2 curve and decided to
use AD conversion.

Curve simulation using ESP32 ADC, it is 12-bit, full scale 4096. chart
view2 Y axis max = 255, the ADC read-in value divided by 20, can meet the
curve display. The full scale SPO2 display is 100%, so the ADC read in value
divided by 20 and then divided by 2.55 can be displayed in label2, the
program because it is an integer number operation, the algorithm is corrected,
please see the actual test ok program code. Use the function analogRead(32)
in arduino to read the AD conversion value of GPIO32 (also ADC-CH4) of
ESP32 directly. Test can be done by potentiometer, but also simply connect
ADC-CH4 pin to GND, to +3.3V, to +5V, or overhang to see the interference
waveform, see video effect (shown at low when grounded, connected to
+3.3V, +5V is the same high full amplitude, overhang is a spurious curve), the
right label2 control timely display ADC voltage changes. The code and
algorithm code are as follows.
//——–ADC——-
int adcPin = 32; // GPIO32, also ADC-CH4
int adcValue = 0;
int num19_6 = 0;
delay(10);
adcValue = analogRead(adcPin); // Read in the value of the AD conversion
adcValue = adcValue/20;
//—–SPO2 curve plotting ——
num19_6 += 1;
if(num19_6 >= 4){ // one point every 40ms
num19_6 = 0;
Serial.print("ST<{\"cmd_code\":\"set_value\",\"type\":\"line_series\",\"widget\":\"li
ne_series2\",\"mode\":\"push\",\"value\":" );
Serial.print(adcValue);
Serial.println("}>ET");
adcValue = (adcValue*10)/21;
Serial.print("ST<{\"cmd_code\":\"set_value\",\"type\":\"label\",\"widget\":\"label2\
",\"value\":");
Serial.print(adcValue);

Serial.println("}>ET");
}

Fig. (11) The actual completed 3 groups of curves partially
See Figure (11) for a partial shot of the actual picture, and Figure (12) for
the design interface in the computer. As in Figure (3), when the show =
false of the split line of the X axis2 of the chart view2, the separator
bar of the yellow SPO2 area in the middle of Figure (12) will turn off
the display (like the real picture); the smooth waveform of the video
display can be done completely as a real-time oscilloscope.

Figure (12) 3 sets of curves completed by computer

Reference Points

1、 The structure of the STONE designer platform chart view control is shown in
Figure (13). There is a detailed description in the official User's Manual 8.1, including
the explanation of each property and parameter; the instruction set 4.24 gives the
method of data pushing, see Figure (14), and there are examples of instructions used
in the program here.

Figure (13) Structure of the chart view of the curve control

Figure (14) Instructions for using the chart view of the curve control
2、 arduino's analogRead() read function for analog AD conversion. In arduino version
1.8.13 menu "Help"—"Reference" —- "learning —– "Analog I/O", you can see the
description of analogRead() function As follows.
analogRead()
Description
The Arduino board contains a 6 channel (8 channels on the Mini and
Nano, 16 on the Mega), 10-bit analog to digital converter. This means
that it will map input voltages between 0 and 5 volts into integer
values between 0 and 1023. This yields a resolution between
readings of: 5 volts / 1024 units or, .0049 volts (4.9 mV) per unit.
analogReference ().
It takes about 100 microseconds (0.0001 s) to read an analog input,
so the maximum reading rate is about 10,000 times a second.
Syntax
analogRead(pin)

Parameters
pin: the number of the analog input pins to read from (0 to 5 on most
boards, 0 to 7 on the Mini and Nano, 0 to 15 on the Mega)
Returns
int (0 to 1023)
Note
If the analog input pin is not connected to anything, the value
returned by analogRead() will fluctuate based on a number of factors
(e.g. the values of the other analog inputs, how close your hand is to
the board, etc.).

However, please note that here the ADC-CH4 of ESP32 is 12 bits and the return
value will be 0 to 4096. For more details, please refer to the related link in the
original article and the ESP32 manual.

19 Comments

  1. http://finasteride.store/# cost propecia prices

    RonaldAveve
  2. http://ciprofloxacin.tech/# cipro ciprofloxacin

    WilliamReX
  3. lisinopril 5 buy lisinopril 20 mg without prescription order lisinopril online

    DavidbritY
  4. where can i buy cipro online: ciprofloxacin over the counter – buy cipro

    RandallFaila
  5. nolvadex vs clomid tamoxifenworld tamoxifen headache

    DavidbritY
  6. cost propecia prices buy cheap propecia pill cost cheap propecia price

    DavidbritY
  7. buy cipro cheap: buy cipro online canada – buy ciprofloxacin over the counter

    RandallFaila
  8. http://nolvadex.life/# tamoxifen 20 mg tablet

    WilliamReX
  9. zestril 5mg lisinopril 5 mg lisinopril hct

    DavidbritY
  10. price of zestril 30 mg lisinopril tablet zestril 2.5 mg

    DavidbritY
  11. nolvadex half life: tamoxifen and bone density – tamoxifen side effects forum

    RandallFaila
  12. http://cytotec.club/# purchase cytotec

    WilliamReX
  13. buy propecia without prescription cost of cheap propecia without a prescription buying generic propecia pills

    DavidbritY
  14. http://ciprofloxacin.tech/# ciprofloxacin generic

    RonaldAveve
  15. cipro for sale buy generic ciprofloxacin ciprofloxacin over the counter

    DavidbritY
  16. https://ciprofloxacin.tech/# buy generic ciprofloxacin

    WilliamReX

Leave a Reply

Your email address will not be published. Required fields are marked *