Lessons and the learning game

Heart, skin and body sensors

Pulse, SpO2, ECG, skin response, contactless temperature and fingerprints on an Uno, their honest limits, and a fitness monitor. Not medical devices.

None of these projects is a medical device. They are learning projects: never use them to diagnose anything, to decide on treatment, or to reassure anyone who feels unwell. Anything touching skin runs from a battery only (a USB power bank, or a laptop unplugged from the wall), never from mains.

Take the course at /learn/path/health-and-biometric-sensors. It is an intermediate course: it assumes the Uno course.

The lessons

Heart. A MAX30102 in one lesson for pulse and SpO2: the steady light level, the pulse swing on top, Maxim's heart rate and SpO2, and a finger threshold that is only a guess. An AD8232 ECG: R spikes found with a threshold and a refractory time, the R-R interval, leads off, noise, and a refractory time too long for a fast heart.

Skin and body. A GSR module in microsiemens with a tonic level and phasic responses, and what skin response cannot say. An MLX90614 reading object and ambient, skin that is not the core, and a hot-surface warning.

Identity and honesty. A fingerprint module that keeps its templates and returns an ID and a confidence, and why fingerprints are not passwords. Then the oximeter again with honest rules: no finger, no number; the settling window thrown away; readings outside what the method can measure refused.

Boss. A fitness monitor: MAX30102, MLX90614 and an SSD1306 on one I2C bus, heart rate zones from 220 minus age, a peak, and every honest rule kept.

The benches

The PPG and limits lessons open the oximeter (MAX30102 at 0x57), the ECG lesson the ECG plot (OUTPUT on A0, LO+ 10, LO- 11), the GSR lesson the lie detector's first stage (GSR on A0, a bar on 2 to 11), the temperature lesson the fever thermometer (MLX90614 at 0x5A) and the fingerprint lesson the fingerprint lock (pins 2 and 3). The boss has the MAX30102, the MLX90614 and an SSD1306 at 0x3C on A4 and A5.

What each sketch does

  • bioppg: four-second windows, the IR level and swing, Maxim's algorithm, and FINGER_IR.
  • bioecg: THRESHOLD, REFRACTORY_MS, an average of four R-R intervals, and LO+ and LO-.
  • biogsr: the module's formula, a slow tonic average, and RESPONSE_US.
  • biotemp: object and ambient, and HOT_C.
  • biofinger: image, template, fast search, and ADMIN_ID.
  • biolimits: SETTLE_WINDOWS, BPM_LOW, BPM_HIGH and SPO2_LOW.
  • bioboss: AGE, zones, a peak, and the OLED through SSD1306Ascii.

Honest limits

  • The simulated finger, skin and heart are clean signals: no movement, cold fingers, skin tone, nail polish or room light.
  • The MAX30102's first window includes its start-up, and windows that span a change mix the two rates: both are real behavior of the method.
  • The MLX90614's emissivity setting is accepted but does not change the reading.
  • Every fingerprint match has a confidence of 100.

Build a science fair lie detector uses the GSR and MAX30102 for a demo, said plainly.