Peter Gamma (Physiologist & Director) Meditation Research Institute Switzerland (MRIS)

How to build a physiological multi-sensor device based on InfluxDB?

Last Updated on September 20, 2023 by pg@petergamma.org

  1. We suggest to start this project with an Apple watch:

Sensor data from the Apple watch can be synchronized to Home Assistant and from there exported to InfluxDB.

2. From there we can test if we can can read and write data with the InfluxDB Client for Python:

https://thenewstack.io/getting-started-with-python-and-influxdb/

3.We can try to add an other sensor for instance a temperature sensor over ESP32:

4. We can add an ADS1115 4 channel 16 bit chip to ESP32 as an analog to digital converter for our device:

5. We can add an AD8232 ECG chip to the ADS1115 analog to digital converter as it was done here:

https://www.hackster.io/pukhrajdhiman/dnn-based-homemade-ecg-a4259a

  • The instruction does not show in detail how the AD8232 ECG chip was connected to the ADS1115 ADC, but how to connect a sensor to the ADS1115 chip in detail can be seen in the instruction from How To Electronics shown above. Here we can only see resulting ECG signal, when an ADS1115 was used, which is good.
  • The following example shows how to connect a pulse sensor to the ADS1115 ADC in every detail:

https://www.theengineeringprojects.com/2023/01/heartbeat-monitoring-system-with-ads1115-raspberry-pi-4.html

  • If you are interested in the AD8232 ECG chip, study the instruction of Scott Harden for the Sound Card ECG. In the example shown here, the ADS1115 replaces the sound card in Scott Hardens Sound Card ECG.
  • The instruction uses an ADADS1115C and the ADC resolution is only 12 bits and not 16 bit. There are two versions of the ADADS1115 available, one with 12 bit and one with 16 bit analog to digital conversion rate. For research applications, 16 bit ADC or higher is recommended.
  • This instruction shows that the ADADS1115 analog to digital converter works with the the AD8232 ECG chip.
  • The author had problems with noise coming from the main AC supply, but the ECG signal was good after filtering.
  • Scott Harden used a battery for his sound card ECG with the AD8232 ECG chip and had no problems with noise. To use an AC power supply with an ECG is not recommended due to risk of power shock, use a battery instead.

The ESP32 offers an analog to digital conversion rate of 12 bit:

https://docs.espressif.com/projects/esp-idf/en/v4.2/esp32/api-reference/peripherals/adc.html

If 12 bit is enough we can start without an ADS1115. Instead of a temperature sensor as shown above, we can attach ECG, EEG and MEG modules to ESP32 to start with a circuit which simple.

6. How to Electronics already showed how and AD8232 ECG Sensor can be connected to ESP32 to Ubidots:

https://how2electronics.com/iot-ecg-monitoring-ad8232-sensor-esp32/

Instead of connecting it to Ubdots, we can connect the circuit to Home Assistant, as shown in the above example with the temperature sensor.

7. If this setup works we can add further ECG, EEG, MEG, PPG sensors of our joice.

There is no limit how much sensors to add, as for instance with OpenBCI. Also other sensors can be added, also for instance balenaHealth over balena Home Assistant, which reads sensor data from a Polar H10 chest strap.

This is a backbone for a device which physiologists as we are can imagine to test and use by ourselves, and it is one of of our favorite setups, after we reviewed physiological sensor platforms in many of our 2066 posts in our journal. Adding a Home Assistant Integration to a sensor makes those more user friendly.

This setup is similar to BITalino or OpenBCI, but it is new and needs to be digested. We miss on OpenBCI and BITalino that we know of hardly any new developments for these platforms. This setup is new and suitable for developers who are interested in low-cost high-quality physiological sensor platforms and how to integrate those with contemporary software.

17 replies on “How to build a physiological multi-sensor device based on InfluxDB?”

Comments are closed.