 It's me JP. Time for another episode of JP's product pick of the week. Thank you so much for joining here today First thing I will do is let you know where to go if you want to get a jump start on this thing head on over to That URL right there. It's product ID 5188 you can also use that QR code if you point your camera at it and do the thing That is the product page for this week's product pick and you can watch this show from inside of there we broadcast this very YouTube stream in fact from the product page and You can get a jump start on throwing it into your cart at a super great discount this week. It is 50% off Excuse me. It is 50% off. That was a little clear And you don't need a coupon code or anything like that if it's something you want throw it or up to ten of them in Your cart no resellers allowed And that price is going to be good until about a Few minutes after the show get a little bit of a grace period there But really the discount applies during the show and you'll get it for that price without a coupon code just buy it and I'll tell you what before I go any further about this This week's product pick actually is a revised version of a popular product of ours And I'm gonna jump back in time and have Lady Aida tell us about the original and then the updated versions So take it away lady Aida It's the precision real-time clock clock thing We're gonna be making a feather wing out of this as well. It's coming soon, but this is a little break out for the DS 3231 it's of high precision real-time clock What's neat about this is it has the crystal that normally would come with your real-time clock There's a little 32 kilohertz crystal. It's inside the chip and there's a temperature sensor and the temperature sensor Measures, you know, how the temperatures moved up and down and uses that to compensate the crystal so that It can keep time very very very very precisely. I think it's like two parts per million Precision something ridiculous. It's pretty much the most precise real-time clock. We've seen outside of like, you know A temperature compensated clock standard from like cell towers. I hope people always pick those up on eBay Those are totally awesome But if you want something that can fill in your breadboard on a coin cell, this is your best bet It's very small and cute and breadboard friendly. So If you make precision real-time This will work has a nice battery backup capability. It's all good Yeah We have breakouts for these RTCs before but these are now the stem of QT versions So you've got to we've got this which is the DS 3231 which is a high precision Temperature compensated crystal real-time clock. This is kind of like the finest of the fine This is like the truffle of RTC. See this is how we tie it together high quality RTC Over I squared C on the back. There's a coin battery holder And then if you're like, well, you know, I don't want that I'm okay with truffle oil Which doesn't actually contain truffles the PCF 85 23. I think they perfectly find real-time clock Great for data logging. Maybe not for clocks, you know, just because it will lose a few seconds Second or two a day compared to the DS 3231, but for many purposes that the PCF is is perfectly fine Also has the coin battery holder on the back plugging in over I squared C Now coming with a stem of QT connectors It just makes it really easy to plug and play these into an existing System because it uses our I squared C connections do this You either one and you know, it's you can pick and choose right you can start with one and then decide you want higher precision or lower Switch over to the PCF. Of course We have Arduino and circuit Python code for both of these because they're just stem of QT versions of our existing breakout These are kind of my two favorite RTCs that the high quality and the budget quality both Yeah, that's right so here check it out there it is sitting right there look at that Delightful little breakout This is the product pick the week this week. It is the DS 32 31 Precision real-time clock breakout. This has I square C to communicate with your microcontroller It has a battery backup So it's always going to keep track of the time even when your project is powered down And it has the stem of QT connectors to make it plug-and-play with your microcontroller Projects it just couldn't get easier. This is the one you want if you are making clocks So first of all, let's jump over to the product page and check it out So there it is look at this today and today only this is I don't know Maybe one day we'll we'll make it this price again, but today very special today. It is 50% off That's right. It is $6.95 right now during the show only so throw some in your cart if you have any clock Aspirations maybe watches too if you want to make some big huge cyber watches but great for clocks it is a Temperature compensated crystal so the crystal is sitting there oscillating, but the temperature can change that oscillation So it has a temperature compensation So it can adjust the time that it's reporting based on any changes in Temperature, which is fantastic all it does is report back to your microcontroller a really nice Struct of the time or message of the time. So it's the date and the time I'll show you all of that in code in a second, but when you're working with it. It's really easy. We have an Arduino driver for it We have a circuit Python driver for it So you can plug and play with your project get those libraries and then with some sample code get up and running Really quickly to build your own clocks so how about First of all before I before I move on to that. Let's let's take a look at the product Learn guide so if you take a look from the project page and scroll down a little bit You'll get to this little learn section. You can see we have a couple of clock projects that use this and then we have the main Learn guide here. So there's a nice set of photos. You can see the back there. This uses a cr 1220 Coin cell just plop it in there and that will that will back up your time for a long long time You can Check out the pinouts on the pinout page here. You can see there's the previous version It's the same other than we've now got the nice convenient stem aqt. Also look at that neat I like this little cut out little notch that lady aida did on the board design. There's really snazzy looking It has the pins that you would expect both as I square C on stem aqt and on the main row in addition We also have the battery pin. So this is if you wanted to supply that power somewhere else We have the oscillator output. So there's a 32 kilohertz oscillator Output you could use for something else on the microcontroller. There's a square wave output Optionally, it's an interrupt and you can use that to read things on your microcontroller as well And then we have this pin. It's labeled as reset, but really one one of the It's not really a reset like a board reset but we can use it for is Measuring when we switch from main The in power to battery so you can have a sense that you've lost power and gone to battery backup in case you need to log that To be able to calculate any needs of changing a battery out at some point depending on your use if it's a remote thing You might want to get messages about that sort of thing So you can then take a look. We have the assembly page Which is really just if you're going to be soldering headers to it. Otherwise, it's just plug-and-play with the stem aqt There's a page here on Arduino usage with some sample wiring diagrams. So you can plug that together and Run the RTC Lib library and some sample code and then we also have a circuit python page against wiring diagrams for that Easiest way is going to be just plugging in stem aqt cables And then we have the library you want to get there. It's the DS 32 31 Library you can just use circ up to install that if you want and then we've got some examples of the code here So you can see actually we'll take a look at some of the code examples right here because they're nice and And simple what you do is import the board for pin definitions and you'll set up an I2C bus and then You will import the DS 32 31 library and then you can set up your clock object or your RTC object here on I2C and then if you want to find out the Date time you simply ask for this value DS 32 31 dot date time and that'll report it back with these Separate pieces of data. So you get the year the month the month day the hour minute second week day So Monday through Sunday year day one through three sixty five three sixty six depending on leaf years, I guess And then daylight savings. I don't think we use those last two in our in our library So I'll show you a practical example in a second, but here you can see Setting the time so DS 32 date time equals time and then struck time here was set to 2017 January 1st And this these times and days of the week. So I'm gonna now Jump to the practical example here. So let's go into My overhead cam view Right there and so what you can see here. I'm gonna go ahead and plug Unplug my oh, yeah, that was already unplugged. Okay, so I've got a feather under here with a stomach qt cable I'm gonna plug that stomach qt cable into my real-time clock just like so I'm just gonna hang it off of this Screw right here. So it stays put that's good enough And then I have this feather connected up to one of these nice sharp memory displays just because they look really good So I'm gonna try to set that into anti glare Angle mode there that should work and Let's plug this board in is that the power. Okay So you can see here It's gonna power up and then it is immediately gonna grab the time off of the chip So I set this chip yesterday while I was setting up this project with the time and it has just been sitting there continuously Running and calculating that time. So it just updated and now here. We are 113 and 30 seconds This is accurate to the second easily if you take a look in fact at my Computers web page there I have the NIST time up there. So these are at let's see in my time it's 113 and 50 when I switch over boom So we get nice accurate time. I don't have to worry about when I unplug this it keeps the time thanks to that little Button cell battery if I turn off this I've just unplugged this cable. You can see it's takes a little while for that display to fade Plug it back in when it restarts. It's gonna be lock step in time. So it should be at 113 sorry 114 and about 20 seconds when this thing starts back up and There we go 23 so looking at the code here, let me jump to My circuit Python code dot pi and Here are the key things so like we looked at before in the simple example on the learn guide page I'm importing the DS 32 31 library I'm setting up I square C and then I'm creating this object. I named it RTC here RTC object is the Adafruit DS 32 31 on I square C and then T is the variable I'm setting up for grabbing that date time message. So when I ask for T. It's just hey RTC give me the date time That we have a nice convenient day List here that we can use to to grab nice names You can see here at the top of my screen. I'm listing there Tuesday to 13 24. It's the Monthday year how we do it in the US And then this little section here is how we set it in the first place. So I only needed to do this once But what I did was set this to be true and then typed in the values I through trial and error found out it took me two seconds I think to when I hit save for it to to restart so I timed that looking at the NIST clock so I could nail it to the second and then we changed that back to False and resave this and that just means if the board resets or gets plugged It doesn't just keep resetting to that time. So that's something to watch for And then I'm doing some we'll take a look at these in the main loop, but I'm setting up some Labels on my display that show me the date in the time. So let's look at that in the main loop here You can see every time the loop runs. I grabbed the date time off of the chip I'm also doing some stuff to compensate for 24 hour time And making my year just be the last two digits And then this right here. I'm setting the scroll over this piece that prints up here to the both to my REPL and to the screen says and in fact hold on let me Reset that REPL so you can see that updating. So when I print that or print that to the screen, I'm grabbing this Uh From the format the days is based on that list there And asking the question of the real-time clock. What is the tm w day? That's the week day or day of the week What is time? month time month day and that nice year display, which is based on if you look over here the Tm Year and then I'm subtracting 2000 from that and then for the time we just ask for nice hour, which is tm hour minus 12 if it's past Past noon tm minute tm second. So Straightforward to ask for it. It just reports it back to you It does all the tricky stuff in the background of keeping that thing accurate for you and so that that is the Just slight adjustment. I did to the Example code in the learn guide and in the library written by lady aida. So you can go and grab that And coincidentally as I was working on this There was a guide published That uh, I'll bring up here. Noe Was working on Bring that up a really beautiful clock project. Look at that. So this uses a large seven segment display with four digits in it A sort of mid-century modern style 3d printed case There's a really nice use of the rotary encoder with the push button to be the interface for adjusting the time And on the inside there is our good friend the ds 32 31 precision real-time clock. So great Fortuitous timing pardon the pun that guide just came out just published today. You'll see more about that I think tomorrow on the 3d hangouts as well as on ask an engineer and maybe show and tell But this is if you take a look at the code very similar Stuff here written by lis doing some similar adjustments for the time, but also this has alarm Or if not alarm as dimming function, I'll let them talk more about it tomorrow, but Really cool clock project using this this very Real-time clock module right here So let's see what else any Questions in the chat let me Have a look over here by the way. I should say if you're wondering where the chat is you can head on over to our discord That's at aterfrew.it slash discord Or you can also hop into the youtube chat David ss says I got some flowers for Valentine's Day. You can see them back there I actually had to buy those for myself sadly, but I was taking some macro photos for a guide. So Uh, but I'll pretend. Yeah, I'll pretend they're Valentine's Day. How about that? So let's see Half half off for these boards is a steal so squid.jpg. You're right. It's a great price Any Other questions This display does look sharp. Look at that. I love that display Um Beautiful All right I think that covers it any other questions. Let me know Uh DJ Devon 3 asks how often would it really need to be resinked with something like an ntp sync? You know, that's a good question. I don't know. I uh, you know, it's not even losing a second a day According to lady aida there. You can check out Uh the datasheet if you head over to Uh the learn guide. There's a link On the pages here for downloads You can go both to the product page And to the datasheet So if you take a look at those, um, here's the product page for it And uh, they they say highly accurate. Um And I don't know I don't know what that means. So I don't I don't know what the uh Milliseconds a year you lose or what? Uh, let's see here it says Yeah, they they express parts per million accuracy plus minus two parts per million at zero To 40 degrees centigrade. I do not know how that uh how that Um translates to to time keeping so good question I will I'll at least follow up in the chat if I get an answer to that Um, but we'll we'll just say it is super super very very highly precisely accurate Technically speaking All right I think that is going to do it then so let me uh I'll keep that Clock down there and grab this Uh, don't forget you can go right there if you want to go and grab one just head to that QR code that url throw some in your cart the price is going to go back up after the show So this is the time to grab some if you want if you have any clock aspirations uh, so That right there is my product pick of the week this week It is the ds 32 31 precision real-time clock breakout with stemma qt For aid of fruit industries i'm john park and this has been jp's product pick of the week. I will see you next time Bye-bye