Skip to main content

Posts

Showing posts with the label espclock3

ESPCLOCK 3.1

Here are the latest changes to the ESPCLOCK3 project. Migration to PlatformIO I have moved to PlatformIO for new projects, and migrated some of my older projects to PlatformIO as well. PlatformIO offers a lot of advantages over the Arduino IDE, including: Intellisense quick info and code completion Easy to target specific library versions in platform.ini Easy to have multiple targets in the same project. For ESPCLOCK, this means target for ESP8266 and ATtiny85 in the same project. There are minor pitfalls though. For example, to set fuse settings for ATtiny85 (eg. 1MHz clock, retain EEPROM, disable BOD), they have to be manually computed and added to platform.ini . This was not very intuitive and took me some time to figure out. Dealing with low battery In the original design, the ATtiny85 checks the VCC voltage level and writes vital info to EEPROM when voltage falls below 2.8V.  The problem is, the discharge characteristics of NiMH battery is such that it operates at ~1.2V for mo...

Sweeping Analog Clock Analysis

The subject of this analysis is the $2 Ikea Stomma wall clock. Unlike the Rusch wall clock that had been the object of my experimentation all along, this clock uses a sweeping clock mechanism, which means the second hand appears to move continuously instead of every second. This also means it is quieter and does not produce the familiar tick-tock sound. Note: Both clocks appear to have been discontinued at the time of writing. There is only one $2 clock on sale at their website now, which is the Tromma clock . I don't particularly like this clock, because the second hand is missing, which makes it difficult to tell if the clock is working at any instant. The hacking process of the Stomma clock is quite similar to that of the Rusch clock , so no suprises there.  Remove front plastic cover Remove hour, minute and second hands Remove clock mechanism Open up clock mechanism. As before, keep the spindle side up helps keep the gear formation in one piece. Solder 2 wires to the solder p...

ESP-07 flashing issue on PlatformIO and solution

Recently, I decided to port the ESPClock project to PlatformIO , and kept encountering an intermittent error during flashing:  A fatal error occurred: Timed out waiting for packet header Took me a long time to research the issue and making no headway,  until I stumbled upon this rare gem . The file I needed to modify is:   C:\Users\<Username>\.platformio\packages\tool-esptoolpy\esptool.py I changed the values to:  DEFAULT_TIMEOUT = 100  START_FLASH_TIMEOUT = 40  CHIP_ERASE_TIMEOUT = 240  MD5_TIMEOUT_PER_MB = 8  ERASE_REGION_TIMEOUT_PER_MB = 60  DEFAULT_SERIAL_WRITE_TIMEOUT = 20 Originally, DEFAULT_TIMEOUT was set to 10. That made flashing the code reliable, but flashing the filesystem was still problematic. After increasing the value all the way to 100, I never encountered the error again. ESPCLOCK1  /  ESPCLOCK2  /  ESPCLOCK3  /  ESPCLOCK4

ESPCLOCK3 - The Final Version

Overview This is the latest, and probably final iteration of my ESPCLOCK project. You can find ESPCLOCK1 here , and ESPCLOCK2  here . The main differences between ESPCLOCK3 and ESPCLOCK2 are: Use barebones ESP-07 instead of WeMOS D1 Mini to reduce deep sleep power draw. Use  PCF8563 RTC to clock the ATtiny85. PCF8563 is chosen over the more popular DS3231 RTC  due its vastly lower power consumption. Using a RTC to clock the ATtiny85 allow us to use the POWER_DOWN instead of IDLE sleep mode, which minimizes power draw. As a result, the ATtiny85 code is also vastly simplified because we don't have to play with Timer1 to get an accurate 1Hz signal. Use diode clamp to limit the voltage pulsing the analog clock. Connecting to the analog clock directly using the ATtiny85 pins running at ~3V requires the clock pulse to be longer (~200ms) and increases power draw (due to reduced MCU sleep time). In addition, the higher voltage causes ticks to miss occasionally. Th...