Timer that shows how long have me and my gf been together

I would like to make a arduino project that counts how long have we been together, just like some of the apps on the phone that shows something like 1Y/2M/3D (1 year, 2 months, 3 days) but portable keychain sized, size of an usb stick.

Was thinking about using this (OLED 128x32 IIC SSD1306) kind of display and probably a pro micro for that, the rest i need help with and dont know what components to use or how to code the display.

The whole project should be portable usb sized and when the button is pressed it turns on and shows for x ammount of time how long we've been together for.
Seems simple but dont know anything.

1 Like

The next thing to sort out after the display and processor is power to the device. Will it be rechargeable, for instance ?

1 Like

Yes probably a small rechargeable battery, thinking of small lithium ion ones.

But what can i use to track how many days it is, some type of timer module or connected to wifi somehow, etc.

1 Like

Just don’t spend so much time on it that the GF decides to move on. :expressionless:

a7

1 Like

Convert the time you started 'being together' into Epoch Time. https://www.epochconverter.com

Get the current "Epoch Time" from your RTC chip.

Subtract to get elapsed seconds.

Convert seconds into minutes, hours, days...
"months" and "years" are a little problematic since they aren't al the same size. You could probably just use 365.25 days per year and be close enough.

3 Likes

Start the clock at -0/-1/0…
Everything after 0/0/0 is good.

For RTC chip, do i use only the chip because i see i can buy only the RTC chip or the RTC chip module like this one and also this one, which are a bit different i see but dont know anything about RTC chips or modules.

Also i assume it's pretty easy wireing everything up, what about the codeing part with arduino IDE?

I dont think i understand what you are saying by starting the clock at -0...

Not in a package the size of a memory key...

Starting at .(-1 month), means everything after 0/0/0 is good, it means you’re still together.

2 Likes

I’ve used that first RTC that you linked. I also got this one

which must be better as it is terribly more expensive. All kidding aside, there is some risk on buying these very cheap modules. I’ve never had a problem with them, but I have not looked to see if they are less accurate or otherwise inferior.

Def go with a module… if you value your time at all. It solves many problems you don’t need to worry about.

The first module you linked may have an issue with the battery charging circuit, so before you put in the coin cell, google for the problem, see if it applies and do the recommended fix (de solder or crush a surface mount diode I think).

a7

2 Likes

you can get samd21 based board, it has RTC on board, for example a small round wearable and round screen like here

2 Likes

So that samd21 wearable circuit board, is it mora like a rtc module with display or just different display module?

samd21 board us just a board, it has RTC built in, the round LCD is just LCD, you will need both. This is just an idea, there are many products you can choose from, proper planning is the first step

Use the DS3231 clock , if you think you’ll be together for a while it’s more accurate .

Hh i see now, but now i have a different problem.
Lots of youtube videos have done simular thing but to show real time (a clock), so i cant just look it up and do what they did as i dont know anything about programming arduino, dont even know which arduino to use.

Was thinking about using that one, problem is programming all of that.

Oh and also one more thing, how big of a battery capacity would i need to power all of that?

If you know so little, this project is too complex for you to aim for a final product the first time. You should experiment with some easier components and make some simpler (and larger) prototypes so you aren't struggling with miniaturization, oddball displays, and power issues at the same time you are trying to learn to code.

Actualy yes i changed plan to make it stationary for it to be on a desk, hardware part and connecting is easy, now im struggling with codeing it.

I also found this post which is very usefull and it is basicly the same but im using RTC ds3231 (not ds1307) and i have an OLED display (not lcd 7seg display). Also, in this post there is another realy useful post mentioned.

This code could be good but idk how to put that on display, like what parts and how to print it on OLED, this code shows in years, months and days how old somebody is. If i put our date when we started dating it should do the trick hopefuly, but again, problem is displaying it.

#include "RTClib.h"
RTC_DS3231 rtc; // Using DS3231 Real Time Clock 
DateTime now = rtc.now(); // Current Date and Time
DateTime dob = DateTime(1984,8,16,0,0,0); // Date of Birth (1984.08.16 00:00:00)
 
int t0 = dob.year() * 12 + dob.month() - 1;
int t = now.year() * 12 + now.month() - 1;
int dm = t - t0;
int Y;
int M;
int D;
 
//Calculate age in Y/M/D
if(now.day() >= dob.day()){
  Y = floor(dm/12);
  M = dm % 12;
  D = now.day() - dob.day();
}
else {
  dm--;
  t--;
  Y = floor(dm/12);
  M = dm % 12;
  DateTime tmp = DateTime(floor(t/12),(t%12)+1,dob.day(),0,0,0);
  D = (now.unixtime() - tmp.unixtime())/60/60/24;
}

That is because you are attempting to program by cutting and pasting together bits of different programs that you don't understand. Doesn't that seem like an inherently flawed approach?

Have you yet successfully implemented any small part of this project, by itself? For example, just the clock time via serial? Displaying values, using examples from the display library as a guide? Good display libraries are fully documented. Most of them are, because they need a lot of different functions so nobody could use them at all, otherwise.

Your request for help lacks definition, your problem "is displaying it" but we can't tell why, you didn't say...