
Les points à développer :
C’est quoi le DS3231 ?
Le DS3231 est une horloge temps réel I2C extrêmement précise avec un oscillateur à quartz compensé en température (TCXO) et un cristal. La fonction DS3231 avec un VCC allant de 2.3V à 5.5V. Comparé au DS1307, le DS3231 est doté d’un cristal intégré, d’un capteur de température, de 2 alarmes d’heure programmables, d’une broche de sortie de 32,768 kHz pour assurer une plus grande précision.

Câblage avec Arduino
Le câblage est très simple :

Le simple code pour le test
Une librairie de ce type d’horloge est à télécharger ici:
void setup()
{
Serial.begin(9600);
Clock.begin();
Serial.println();
Serial.println();
}
void loop()
{
// Create a variable to hold the data
DateTime MyTimestamp;
// Load it with the date and time you want to set, for example
// Saturday the 3rd of October 2020 at 14:17 and 33 Seconds…
MyTimestamp.Day = 3;
MyTimestamp.Month = 10;
MyTimestamp.Year = 20;
MyTimestamp.Hour = 14;
MyTimestamp.Minute = 17;
MyTimestamp.Second = 33;
// Then write it to the clock
Clock.write(MyTimestamp);
// And use it, we will read it back for example…
Serial.print(« The time has been set to: « );
Clock.printTo(Serial);
Serial.println();
// Remember, once you set the time, the clock remembers it and keeps
// running even if you reset or turn off your Arduino, as long as
// the clock has battery power.
Serial.print(« End Of Program (RESET to run again) »);
while(1);
}
0.00 average based on 0 ratings
Course Features
- Duration : 10 week
- Max Students : 1000
- Enrolled : 0
- Assessments : Self