6/24/2023 0 Comments Rtc setdateUsing DS3231 Library created by Henning Karlsen DS3231 has internal pull-up resistors on SDA & SCL signals Displaying the day, date, time, and Unix time on the Serial Monitor Interface the DS3231 Real-Time Clock (RTC) to an Arduino Uno Make sure that the baud rate is set to 115200. The Serial Monitor will display the current day, date (DD.MM.YYYY), time (in a 24-hour format), and Unix time (number of seconds that have elapsed since 1 January 1970), as shown in the image below. Once you have initialized the original day, time, and date, comment out those three functions, and upload the new sketch. Input the current time and date as arguments to their respective functions, and upload the sketch to the Uno. To initialize the DS3231 with the date and time, we have to uncomment rtc.setDOW(), rtc.setTime(), and rtc.setDate(). Once the wiring is complete and the FuelCan is powered up, we can now load the sketch onto the Uno. Power up the FuelCan with the AC-DC power adapter.įor additional information about the Fuelcan-910, click here. Plug the Type A side of the USB cable into USB1 receptacle and the Type B side into the Uno’s receptacle. You will need two male header pins to mount the test-lead clips on the breadboard side. You’ll need to supply +5V and GND to the power and ground rails on the breadboard by using the provided banana jack to test-lead clip cables. If you are using a breadboard instead of Modulus, place the breadboard in the bottom storage compartment to limit the length of the jumper wires. If you haven’t mounted the Uno onto the prototyping area of the FuelCan, go ahead and do that. The only thing we have to change is one line of code, lcd.begin(20, 4), which specifies the columns (first argument) and rows (second argument) of the LCD. It also has the same 16-pin header, allowing you to unplug the 16x2 LCD and plug in the 20x4 without changing any wiring. Similar to the 16x2 that we've used in previous projects, the 20x4 LCD uses the Hitachi controller so the commands and interfaces are the same. The 20x4 LCD adds two extra rows and four extra columns per row compared to the 16x2 LCD. Time is running out, so let’s get started! We’ll cover three different examples where we send the data to the Serial Monitor, send the data to a 20×4 LCD, and turn on an LED on a certain day of the week. In this project, you’ll be learning how to interface a Real-Time Clock (RTC) to the Arduino Uno to acquire the time, date, day of the week, Unix time, and even temperature. Please visit for a complete list of materials for this project.
0 Comments
Leave a Reply. |