Skip to content

Driver for DCF77 radio controlled clock#1911

Merged
openshwprojects merged 9 commits intoopenshwprojects:mainfrom
MaxineMuster:_DCF77
Mar 20, 2026
Merged

Driver for DCF77 radio controlled clock#1911
openshwprojects merged 9 commits intoopenshwprojects:mainfrom
MaxineMuster:_DCF77

Conversation

@MaxineMuster
Copy link
Copy Markdown
Contributor

@MaxineMuster MaxineMuster commented Dec 19, 2025

Quite common in Germany are Radio Controlled Clocks, using the DCF77 broadcasted time signal as time source.
Bildschirmfoto vom 2025-12-19 19-07-30
Since we now have a flexible clock, we can use this as clock source, too.

Starting with "startdriver DCF77"
optional arguments are
"fall" per default, a rising edge will mark the "bits", if you need a falling edge (e.g. if using a opto-isolator), use this argument
"httpstat" add some details from driver on main page
Bildschirmfoto vom 2025-12-19 19-25-45

Arguments to "tune" reception (usually "0" is 100ms, "1" is 200 ms - you can change the "breaking" point with the below values (actual code uses 180 as default for both values)
"end0=X" set max duration of 0 bit to X ms
"start1=X" set min duration of 1 bit to X ms

This is some debug output:

Bildschirmfoto vom 2025-12-19 18-09-33

It might also be used with an opto-isolator for devices with main on the IO pins:

This is my test with a BK7231N switch (powered by a PoE power supply with 48V) and the receiver input on the "switch" (since opto coupler inverts the signal, I used it with "fall" argument). I'm using a common PC-817 and a 220 ohm resistor for 3.3V for DCF77 device:

IMG_20251219_182545202~2

MaxineMuster and others added 8 commits December 19, 2025 18:36
Added missing "CHANGE" interrupt (rising and falling) for LN882H, W600/W800 and ESP (not yet tested)

Moved code from ISR to QuickTick funktion (else LN882H would crash)

Tested to work with

W800 ("CHANGE")
BL602 ("RISING" and "FALLING")
LN882H (both "CHANGE" and "RISING"/"FALLING" tested)
for testing at least compilation, added "#define ENABLE_DRIVER_DCF77	1" for more platforms ...
…ne in QuickTick function

No need for Rising/falling edge definition, driver ony searches for "bit" gaps (100 or 200 ms) and ignore the "in between" gap to the next bit.
Therefore no need to know, if rising or falling edge starts the bit.
@MaxineMuster
Copy link
Copy Markdown
Contributor Author

MaxineMuster commented Mar 16, 2026

Updated code.

Changed from own "IORole" to giving pin as argument:

startDriver DCF77 <pin> ...

Further optional arguments are

  • "fall" per default, a rising edge will mark the "bits",
        if you need a falling edge (e.g. if using an opto-isolator), use this argument
  • "httpstat"     add some details from driver on main page
  • "end0=<value>"  set max duration of 0 bit to <value> ms
  • "start1=<value>"  set min duration of 1 bit to <value> ms
grafik

@openshwprojects openshwprojects merged commit 96cdd10 into openshwprojects:main Mar 20, 2026
63 checks passed
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.18.278 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants