Building An Arduino Clock

About two and a half years ago, Rich got me an Arduino clock shield for my birthday.

I opened the box, took one look at it, felt intimidated by the tiny PCB and promptly stuck it on a shelf in my closet until... now. I just didn't think I'd be able to see well enough to build it. Then I got all intimidated by it and didn't even try. :(

I came across it again the other night and decided that it wasn't doing me any good on the shelf and even if I tried to build it and screwed it up, I was no worse off.

So today I grabbed my soldering iron and my magnifier and got to work. For such a tiny board, there are a fair number of components.

I got to work soldering the resistors first and... I got as far as the 2nd one before making my first mistake. It seems the resistor had slipped a little when I turned the board over to solder it and I didn't realize it until it was too late... Oops.

Fortunately, I recently bought a better desoldering tool. I didn't want to spend $150+ for fancy one, but I wanted something heated and preferably not with a squeeze bulb. I found this Vellman heated desoldering tool for about $15.

For its price, it's great! With a little effort, I was able to get the resistor out and the hole nice and clean.

Ah, that's better.

It's a good thing I've got this thing, though, because sometimes my lack of depth perception means I do things like.... miss the pins entirely? Apparently so. Wrong hole! Wrong hole!

Ugh.. my eyeball was frustrating me on this one, but I once again got it cleaned up.

Finally got all of those resistors in place. Yeah, I know, some of them got flipped around and it doesn't look consistent, but since they're not polarized, I decided not to care.

LEDs next!

It was at this point that I realized that the printed instruction sheet was all kinds of wrong. I found a PDF online, but it was for a newer version. Fortunately, the placement of the button capacitors was the same (they came in two sizes) and the rest was easy to figure out based on the labels on the PCB.

You get the idea. Let's draw the rest of the owl. There are a couple of ICs and a battery holder and sockets and more goodies under that big LCD.

You can see that one of the buttons is melted a bit there on the right. That's because I had to desolder and replace all of those stacking headers. I'd put them in upside down initially and they weren't long enough to make good contact with the Arduino board... Again. Ugh. I blame this on my lack of experience and the misprinted instructions, which showed them oriented incorrectly.

Fortunately, I had more header pins, so I didn't even try saving the old ones. That would have been a pain. It was late and that was 28 solder joints to desolder and then solder again.

Then it was time to program!

I plugged the board in. I'm always a little nervous doing this for fear that I've shorted something on the board and am about to fry my Macbook, but I gave the board a good once-over at 20x magnification and it looked ok, so... ¯\_(ツ)_/¯. Next, I ran through the hardware test sketch provided by the company.... and everything worked! Huzzah!

Then I tried uploading the sample clock sketch. It very much did not work. The temperature sensor worked. Display brightness worked. Nothing else worked right and the software on the board would frequently lock up. I updated libraries... nope.

Then I reminded myself that this thing was 2.5 years old and downgraded libraries. Still nope.

Frustrating... I began scouring Google and found another sample sketch. It actually worked. It didn't do everything I wanted, but it worked like it was supposed to. I then spent a little time dissecting code from the non-functional sketch and porting over some of that functionality to the new sketch.

In the end, I had a working digital clock!

Not only is it a clock, it also displays the temperature, can display the date and day of the week, and can auto-adjust LCD brightness based on ambient light. I ended up turning that off, though, because it was annoying. I mostly just wanted to see if I could get it working. In the end, I mapped LCD brightness to buttons in another settings mode, instead, so the light sensor isn't actually being used.

Interestingly (and annoyingly), it has weird manic episodes if I try and run it off of the 5v DC jack and not USB power. I don't know if this is a hardware issue or a software one, and I'm not sure I care enough to worry about it. I'll just get a longer USB male A to male B cord (the one I have is about a foot long) and use one of my countless USB plugs. I tested it, plugged in via USB to the wall and not the computer, and it worked fine.

I intend to use this clock now that it's built. I have plans to build a fancy housing for it. I'll probably post about that in a day or two.

I also may go back and add a stopwatch and/or a timer.

Hey! I'm designing a board game.

I'm working on a lightweight sci-fi area control game for 2-4 players called These New Worlds. Follow the link below to learn more.

I Want Updates & Stuff!