Story
Project have started 2 years ago, as attempt to create a smartwatch with pedometer, hr sensor and skin temperature sensor. I wanted to collect big data about my activity and sync this data to my server when I can process it. That's why MCU chip should have wireless feature, and work pretty fast :)
I haven't wanted to create yet another fancy smart watch, I wanted to create tool which helps people understand their state, which may say something about peoples state based on previous actions. I don't want to have continues connection with phone or wifi (at least for now), watch only collect data, process it and show some messages and digits, for example:
- you under stress now, your galvanic skin resistance increase
- your temperature higher than normal
- you haven't moved for long time, plz do something
- you have strange temperature change pattern every month.
At that time I haven't any experience in creating any electronics, especially battery devices.
As you will see, it is long lasting pet-project, but I will be happy If someone join it =)
tshWatch 1.1
First approach was with heltec esp8266 module with small oled display, and battery charging module. It seemed easy, just add sensors and all should works, but... Battery drained dramatically fast. I tried to use sleep mode but in result I've read about esp32 ulp coprocessor, and decided - this is my way :)
tshWatch 1.2
Main idea of any battery project - MCU and all sensors should sleep as many as it possible. Esp32 has ultra low power coprocessor, which consume small ampers and can work with i2c bus, but disadvantage of this coprocessor - it has access only to 8kb RTC memory, and works only with 16bit word, and you have to know assembler =) a
So I had to write code which wakes up ULP coprocessor once in minute and read all sensors, write data in RTC memory. Once in some period of time main core should wake up and write all data to MCU. This logic seems obvious, but MCU assembler was "terra nova" for me.
Esp32 opened new assembler world for me, and given cool results. I've created code witch worked decent time on one battery charge. I haven't any experience in assembler and deep knowledge i2c protocol, but all module drivers for ulp coprocessor I wrote by myself. It was fun time when I read bunch of datasheets, and fixed existed i2c library which at that time worked only with simple datatypes. Especially I liked test and debug ulp program via memory dump.
Esp32 Wroom module was good and I tried to fit it in existed case which I took from thingeverse, but... wroom module is BIG enough to place it on hand. After some research I've read about TTGO micro32, and I've decided - this is my way =)
As result, year ago I had orange wrist watch with 180mAh battery which worked for 3 day on one charge, and read every minute 3 sensors - pedometer, current meter, skin-temperature meter.
About components which I chose:
- Oled 1.3" display SH1106, big, chip easy to solder.
- RTC ds3231mz, almost all time MCU is in deep sleep, and after deep sleep it should know what time is now, so Real Time Clock necessary.
- pedometer LSM6DS3C, at first I choose bmi160 but, DS3231 has same i2c address and I had ready pcb, luckily LSM6DS3C has same footprint and build in pedometer function.
- mlx90615. relatively small and accurate temperature sensor
- ina219, I need to show somehow battery level, MCU can detect battery voltage via internal esp32 adc, but I decided to use i2c sensor.
Watch had 4th sensor (a heart rate sensor MAX30100), but I stumbled up on raw data processing from this sensor. I tried to write ulp driver to max30100, it worked now, but even now I can read only raw data (I'm sure, I can take good results in future)
As we may see sometimes I haven't tested all components at one breadboard )) and it led to occasions, but I solved its.
All collected data may be sent to web server, by choosing proper menu item.
tshWatch 1.3
My first pcb designs was spooky (btw, current...
Read more »
Hey Ivan, I’m a data engineer with a long history in hardware hacking. Also, with a special interest in giving people access to insights from their personal data. Here’s some of my writeups.
https://ladvien.com/analytics-warehouse-explained/
https://ladvien.com/setup-remote-storage/
https://ladvien.com/homemade-pulse-sensor/
I’d love to chat about setting up a cloud infrastructure and data models for you to process the data you are getting. You can reach me at cthomasbrittain@hotmail.com
And definitely love the build!