2019年3月28日星期四

3_3

3_3
In order to design the wearable device, I chose the optical sensor MAX30100 to connect with the smaller Arduino Nano. The purpose of this week is to complete the entire monitoring system used in the Arduino Nano.

Circuit connection diagram:

Figure 1: system circuit connection diagram

According to the requirements of figure 1, the product can be seen in Figure 2.
Figure 2: the diagram of the product

Next, add the header file of the LCD display to the original program and set the output parameters to heart rate, blood oxygen, and temperature. Finally, add the output to the LCD display.

Figure 3: header file of the LCD display screen


Figure 4: set the output parameters

After that, operate the program again. Put your finger on the LED of an optical sensor, the data can be displayed on the LCD screen, iPhone and PC.

Figure 5: results of PC


 
Figure 6: results to iPhone

Project operation video can be viewed by clicking on this website https://youtu.be/JTYpFGZnnFE


Conclusion:

So far, the basic functions of the entire project have been completed. Heart rate and blood oxygen concentration are detected. Wireless transmission of data via Bluetooth has been completed. The next step is to design it as a wearable product. Design all components onto the PCB board. Because of the limitation of time, the wearable product will be completed in the future.

3_2

3_2
Because there is no Android phone, I chose Bluetooth HC-08 to achieve wireless communication with the iPhone. The purpose of this week is to test the communication between HC-08 and iPhone.

Hardware requirements:
1.     Bluetooth HC-08
2.     One iPhone

Software requirements:
1.     Arduino 1.8.2

Figure 1: The Bluetooth HC-08 module

Connection requirement
Bluetooth HC-08
Arduino Uno
VCC
5V
GND
GND
TXD
RX
RXD
TX


Figure 2: The connection diagram


Next, give the Arduino Uno external power and run the program. Open the iPhone app named DSDTECH Bluetooth. Blood oxygen concentration and heart rate will be displayed on the screen.


Figure 3: the results to iPhone

Conclusion

Firstly, for the Bluetooth HC-08 test, connect the power and then make sure the iPhone can search for the corresponding Bluetooth. This means that Bluetooth can be paired. Then connect Bluetooth to Arduino Uno according to the connection requirements. Add a Bluetooth serial port to the program output. You can see the data shown in figure 3.

2019年3月24日星期日

3_1

3_1
Because the LCD screen is an instantaneous output, the MAX30102 sensor collects 4 seconds of data processing and outputs it together, causing data errors to be displayed on the LCD screen. So I changed the MAX30100 sensor to solve this problem. Because the MAX30100 sensor data is instantaneous output, it matches well with the LCD screen. The aim of this week is to test the optical sensor MAX30100 function.

Hardware requirement
1.     The optical sensor MAX30100
2.     Arduino Nano
3.     Three 4.7KΩ resistor

Software requirement
1.     Arduino 1.8-3

Connection requirement
MAX30100 sensor
Arduino Nano
VIN
5V
GND
GND
SCL
A5
SDA
A4
INT
D2



Figure 1: The circuit schematic for the MAX30100 sensor

The SCL and SDA pins are pulled-up via the 4.7k ohm resistors to 1.8V. This means it won't work well with microcontrollers with higher logic levels.

Figure 2: the connection circuit


Next, download the initial program to Arduino Nano and compile the program, the results can be seen in figure 3.

The figure 3: results from the Arduino Nano

Conclusion

It's worth noting that the sensor is not used on the Arduino Nano board directly, because of the limitation of working voltage for the sensor (MAX30100). We need pull-up the 4.7k ohm resistors between the SDA and SCL pins to reduced voltage to 1.8V.

2019年3月18日星期一

2_3

2_3
The work of this week is testing the LCD screen and ensures the LCD screen can be used in heart rate and SPo2 monitoring system.

Hardware requirements:
1.     LCD screen

Software requirements:
1.     Arduino 1.8-3

Connection requirement
LCD screen
Arduino Uno R3
SCL
SCL
SDA
SDA
GND
GND
VCC
5V

First of all, connect the LCD screen to Arduino Uno as connection requirement, then power on the Arduino Uno R3 board. The LCD screen will light. Next, download the test program “Hello world” and compile it. The LCD screen can be displayed Hello world. It can be seen in figure 1.

 
Figure 1: the results from the LCD screen


If the LCD screen displays the “Hello world”, which can prove the LCD screen can be used. Therefore, the next step to add the header file Wire.h, LiquidCrystal_I2C.h and Set the LCD address to 0x27 for a 16 chars and 2 line display named that LiquidCrystal_I2C LCD (0x27, 16, 2); Finally, add the output to LCD serial port. The final result is that the heart rate value and the blood oxygen value are displayed together on the LCD screen.

Conclusion

Since the LCD screen is instantaneous output data. On the one hand, there is a delay in the optical sensor; on the other hand, it is to collect 4 seconds of data and then output. Causes an error on the LCD screen display, such as the heart rate is -999 and the blood oxygen is -999. I purchased an optical sensor that can output in time to solve this problem. It will be described in the next blog.

2019年3月17日星期日

2_2

2_2
The sensor is used on the Arduino Uno, and the next step is to implement wireless data transmission. The core of this step is to achieve two Bluetooth pairing. Therefore, the purpose of this week is to complete two Bluetooth pairing.

When the passwords and addresses of the two Bluetooth are the same and the master-slave mode is set. In general, two Bluetooth can intercommunicate with data. In terms of form, it can be distinguished. When two Bluetooth pairs are successfully paired, the LED light on the Bluetooth flashes twice a second.


The circuit with Bluetooth can be seen in figure 1.

Figure 1: two Bluetooth pairing.
The website that https://youtu.be/WPUe0af87co  can see the video of two Bluetooth pairing.

Conclusion
First of all, in Bluetooth wireless communication, Bluetooth pairing and master-slave mode settings are crucial. The master mode Bluetooth is connected to the development board, and its function is sending data. Then slave mode Bluetooth connects to the PC, its function is accepting data. Then in the code, you need to add the wire.h header file and then add the output serial port to Bluetooth. After this, wireless transmission can be achieved. Of course, you can also receive data on the mobile phone. However, since there is no Android phone, I didn't try.

2_1

2_1
Because the MAX32600 mbed board is not compatible with the Bluetooth HC-05, the HC-05 is suitable for Arduino Uno, and the Arduino Uno is smaller and easier to wear. Thus, I focus on plan B in the second semester 2. The microprocessor was changed to Arduino Uno. The aim of this week is testing the MAX30102 optical sensor on the Arduino Uno R3. 

Hardware requirements:
1.     MAX30102 optical sensor
2.     Arduino Uno board
3.     HC-05

Software requirements:
1.     Arduino 1.8-3
2.     The initial code was downloaded from the website (https://github.com/).

Connection requirements:
MAX30102 sensor
Arduino Uno
SDA
SDA
SCL
SCL
INT
10
VIN
3.3V
GND
GND

First of all, the code import in Arduino 1.8-3 platform, adjust the serial port to Arduino Uno and match development board model is Arduino Uno R3. Finally, compile the program, the results can be seen in figure 1.

Figure 1: the results from Arduino.

Conclusion

Bluetooth matching is the highlight of this project, so in order to achieve this function; you can just give up the MAX32600 mbed board and choose the more suitable Arduino Uno board.

1_4

1_4
the purpose of this week is setting Bluetooth enter AT mode and make Bluetooth can communicate between the processor and computer. 

Hardware requirements:
1.     Two Bluetooth (HC-05).
2.     USB conversion port



Figure 1: the Bluetooth HC-05 (with black button) and USB conversion port

                                                                



Figure 2: the Bluetooth HC-05 (without black button) 

Software requirements:
1.     Arduino 1.8-3

Connection requirements:
HC-05
USB conversion port
RX
TXD
TX
RXD
VCC
VCC
GND
GND

AT command
1.     AT+NAME=LSN  (setting the Bluetooth name to LSN)
2.     AT+ROLE=1     (setting the Bluetooth role to master, 1 is master and 0 is slaver)                       
3.     AT+PSWD=1234  (setting the password to 1234)           
4.     AT+UART=11520000 (setting the baud rate to 115200 and Stop bit 1 bit, no parity bit)

Create a new program in the Arduino, then open the serial monitor, adjust the baud rate to 38400, because the Bluetooth HC-05 initial baud rate is 38400. Then enter the AT command, if successful, feedback OK, failure feedback error.

Conclusion
The HC-05 comes in two styles; one with a black button and one without a black button. Make sure you buy Bluetooth with a black button. Because when you enter AT mode, you need to press and hold the black button to power on.