motion55 / WWVB_Emulator_ESP32

2 stars 0 forks source link

NTP update intervals spoil watch synchronization #1

Closed Hamberthm closed 6 months ago

Hamberthm commented 7 months ago

Hi there! Thank you so much for the code, I'm integrating it into a weather station so I can synchronize a G-Shock Rangeman outside of the US.

The code seems to work, I got success a couple of times, but half the time the watch doesn't like it for some reason and throws an error.

I'm suspecting on the NTP update cycle, as it can happen during the watch sync process. A couple of questions:

Thanks!

Hamberthm commented 6 months ago

Solved it. It wasn't the NTP update.

Casio watches are very picky about the standard, and that is the original WWVB radio station doesn't turn off the carrier completely when signaling a low level, it goes down to about 15%. So these watches won't accept the sync signal as valid unless they detect a continuous carrier presence, even on the low marks.

To solve this, I installed a voltage divider between the antenna and a GPIO pin, using a 100 Ohm resistor as R1 and 10 Ohm resistor as R2. When R2 is pulled down, signal level is dropped to about 0.3V. R2 sink could be any GPIO configured as Open Drain Output, so it simply offers high impedance when set as HIGH and a current drain to ground when LOW.

Code modifications include defining the STOP as:

#define STOP_60KHZ digitalWrite(27, LOW);

and

#define START_60KHZ                     \

  {                                     \
    digitalWrite(27, HIGH);             \
    ledc_channel.duty = 1;              \
    ledc_channel_config(&ledc_channel); \
  }

And adding the setup line to the setup() function:

pinMode(27, OUTPUT_OPEN_DRAIN);

27 being the PIN I'm using as sink, could be any pin as it's configurable as Open Drain.

Whit this modifications I got a G-Shock Rangeman with a 3410 module updating OK.

Cheers!