Time Cuboid

2020-Apr-28, Tuesday 08:20 pm
I find myself, like many of us, sitting at my desk a lot. I sit there for work. I sit there again for the many video and/or voice socials that have been set up. I sit there to play games or watch films. I even clear off the computer stuff and sit there to solder and work on projects. I am, in fact, sitting there now as I write this. So basically, I sit there a lot. And it got so that I found it difficult to know what time it was, whether early or late, start of the day, or end. I know, I thought, possibly aloud, no-one will ever know, I need a clock.

But I didn't want to go buying lots of unnecessary things, or wait until my usual suppliers were back in full swing. So I dug around in the piles of boxes that comprise my electronics stash. Back at GaelHack (seven years ago) I started on a clock, but it never left the breadboard. I dusted that off, and found most of what else I needed.

Making it all fit together )

Given the purpose of the device, and age of most of the components, I had half a mind to refer to this as a Time Capsule, but Time Cuboid seems more self-explanatory.
Overall it looks something like this;



Time Cuboid, on
Photo by [personal profile] chebe

The first GaelHack took place a couple of weeks ago, the weekend of Friday 7th to Sunday 9th of June. It was a nice way to start a new tradition, with about twenty people from all over Ireland attending. (I think all but two of the hackerspaces were represented.) It was held on a scorcher of a weekend, in a boarding-school-converted-into-Scouts-Centre, with the option of camping or boarding in the hostel like rooms.

We took over a large room with a bunch of tables and chairs, set up the projector, and got started. There were a few presentations, a couple of hands-on workshops, and a few excursions out-of-doors into the beautiful sunshine to play with aerials and satellites. And to get the occasional ice-cream. In some ways the location was ideal (sunshine, quiet, facilities), but it did lack in some respects (insufficient internet, barely any phone signal, children everywhere). It was definitely a good start though, and at the end there was a great discussion, with people from different hackerspaces volunteering to look around their own localities for alternatives. I'm looking forward to next years. (There's a very thorough write-up by another attendee on the way, I'll link to it here when it's live. *EDIT* link)

Throughout the activities, in spare cycles, we worked on our own projects. It struck me how awkward Ardunio can be when you don't have an awful lot of internet to go looking for, and downloading, documents, tutorials, and libraries. But I persevered, emboldened by fellow attendees reminding me that there is almost always a library out there already. I got started learning to use I2C, real-time-clocks, and seven-segment-displays. Obviously I built a clock. This is the first step towards something else, but let's not get ahead of ourselves.

Arduino Uno, (you can ignore the MicroSD-shield, it's not doing anything here,) Sparkfun Real Time Clock Module, Adafruit 4-digit 7-segment display. The display requires you to install two libraries details here, and even though I'm using the Sparkfun RTC it uses the same chip as the Adafruit one, and Adafruit provide a library here.

The only gotcha that I ran into is that the RTC time is not set, and it is not running when you get it. (It also needs to be hooked up to 5V, otherwise when you query it you get a nonsense response.) To set the time to the time on your computer there's a section in the Adafruit example setup().
  if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));
  }

By default it doesn't execute. I had to remove the not to get it to run, i.e.
  if (RTC.isrunning()) {


You only need dto do this whenever you want to change the time, so ideally just the once. After that I just played around with the display, and got the colon blinking like commercial digital clocks.

Photo and video )