Updated with net 1.72 info
This commit is contained in:
Erik
2016-05-21 12:03:34 +02:00
parent c4b613d88c
commit ecea230a70

107
README.md
View File

@@ -1,5 +1,6 @@
================================================================================
DCF77 Analyzer / Clock DCF77 Analyzer / Clock
================================================================================
This sketch is free software; you can redistribute it and/or This sketch is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
@@ -31,9 +32,22 @@
August 2014 First version May 2014 First version
March 2016 - big overhaul... March 2016 - big overhaul...
Version 1.72
- Option: Use a cheap Ebay PIR detector to shut off selectable display's when no activity is detected.
The switch off delay can be set by the user to prevent the display shutting of if a person
is not moving but the display should be on.
- Now the display Night shut-down can be disabled by making both values 'POWERSAVINGOFFTIME'
and 'POWERSAVINGONTIME' zero.
- Fixed temperature display not shutting off at powersave mode.
- errorCounter display did not reset every hour so that's fixed
Version 1.71
- User option to reset temperature min/max memory at midnight
Version 1.7: Version 1.7:
- The resolution of the temperature display is improved: from 0.5 to 0.1 degrees Celsius - The resolution of the temperature display is improved: from 0.5 to 0.1 degrees Celsius
Because of the time the DS18B20 sensor needs to convert the temperature and to keep the code clean, Because of the time the DS18B20 sensor needs to convert the temperature and to keep the code clean,
@@ -45,7 +59,9 @@
and only turns ON when all 3 parity bits are OK. and only turns ON when all 3 parity bits are OK.
Version 1.6: Version 1.6:
- Changed temperature function to only calculate once per minute. Got strange errors before the change. - Changed temperature function to only calculate once per minute. Got strange errors before the change because
I used a delay of 100ms to give the DS18B20 sensor time to calculate the temperature. But the delay function is
a very bad idea in most c++ code so I finally got rid of it.
Version 1.5: Version 1.5:
- Complete overhaul of the scanSignal function and the rest of the code! My first attempt worked but could be improved... - Complete overhaul of the scanSignal function and the rest of the code! My first attempt worked but could be improved...
@@ -70,44 +86,77 @@
Short description: Short description:
Power On: Power On:
After power-on, first a LED test is performed. The LED's and displays lite up sequentially to keep the power consumption low. After power-on, first a LED test is performed. The LED's and displays lite up sequentially to keep the power consumption low.
Then the clock starts receiving DCF pulses and when a Minute Mark (2 seconds gap) is detected, the Minute Marker LED is lit Then the clock starts receiving DCF pulses and when a Minute Mark (2 seconds gap) is detected, the Minute Marker LED is lit
and the buffer counter is reset. The inner LED ring now will show the incoming DCF pulses which are also stored in the buffer. and the buffer counter is reset. The inner LED ring now will show the incoming DCF pulses which are also stored in the buffer.
At 3 moments during reception of data the parity DCF bits are checked to see if the data is valid. At 3 moments during reception of data the parity DCF bits are checked to see if the data is valid.
Valid data received: Valid data received:
When, at the end of the minute, after the Minute Mark is detected (BF (Buffer Full) LED is lit), all three parity bits are OK When, at the end of the minute, after the Minute Mark is detected (BF (Buffer Full) LED is lit), all three parity bits are OK
('DCF OK' LED is lit), the buffer information is used to extract time and date information. ('DCF OK' LED is lit), the buffer information is used to extract time and date information.
Then the RTC clock is updated ('RTC Synced' LED is lit) and the inner LED ring information is copied to the outer LED ring. Then the RTC clock is updated ('RTC Synced' LED is lit) and the inner LED ring information is copied to the outer LED ring.
The time, date and week display, day LED, summer/wintertime and leap year LED information is updated with the new time information. The time, date and week display, day LED, summer/wintertime and leap year LED information is updated with the new time information.
No valid data: No valid data:
When one or more of the parity bits are not OK because of a noisy signal, receiving of DCF information is continued but When one or more of the parity bits are not OK because of a noisy signal, receiving of DCF information is continued but
will not be used to update the RTC, display's and LED's. The outer LED ring, 'RTC synced' and 'DCF OK' LED's will be reset. will not be used to update the RTC, display's and LED's. The outer LED ring, 'RTC synced' and 'DCF OK' LED's will be reset.
Time, date, week, day LED, summer/wintertime LED and leap year LED are not affected and keep displaying the last received valid values. Time, date, week, day LED, summer/wintertime LED and leap year LED are not affected and keep displaying the last received valid values.
The 'Period Time' and/or 'Period With' error LED's will indicate the error(s) and the error counter display is updated. The 'Period Time' and/or 'Period With' error LED's will indicate the error(s) and the error counter display is updated.
Every hour, the error display will bet set to zero. Every hour, the error display will bet set to zero.
The EoB, End of Buffer LED is lit when more DCF pulses are received before the Minute Mark is detected due to a noisy signal. The EoB, End of Buffer LED is lit when more DCF pulses are received before the Minute Mark is detected due to a noisy signal.
(When a minute Mark is detected we should have no more than 58 bits/pulses) (When a minute Mark is detected we should have no more than 58 bits/pulses)
After the detection of the Minute Marker, a new cycle is started. After the detection of the Minute Marker, a new cycle is started.
Temperature: Temperature:
At the 30 second mark, the temperature display will show the High and Low values of the past period after the last reset. At the 30 second mark, the temperature display will show the High and Low values of the past period after the last reset.
Chime: Chime:
At the beginning of each hour, the Chime (if connected) will sound. At the beginning of each hour, the Chime (if connected) will sound.
At night time, a time set by the user in the code itself, the chime is disabled. At night time, a time set by the user in the code itself, the chime is disabled.
Power saving: Power saving, two options:
At times set by the user, the displays are shutt off at night and turned on in the morning. 1. NIGHT SHUT OFF
Look at the POWERSAVINGOFFTIME and POWERSAVINGONTIME variables. At times set by the user, the displays are shutt off at night and turned on in the morning.
Check the function <tasksEveryHour> to select which displays you want to shut off at night. Look at the POWERSAVINGOFFTIME and POWERSAVINGONTIME variables.
Check the function <turnDisplaysOff> to select which displays you want to shut off at night.
2. PIR SENSOR
Connect a PIR sensor and activate the PIR option POWERSAVE_BY_PIR and the the delay at PIR_DELAY_TIME.
Every time the PIR detector senses movement, a minute counter is reset but if no movement is detected
longer than the PIR_DELAY_TIME, the displays are shut off.
When movement occurs, the displays immediately switch on.
Note: as said before, the clock will function normally while the displays are shut off.
The only thing is you can't see it... ;)
DCF beep: DCF beep:
With a switch, connected to pin BUZZERPIN, you can hear the received DCF bits coming in. With a switch, connected to pin BUZZERPIN, you can hear the received DCF bits coming in.
The tone duration is equivalent to pulse width of the DCF bits, so either 100 or 200 ms. The tone duration is equivalent to pulse width of the DCF bits, so either 100 or 200 ms.
Miscelleanous: Miscelleanous:
When the RTC battery is empty or a connection fault is detected, the RTC Error LED is lit. When the RTC battery is empty or a connection fault is detected, the RTC Error LED is lit.
CREDITS:
I learned a lot from the work of Matthias Dalheimer and Thijs Elenbaas who made their own DCF77 decoders.
Without their work I would not have known where to start.
I ended up writing my own code (using bits and pieces of their ideas) so I could understand what is happening...
My code is far from efficient or advanced but it does work and I know what is going on.
* A big Thank You to Brett Oliver and Joop Tap for pointing out some errors!
Interesting websites:
- Brett Oliver : http://home.btconnect.com/brettoliver1/
- Joop Tap : http://www.jooptap.nl
- Thijs Ellenbaas : http://thijs.elenbaas.net/2012/04/arduino-dcf77-radio-clock-receiver-hardware-2/
- Mathias Dalheimer : https://github.com/roddi/DCF77-Arduino/blob/master/DCF77Servoclock/DCF77.h
- DCF77 wikipedia : https://en.wikipedia.org/wiki/DCF77
- Much more DCF77 info : http://www.picbasic.nl/indexes_uk.htm
- My Flickr website : https://www.flickr.com/photos/edr1924/albums
- My Github website : https://github.com/deruiter
- The Instructables website for this clock: soon!
*/