All Projects → thijse → Arduino-DCF77

thijse / Arduino-DCF77

Licence: LGPL-2.1 license
Efficient and complete DCF77 library for Arduino

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to Arduino-DCF77

Arduino-Blinkenlight
Non-blocking blinking patterns and smooth fade effects for your LEDs.
Stars: ✭ 26 (+4%)
Mutual labels:  arduino-library
Arduino-Log
Simple application log library. supporting multiple log levels, custom output & flash memory support.
Stars: ✭ 132 (+428%)
Mutual labels:  arduino-library
Seeed Arduino FreeRTOS
This library gives an example of how to get FreeRTOS running on Seeed production. The project can be used as a template to build your projects off of as well.
Stars: ✭ 27 (+8%)
Mutual labels:  arduino-library
MouseTo
Arduino library for moving mouse pointer to absolute screen coordinates
Stars: ✭ 47 (+88%)
Mutual labels:  arduino-library
FastPID
A fast, integer based PID controller suitable for Arduino.
Stars: ✭ 112 (+348%)
Mutual labels:  arduino-library
BME680
Arduino Library to access the Bosch BME680 - temperature, pressure, humidity and gas sensor
Stars: ✭ 30 (+20%)
Mutual labels:  arduino-library
arduino-google-maps-api
An Arduino library for communicating with the Google Maps Api
Stars: ✭ 42 (+68%)
Mutual labels:  arduino-library
ublox
Arduino and CMake library for communicating with uBlox GPS receivers.
Stars: ✭ 89 (+256%)
Mutual labels:  arduino-library
Adafruit DAP
port of free-DAP to standalone arduino
Stars: ✭ 63 (+152%)
Mutual labels:  arduino-library
ADS1115 WE
An Arduino library for the 16-bit, 4 channel ADS1115 ADC. Convenient to use. All features of the ADS1115 are implemented, including alert functions.
Stars: ✭ 39 (+56%)
Mutual labels:  arduino-library
modbus-esp8266
Most complete Modbus library for Arduino. A library that allows your Arduino board to communicate via Modbus protocol, acting as a master, slave or both. Supports network transport (Modbus TCP) and Serial line/RS-485 (Modbus RTU). Supports Modbus TCP Security for ESP8266/ESP32.
Stars: ✭ 332 (+1228%)
Mutual labels:  arduino-library
T-BOTS
Software for controlling and analysing T-Bots (Balancing robots)
Stars: ✭ 21 (-16%)
Mutual labels:  arduino-library
Seeed Arduino AS5600
The library comes with AS5600. Through this library, we can realize read the angles 、get magnetic from a magnet underneath the sensor.
Stars: ✭ 59 (+136%)
Mutual labels:  arduino-library
SparkFun Micro OLED Arduino Library
Arduino library for the SparkFun Micro OLED - a breakout board for a monochrome, 0.66", 64x48 OLED display.
Stars: ✭ 72 (+188%)
Mutual labels:  arduino-library
Adafruit EPD
e-paper display driver for Arduino
Stars: ✭ 92 (+268%)
Mutual labels:  arduino-library
SevSeg
Seven Segment library for Arduino
Stars: ✭ 75 (+200%)
Mutual labels:  arduino-library
sqlite micro logger arduino
Fast and Lean Sqlite database logger for Microcontrollers
Stars: ✭ 128 (+412%)
Mutual labels:  arduino-library
NvTx
Transactional non volatile storage for Arduino
Stars: ✭ 17 (-32%)
Mutual labels:  arduino-library
bme280
Arduino and CMake library for communicating with the Bosch Sensortec BME280 environmental sensor.
Stars: ✭ 21 (-16%)
Mutual labels:  arduino-library
DHT12 sensor library
DHT12 complete library (Original DHT clone library with same command and some addiction). I2c and OneWire support, connection schema of Arduino UNO, esp32 and esp8266 with examples.
Stars: ✭ 22 (-12%)
Mutual labels:  arduino-library

Arduino DCF77 library

Build Status License: LGPL v21

The DCF77 library adds the ability to read and decode the atomic time broadcasted by the DCF77 radiostation. It has been designed to work in conjunction with the Arduino Time library and allows a sketch to get the precise CET time and date as a standard C time_t. The DCF77 Library download. Example sketches have been added to

  1. illustrate and debug the incoming signal
  2. use the library, using the setSyncProvider callback and converting to different time zones. In order to exploit all features in the library, Both the Time and TimeZone library are included.

Additional documentation and full explanations of the samples can be found in these blog posts on DCF Hardware, DCF Signal can be found here: http://thijs.elenbaas.net/2012/04/arduino-dcf77-radio-clock-receiver-library/

Downloading

This package can be downloaded in different manners

  1. Go to https://github.com/thijse/Arduino-DCF77
  2. Click the DOWNLOAD ZIP button in the panel on the
  3. Rename the uncompressed folder Arduino-DCF77-master to DCF77.
  4. You may need to create the libraries subfolder if its your first library.
  5. Place the DCF77 library folder in your arduinosketchfolder/libraries/ folder.
  6. Restart the IDE.
  7. For more information, read this extended manual
  • If you want to have a package that includes all referenced libraries, use the pre-packaged library
  1. Download the package as a zipfile here or as a tarball here .
  2. Copy the folders inside the libraries folder to you your arduinosketchfolder/libraries/ folder.
  3. Restart the IDE.
  4. For more information, read this extended manual

##Samples

The DCF77 directory contains some examples:

DCFSignal.pde

This is the most basic example: it shows the raw signal coming from the DCF decoder. It will show Pulse-to-Pulse times of approximately 1000 ms and pulse widths of approx 100ms and 200ms.

DCFPulseLength

This example illustrates the pulse-to-pulse time and pulse lengths coming from the DCF decoder. While the DCF specification says that pulses should be either 100 or 200 ms, you will probably see longer pulse lengths. For optimal distinction between long and short pulses use the output of this sketch to set the parameter #define DCFSplitTime in DCF77.h to (Tshort+Tlong)/2.

DCFBinaryStream

This example shows the binary stream generated by the pulse train coming from the DCF decoder and the resulting CET time.

InternalClockSync

This is the probably the most important example: It shows how to fetch a DCF77 time and synchronize the internal Arduino clock.

SyncProvider

This sketch shows how to fetch a DCF77 time and synchronize the internal clock using the setSyncProvider function. Note that the loop code does not require any logic to maintain time sync. The Time library will monitor DC77 and sync the time as necessary.

TimeZones

This example shows how to convert the DCF77 time to a different timezone. It uses the UTC time to ensure that no ambiguities can exist. For timezone conversion it employs the TimeZone library.

*** Using the Library ***

To use the library, first download the DCF77 library here: https://github.com/thijse/Arduino-Libraries/downloads and install it in the Arduino Library folder. For a tutorial on how to install new libraries for use with the Arduino development environment please refer to http://www.arduino.cc/en/Reference/Libraries or follow this step-by-step how-to article on installing Arduino libraries: http://thijs.elenbaas.net/2012/07/installing-an-arduino-library

If the library is installed at the correct location, you can find the examples discussed in this and the previous post under Examples > DCF77. I also added the time library to the archive for convenience.

The DCFF77 directory contains the DCFF77 library and some example sketches

  • DCFSignal.pde

    This is the most basic example: it shows the raw signal coming from the DCF decoder. It will show Pulse-to-Pulse times of approximately 1000 ms and pulse widths of approx 100ms and 200ms.

  • DCFPulseLength.pde

    This example illustrates the pulse-to-pulse time and pulse lengths coming from the DCF decoder. While the DCF specification says that pulses should be either 100 or 200 ms, you will probably see longer pulse lengths. For optimal distinction between long and short pulses use the output of this sketch to set the parameter #define DCFSplitTime in DCF77.h to (Tshort+Tlong)/2.

  • DCFBinaryStream.pde

    This example shows the binary stream generated by the pulse train coming from the DCF decoder and the resulting CET time.

  • InternalClockSync.pde

    This is the probably the most important example: It shows how to fetch a DCF77 time and synchronize the internal Arduino clock.

  • SyncProvider.pde

    This sketch shows how to fetch a DCF77 time and synchronize the internal clock using the setSyncProvider function. Note that the loop code does not require any logic to maintain time sync. The Time library will monitor DC77 and sync the time as necessary.

  • TimeZones.pde

    This example shows how to convert the DCF77 time to a different timezone. It uses the UTC time to ensure that no ambiguities can exist. For timezone conversion it employs the TimeZone library.

Example sketch

The sketch below implements the most DCF77 basic functionality. It reads the signal from pin 2, and 2-3 minutes it will update the internal clock. More information on this example can be found here:

http://thijs.elenbaas.net/2012/04/arduino-dcf77-radio-clock-receiver-library/

#include "DCF77.h"
#include "TimeLib.h"

#define DCF_PIN 2// Connection pin to DCF 77 device
#define DCF_INTERRUPT 0  // Interrupt number associated with pin

time_t time;
DCF77 DCF = DCF77(DCF_PIN,DCF_INTERRUPT);

void setup() {
  Serial.begin(9600);
  DCF.Start();
  Serial.println("Waiting for DCF77 time ... ");
  Serial.println("It will take at least 2 minutes before a first time update.");
}

void loop() {
  delay(1000);
  time_t DCFtime = DCF.getTime(); // Check if new DCF77 time is available
  if (DCFtime!=0)
  {
Serial.println("Time is updated");
setTime(DCFtime);
  }
  digitalClockDisplay();  
}

void digitalClockDisplay(){
  // digital clock display of the time
  Serial.print(hour());
  printDigits(minute());
  printDigits(second());
  Serial.print(" ");
  Serial.print(day());
  Serial.print(" ");
  Serial.print(month());
  Serial.print(" ");
  Serial.print(year());
  Serial.println();
}

void printDigits(int digits){
  // utility function for digital clock display: prints preceding colon and leading 0
  Serial.print(":");
  if(digits < 10)
Serial.print('0');
  Serial.print(digits);
}

On using and modifying libraries

Copyright

DCF77 is provided Copyright © 2013-2017 under LGPL License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].