I am currently finalizing my first prototype ever: an arm band that sense acceleration, electrodermal activity and BVP (Blood Volume Pulse)!
As you can imagine, I am very excited as it is my first electronics project ever. Here is the list of the components I use:
- ESP32 Devkit C
- MPU6050 accelerometer (25hz)
- MAX30102 for BVP and temperature (50hz and 4hz respectively)
- Simple circuit with DAC and ADC Pins as well as some AgCl electrodes (https://www.researchgate.net/figure/Bas ... _272744552 (20hz)
- SPI micro-SD card reader
- buttons, leds and resistors
I'm not gonna post code snippets right now because the program is very simple:
- A main uasyncio coroutine that does the starting sequence like select uart streaming or local mode and then starts several uasyncio coroutines (one infinite loop by sensor that takes data and save it into a bytearray buffer)
- A loop that writes the byterray to a file or send it to a computer via stdout.buffer.write()
- Using the pushbutton primitive to be able to use 2 buttons to select the mode or stop the program and put the esp32 into deepsleep mode until the wake or reset button is pressed
- Lowering CPU frequency from 160mhz to 80mhz which lowered to current to 41-49 mA constant (The watt meter is crap, i'm gonna get a better one, any recommandations?). The issue with that is the sensor frequency is even more off...
- Maybe using a better esp32 with power circuit optimization such as the TinyPico or TinyS3 and running on 3.7V battery would improve performance
- Replacing the MPU6050 by an ADXL345 because the MPU led and gyroscope consume more power than the accelerometer with no way to turn them off (I can always burn off the led/led resistor)
- Using Fast_io to improve I/O speed and coroutine scheduling with the lowered cpu frequency. Sadly, the power consumption optimizations seem to only work with the pyboard.
- Turning off the modem if not off by default but I couldn't find a way to do it in micropython on the esp32
Thanks for reading this novel and thanks in advance for your help!