-
Finally got sleep modes working on TM8
07/03/2023 at 05:08 • 0 commentsFinally I have sleep modes working on Time Machine Mk. 8. I don't have a current measurement device, so I don't have an exact way of measuring power consumption so I could only conduct very simple, short tests. But here are the results:
1) Display off, press a button to display the time for 2 seconds. Watch is in deep sleep mode when display is off. Running at full 48MHz when displaying time or any other function
-> estimated battery life of around 50 hours, give or take 10. About 12 readings per hour (once every five minutes). Adjusted time once and didn't use any other function.
-> about 600uA current consumption I think?
2) Always on display. Watch is in deep sleep for 990 milliseconds, only wakes up to refresh the display with new info and immediately goes back to sleep. display refresh and other features use full 48MHz.
-> estimated battery life of around 17.5 hours, give or take 5. Similar use to above, didn't use a lot of the watch's features.
-> around 2.5 mA of current consumption?
obviously, the current consumption even with deep sleep enabled is very high. My target is about a week of battery life, which I think is definitely possible. However, I'm still really happy that TM8 can now last almost a full day of use even with an always-on display!
-
BME680 sensor and piezo buzzer now working!
06/27/2023 at 02:44 • 0 commentsI got the BME680 environmental sensor working as well. It was relatively painless, I used Bosch's BME68X Arduino library. The Library supports SERCOM Wire objects, so it made life a lot easier.
I also got the buzzer to work. It's not as loud as I want but it's not quiet either. Weirdly enough it gets pretty hot with just a little use so I'll be using it for very short sound effects, like button presses or warning beeps.
Now, Time Machine Mk. 8 can monitor acceleration, orientation, temperature, humidity, pressure, altitude, and gas measurement. I don't think I'll be using the last one often, if at all, but the other ones should give me a healthy amount of telemetry to play with!
I'm slowly but steadily working my way through getting everything working on TM8. Since I now have all major sensors and I/O working, I now need to focus on rewriting code for the chronograph and tachymeter, as well as trying to get the SPI Flash chip working.
-
Finally got the accelerometer working on Time Machine Mk. 8!
06/17/2023 at 07:31 • 0 commentsAfter weeks of misery and head scratching, I finally got the accelerometer working for TM8. Huuuuuuuuge load off my shoulders.
There was a very small hardware quirk on the SAMD21G18 chip that was messing around with my SERCOM implementation. I set SERCOM2 on Time Machine Mk. 8 by calling
pinPeripheral(4, PIO_SERCOM_ALT); // SDA: D4 / PA08 pinPeripheral(3, PIO_SERCOM_ALT); // SCL: D3 / PA09
, which worked fine for the LCD, but not for the LIS3DH accelerometer and BME680 temp sensor. After muck dicking around and googling, I found this GitHub issue, which led me to replace PIO_SERCOM_ALT with PIO_SERCOM, and voila, the accelerometer now works perfectly. So now my SERCOM setup code looks like this:
#include <Wire.h> #include "wiring_private.h" // pinPeripheral() function TwoWire wire1(&sercom2, 4, 3); // new Wire object to set up second I2C port on SERCOM 2 void setup() { Wire.begin(); wire1.begin(); pinPeripheral(4, PIO_SERCOM); // SDA: D4 / PA08 pinPeripheral(3, PIO_SERCOM); // SCL: D3 / PA09 }
This is incredibly exciting because TM8's accelerometer has many exciting potential applications, such as free-fall detection, tap detection, or even cornering grip analysis for track driving! I don't have the BME680 working yet but it should be cakewalk. Coupled with the BME680's altitude sensing, Time Machine Mk. 8 can even be a skydive computer!
I'll keep the project updates rolling