WizFi360-EVB-Mini Hardware Overview
Thanks to WIZnet for supporting this project with WizFi360-EVB-Mini Hardware.
This document describes WizFi360-EVB-Mini. WizFi360-EVB-Mini is a compact development board for experimenting, testing, and verification of WizFi360. WizFi360-EVB-Mini is the same form factor as the NodeMCU V2. WizFi360 is a low-cost and low-power consumption industrial-grade WiFi module. It is compatible with IEEE802.11 b/g/n standard and supports SoftAP, Station, and SoftAP+Station modes. The serial port baud rate can be up to 2Mbps, which can meet the requirement of various applications.
The MAX30102 is an integrated pulse oximeter and heart rate monitor Sensor. It integrates a red LED and an infrared LED, photoelectric detectors, optical devices, and low-noise electronic circuits with ambient light suppression. Standard I2C compatible communication interface can transfer the collected values to the WizFi360-EVB-Mini for heart rate and blood oxygen calculation.
- Photo-dissolution method
- Light transmittance is converted into an electrical signal
Wiring up a MAX30102 Module & WizFi360-EVB-Mini to Raspberry Pi Pico
- Connect the VCC pin to the power supply, GND to GND.
- Connect the SCL pin to the I2C clock pin and the SDA pin to the I2C data pin on Raspberry Pi Pico.
- Connect the Vin pin to the power supply, GND to GND.
- Connect the TXD1 pin to the IO9 pin and the RXD1 pin to the IO8 pin on Raspberry Pi Pico.
Programming MAX30102 Module
It is best to attach the sensor to your finger using a rubber band or Velcro. When you press your finger against the sensor it varies enough to cause the blood in your finger to flow differently which makes the sensor readings unstable.
- Install the MAX30102 library from Sparkfun
We continuously print the delta values to find the difference
Serial.print((float)samplesTaken / ((millis() - startTime) / 1000.0), 2);
long currentDelta = particleSensor.getIR() - unblockedValue;
if (currentDelta > (long)100)
Serial.print(" Something is there!");
The Serial output is printed as shown.
Display Heartbeat Waveform
Display heartbeat diagram on the Arduino serial plotter. Click tool->Serial Plotter.
// Initialize sensor
if (!particleSensor.begin(Wire, I2C_SPEED_FAST)) //Use default I2C port, 400kHz speed
Serial.println("MAX30105 was not found. Please check wiring/power. ");
//Setup to sense a nice looking saw tooth on the plotter
byte ledBrightness = 0x1F; //Options: 0=Off to 255=50mA
byte sampleAverage = 8; //Options: 1, 2, 4, 8, 16, 32
byte ledMode = 3; //Options: 1 = Red only, 2 = Red + IR, 3 = Red + IR + Green
int sampleRate = 100; //Options: 50, 100, 200, 400, 800, 1000, 1600, 3200
int pulseWidth = 411; //Options: 69, 118, 215, 411
int adcRange = 4096; //Options: 2048, 4096, 8192, 16384
particleSensor.setup(ledBrightness, sampleAverage, ledMode, sampleRate, pulseWidth, adcRange); //Configure sensor with these settings
//Take an average of IR readings at power up
const byte avgAmount = 64;
long baseValue = 0;
for (byte x = 0 ; x < avgAmount ; x++)
baseValue += particleSensor.getIR(); //Read the IR value
baseValue /= avgAmount;
//Pre-populate the plotter so that the Y scale is close to IR values
for (int x = 0 ; x < 500 ; x++)
Serial.println(particleSensor.getIR()); //Send raw data to plotter
The waveform is plotted using the Serial plotter.
Heart-rate and SPO2 Measurement
Display the heart rate and SPO2 on Arduino serial monitor. The ideal heart rate(adult): 60～100 beats per minute and the ideal SPO2: 95~100.
while (particleSensor.available() == false) //do we have new data?
particleSensor.check(); //Check the sensor for new data
digitalWrite(readLED, !digitalRead(readLED)); //Blink onboard LED with every data read
redBuffer[i] = particleSensor.getRed();
irBuffer[i] = particleSensor.getIR();
particleSensor.nextSample(); //We're finished with this sample so move to next sample
//send samples and calculation result to terminal program through UART
Complete codes are added on the code section at the end of the project blog. Do follow till the end to understand this project.
We will programming the WizFi360-EVB-Mini using the AT commands. We will be using multiple serial ports to communicate with USB and with WizFi360-EVB-Mini.
Serial2.println("AT\r\n"); //Handshaking with WizFi360-EVB-Mini
The WizFi360-EVB-MIni responds to the AT commands as shown.
Now, we can send AT commands to the WizFi360-EVB-Mini as per the documentation. There are normal transmission mode and transparent mode in WizFi360. In case WizFi360 is Normal Command mode, WizFi360 executes AT command. Confirm Normal Command mode by inputting AT\r\n and returning \r\nOK\r\n. In case transparent mode, WizFi360 doesn't execute AT command. Only transmit and receive data with peer. If input is "+++", switch to normal command mode.
We had installed the WizFi360 and WiFiEsp library from Wiznet that connects the module to the WiFi and then to Blynk.
Setting up Blynk Application for IoT Pulse Oximeter
- Download the Blynk app (App Store, Google Play)
- Get the Auth Token from the app
- Import this library to Arduino IDE
Set the DataStream as shown below
Update SSID, password, Device ID, Auth Token in the sketch and upload it to Arduino. The WizFi360 is now connected to my WiFi router.
Add the elements to the dashboard to make the UI. Now the device is ready to receive the data from Raspberry Pi using WizFi360. The Heart Rate, SpO2 and the finger presence data are sent to the Blynk Console and the devices connected to them.