Hiya guys and welcome to a brand new instructable. At this time we’ll make a easy arduino watch utilizing DS3231 and Nokia 5110 Liquid crystal display. This watch will of-course present you time but additionally it’s going to additionally present date and temperature.
A lot of the tutorials on-line do not present how one can use a liquid crystal display apart from the 16*2 liquid crystal display with the RTC module. So I made a decision to make one tutorial with the 5110 Liquid crystal display.
Let’s transfer additional to see how one can make this watch.
Lecturers! Did you utilize this instructable in your classroom?
Add a Instructor Word to share the way you integrated it into your lesson.
Step 1: Issues You Want
I like to recommend UTSource.internet in case you are trying to purchase electronics elements and modules. They supply all electronics gadgets at reasonably priced charges. Additionally they present PCB design providers for PCB’s as much as 16 layers. Do test them out.
So the hardware we’d like is as follows –
three. DS3231 Module (RTC Module)
four. Nokia 5110 Liquid crystal display
5. Header wires
Libraries you want to set up for this undertaking to work –
1. Rtc by Makuna
2. DS3231 by Eric Ayars
You’ll be able to set up them instantly utilizing your Arduino Ide. In case you are unable to search out them, simply drop a remark under.
Word : With out these libraries the code will not compile and you’ll get errors.
Step 2: Circuit Diagram
I’ve hooked up a circuit diagram of the undertaking above.
Be sure to join all of the modules as proven above.
If you wish to see my different undertaking the place I created a Egg catching recreation utilizing the nokia liquid crystal display and joystick module
If you wish to make this undertaking transportable then simply add a lipo battery and a charging circuit and you’re good to go. I’m not but glad with this, so I’ll anticipate a while.
Step three: Code
The code for this undertaking is given under.
I’ve additionally included a .ino file which you’ll instantly open in your Arduino Ide.
DS3231 Clock; RtcDS3231 Rtc(Wire); Adafruit_PCD8544 show = Adafruit_PCD8544(13, 11, 5, four, three); void setup() Serial.start(9600); Serial.print(__DATE__); Serial.println(__TIME__); Rtc.Start(); RtcDateTime compiled = RtcDateTime(__DATE__, __TIME__); Serial.println(); if (!Rtc.IsDateTimeValid()) if (!Rtc.GetIsRunning()) RtcDateTime now = Rtc.GetDateTime(); if (now < compiled) Serial.println("RTC is older than compile time! (Updating DateTime)"); Rtc.SetDateTime(compiled); else if (now > compiled) else if (now == compiled) Serial.println("RTC is identical as compile time! (not anticipated however all is ok)"); Rtc.Allow32kHzPin(false); Rtc.SetSquareWavePin(DS3231SquareWavePin_ModeNone); show.start(); show.clearDisplay(); show.setContrast(60); show.setCursor(7,three); show.setTextSize(1); show.println("ENGINEER KID"); show.setCursor(35,15); show.println("DIY"); show.setCursor(23,25); show.println("ARDUINO"); show.setCursor(29,35); show.println("CLOCK"); show.show(); delay(1000); show.clearDisplay(); void loop() if (!Rtc.IsDateTimeValid()) RtcDateTime now = Rtc.GetDateTime(); printDateTime(now); #outline countof(a) (sizeof(a) / sizeof(a)) void printDateTime(const RtcDateTime& dt) char datestring; snprintf_P(datestring, countof(datestring),PSTR("%02u/%02u/%04u %02u:%02u:%02u"), dt.Month(), dt.Day(), dt.12 months(), dt.Hour(), dt.Minute(), dt.Second() ); Serial.print(datestring); show.setTextSize(2); show.setCursor(zero,zero); show.println("ARDUINO"); show.setTextSize(1); show.setCursor(zero,20); show.println("Date:"); show.setCursor(30,20); show.println(dt.Day()); show.setCursor(40,20); show.println("."); show.setCursor(44,20); show.println( dt.Month()); show.setCursor(54,20); show.println("."); show.setCursor(59,20); show.println( dt.12 months()); show.setCursor(zero,30); show.println("Time:"); show.setCursor(30,30); show.println(dt.Hour()); show.setCursor(41,30); show.println(":"); show.setCursor(46,30); show.println(dt.Minute()); show.setCursor(57,30); show.println(":"); show.setCursor(62,30); show.println(dt.Second()); show.setCursor(zero,40); show.println("TEMP:"); show.setCursor(30,40); show.println(Clock.getTemperature(), 2); show.setCursor(62,40); show.println("C"); show.show(); delay(5); show.clearDisplay();
You don’t want to set the date and time for the primary time to be able to configure the RTC module. The module will simply retailer the compile time as your current time so no have to add a separate code or remark any traces within the code.
Step four: Working Video of the Venture
Like all the time I’ve hooked up a working video of this undertaking under. Watch it to get an concept how this undertaking works.
Should you like my work then please share this instructable with your mates.
Additionally observe me to maintain a observe on the tasks I make.
That is it for at present. See you guys quickly with one other undertaking.
Be the First to Share