20/1/2018: If you can’t find one you like then build one!
My current usual £20 quid type clock has always frustrated me due to its lack of control over its behavior. A couple of examples are its brightness and insistence on beeping whenever I press a button. Both these annoy my Wife and hence make my life harder than it should be. The other day it seized up on me requiring the batteries and power removing to get it going again.
So, time for something anew I think. After a long web search and Amazon trawl there was nothing that tickled my fancy even including the designer brands. So, can’t buy it – make it. I feel an instructable coming up sometime.
What does it need to do in an ideal world?
- Set the time using MSF with a manual option if it is not available
- Multiple alarms possibly with a calendar. Who wants to get up early at the weekend if you don’t have too
- Proximity setting of the backlight possibly with override
- Touchscreen
- Proximity snoozing of the alarm – just wave a hand like some sort of deity
- Battery and mains
- USB charger port would be good for my Kindle
There will be scope creep but this is a good start
28/1/2018: A long time ago in a land far away……. Nope, just the long time ago bit, I bought a 60Khz MSF aerial and accompanying circuitry which gives a nice high/low output ready for feeding into a micro like an Arduino. In truth I actually got it working on a PIC 16F84A well over a decade ago in 2002 but the code is in assembler and I have forgotten pretty much everything I ever knew about this so I am starting again.
Not being a great fan of reinventing the wheel and as there are lots of examples of this code in C already out there I liberated one of those and have got it working on my hardware. It came from a guy called Phil Morris. There is a lot very useful information on his page and is well worth a read. This is his code that I downloaded. I used the program that doesn’t have a dependency on a library because I am testing on an Arduino Uno but will port to a Due probably as that is the board I am using for my touch screen. I like to see what is happening in my code and separate it into different tabs in the development environment – old man syndrome I guess.
From his program I was able to output the following:
Start: 0202000000000000000001100000001101000000010011001010001313110 60 Seconds
It is Sun 28 Jan 2018 13:14 GMT and BST is not imminent
The first line of debug type code is his and the second shows the time and date I added. This was another thing I liked – there was no code for LCD’s or similar making it very ‘pure’, if you like, to understand.
The main problem I had was the reception from the receiver. It turns out there are very few areas in my house near the computer where I get a good signal. There was a clue here where the LED on the inverter circuit was blinking rapidly and sometimes appearing to glow. Breaking out the scope proved that this was a bit of a problem. If your scope output looks anything like the video below then you have some investigation/re-positioning to do. The two traces are just either side of the inverter circuit.
29/1/2018: This is how it should look:
This was filmed in the minute preceding 21:32 on the 29/01/20184. The start is about 5 seconds into the video. More interesting ‘bits’ are after the start, around the middle and just before the end.
28/2/2018: Well, an eventful February it turns out to have been for the alarm clock project. With the benefit of hindsight just making a digital version would have been a great idea, but no, I have to do things the hard way. I thought a nice analogue display would be great with an area of the screen on one side for more digital type information. After a lot of programming and blind alleys it turns out that pixel poking on this screen is a pretty slow process and repainting the background image once the hand has passed particularly challenging. This latter point is still a work in progress but I have a plan. Other problems are because the Arm based chip doesn’t seem to speak i2c in the same way as an Arduino Uno. Cet la vie
21/4/2018: Here we are, a couple of months have passed and I have been collecting components and making test rigs with mostly success. There have been some significant changes though. These are in a nutshell:
- Due out and Mega 2560 in. The i2c problems were beyond my patience to sort out.
- 7″ touch screen out, different 7″ touchscreen in. The generic one I was using was simply too slow for what I wanted so I have gone to one from 4DSystems. I have used their smaller screens and if you can stomach the cost they really are fantastic. The 7″ screen part number and description is: ‘gen4-uLCD-70DCT-CLB’ and ‘4D Systems TFT LCD Colour Display / Touch Screen, 7in, 800 x 480pixels’. I bought my one from RS Components. There is a development kit available which includes a 4Gb card and another adapter which I recommend.
Finally the original alarm clock has died so this project has received a bit of a kick in the pants. I am currently using my phone instead and even after one day it is driving me mad. I’ll adapt soon I guess but even so……
I also had an expensive mouse die on me so I am planning to reuse some of the components. The main one being the scroll wheel and button. Touchscreens are great but sometimes a button is just what the doctor ordered. My plan is to duplicate up on controls so either button or wheel etc. rather than make it exclusively one or the other. This can always be changed in software after all.
It’s ironic isn’t it: I went to the 4DSystems screen because the original was too slow for an analogue face, I cracked the analogue display using the new screen and now find myself tending back towards a digital interface. Maybe at the end of the day I’ll set it up so I can switch between screen designs and evaluate them.
23/4/2018: I was playing the other day sorting out the time of flight sensors I am using for turning the alarm on and off. It got me thinking (always a bad thing) and I think I have now come up with a way of setting the alarm time using gestures. It always frustrates me the various interfaces I see to set time or numbers in general so I was looking for an elegant way of accomplishing this. My favored solution of swiping on the touch screen is not achievable in my solution from what I can see, it is only a Mega 2560 after all. More research to do of course and I have found several ways of not doing it so far but I have another plan. Some soldering and 3d designing and printing needed in the short term though……..
More soon