Friday, February 5, 2010

Introducing IllyClock - alarm clock in a coffee can

Updated Aug 3/2011
Check out the "minimalist" version here.




Borrowing from Ladyada's idea of encasing the MintyBoost in an Altoids tin box, I thought that a coffee can, Illy in particular, would make a good enclosure for an alarm clock.

The electronics is based on Wiseduino (Arduino clone with DS1307 real time clock on board), with a LED matrix shield sitting on top. The shield is built with 74HC595 shift registers that drive two bi-color (red, green, and orange by subtraction) 8x8 LED matrices.

The clock uses a rotary encoder with button as the only user input.
The functionality is simple and intuitive:
  • time is shown as hour and minutes;
  • clicking the button will show, using the symbol of a bell, the state of the alarm (enabled or disabled);
  • double clicking the button will show the alarm time and allow the user to set the alarm hour and alarm minutes (toggle between the two by clicking the button); increment the numbers by rotating the knob;
  • holding down the button will allow the user to set the time;
And here is an original feature: three hours before the alarm will sound, the time is shown in orange; one hour before the alarm will sound, the time is shown in red. So just by squinting at the clock, one can realize how much longer one can sleep.

Here it is in action:


A few details on the dual matrix shield can be found below.
(I will dedicate another post to this shield though.)





The shield was originally designed (as it is shown in the schematic above) to be equipped with an infrared receiver and a push button. "Hacking" it to take a rotary encoder instead is trivial.

The diagram below shows how the user can change the clock's state by either rotating the encoder or pushing the button.





Related:

Wednesday, February 3, 2010

Wise Clock 2 software release for February 2010

Updated Apr 1/2010
Here are a few things to consider when using the "Wise Clock 2" library:
  • make sure your boards.txt file describes the version of ATmega644 you have (644 or 644P); if you use the wrong description, you will get a "wrong signature" error when uploading the sketch;
  • in Arduino IDE 18, you may get a compilation error related to "main.o"; if that happens, copy the main.cpp file from hardware/... /arduino to hardware/.../sanguino;
  • line 48 in Wise4Sure.pde sketch (#define _GREEN_DISPLAY_) needs to be enabled/disabled according to the display you want to use; if you use a red display, then comment that line out;
  • there seems to be multiple versions of the Tone library; you may even have one already installed; in case you get an error related to Tone library, leave only the version coming with the Wise Clock 2 library (which is tested and confirmed working).

I uploaded a new release of the Wise Clock 2 software, which can be found here.

It includes support for the new, green, LED display from Sure Electronics, which has the display memory organized differently than the red one (I could not find a reason they would do that; just for the sake of change?).

It also includes a bug fix: parameters (scrolling speed, brightness etc) retrieved from the RAM of a fresh RTC (that is, they were never saved there), came back with bogus values (of course, how obvious was that?). The latest release detects this case and saves the default parameters before retrieving them.

I will soon post a video of the green display in action.

Tuesday, January 26, 2010

What a difference...

... can a header/connector make.
Until today I used to plug the 8x8 LED matrices into these cheap and ubiquitous 40-pin female headers:
The round and thin pins of the LED matrices won't fit snugly the wide gaps of the above female headers. These headers are designed to work best, I strongly suspect, with the thick rectangular pins of the, also ubiquitous and cheap, 40-pin male header:


My LED matrices did not make firm contact when plugged into the above pictured female headers. Even scarier, every little touch seemed to affect the contacts, regardless of my efforts to find an easy solution (bend outwards the matrix pins a bit, thicken them with solder, insert them as deep as I could etc).

The final and permanent solution was to replace those headers altogether, with these round machined female pins:

They are a bit more expensive, but make a huge difference in terms of firmness of the contact.
They are also shorter, bringing the LED matrix closer to the board. That requires some attention when sockets are to be used: they should be either inside or outside the matrix package itself.
(Unfortunately I am talking from experience, since I had to remove a socket which was spread under two matrices.)


A different topic, but under the same umbrella of lessons learned: buying and using USB adapter power sources.
To shorten the story, this is the conclusion: when you buy such an USB adapter, never assume the output is 5V and just plug it into your expensive device!
Out of about 10 I bought on ebay, shipped from their manufacturers in China, 2 of them output 9V, way above the expected 5V. Although not statistically accurate (is there such a thing?), this is a 20% failure rate. Before plugging it on, always measure the output voltage to make sure it is what you expect.

Saturday, January 16, 2010

Complete "Wise Clock 2" kit for sale


Updated May 5, 2011
The "Complete Wise Clock 2 kit" is DISCONTINUED due to the lack of displays from Sure Electronics. If you have your own 2416 display, you can still buy the Duino644 board to make the Wise Clock 2.




Updated Jan 27, 2011
"Wise Clock 2 complete kit" is back in stock. The Duino644 board is re-designed, with the following changes for revision 2.1:
  • the real time clock can be either DS1307 (and crystal) or DS3231;
  • the on-board EEPROM (which was not used by the software) was eliminated;
  • the voltage dividers with resistors were replaced with 74125 gates;
The price remains the same (US$88 with free shipping, see below) for the DS1307 version. The version with DS3231 is $5 more.
Read more about Duino644 revision 2.1 here.


Updated Jan 1/2011
"Wise Clock 2 complete kit" is currently out of stock. It will be available again around the end of January 2011.


Updated June 17/2010
Starting today, "Wise Clock 2 complete kit" has the ATmega644P microcontroller loaded with the latest version of the "Wise Clock 2" software (this is on top of the bootloader, of course). This means that after assembling it, there is no need for ATmega644P chip to be programmed anymore; this eliminates the need for FTDI cable, Arduino IDE, code download, compilation, upload, and greatly simplifies the construction of the clock. (Obviously, the software can be changed/upgraded any time through the FTDI connector).

I recently received a batch of laser-cut acrylic covers designed as enclosures for the Wise Clock 2.
I decided to offer for sale a few complete Wise Clock 2 kits, which include:
  1. microcontroller board: Duino644 kit;
  2. display: red 16x24 LED matrix, from Sure Electronics;
  3. enclosure: 2 laser-cut acrylic plates, plus the auxiliary hardware (spacers, nuts, screws).
You can buy them for US$84, shipped free to any destination in North America.


 (US$88, free shipping to North America; I only ship to North America)

The assembled Wise Clock 2 should look pretty close to this one:


Note: Wise4Sure is the obsolete name for the Duino644 board. Duino644 can be used independently of the display from Sure Electronics, for example as the base for uzebox game console.


The photo below shows the content of the kit.




Assembling instructions are provided in this step-by-step "instructable".


In summary, Wise Clock 2 can currently (with the latest software release) do the following:
  • display current time;
  • read a user-editable file from SD card and display its content as quotations (hence the name "Wise Clock");
  • display current date;
  • set/trigger/sound/enable/disable alarm;
  • controllable from a Sony TV remote control;
  • user-selectable brightness for the high visibility display;
  • user-selectable speed for the scrolling text.

Sunday, December 6, 2009

Wise Clock 2 - Good news and bad news

Updated Feb 18/2010

Note: This posting is no longer relevant, from both the hardware and the software perspectives.
I'll keep it around just for the record.


The good news is that there is a new release, probably this year's last, of the Wise Clock 2 software.
Beside the expected bug fixes (related to alarm, thanks Mike B), there are also a couple of new features, both based on libraries published in the Arduino forum:
  • support for the infrared receiver, for commands from Sony TV remote controls;
  • alarm and other user settings are now saved into RTC's non-volatile memory (thanks Jeff S, matt).
The bad news is that you will need to do a bit more soldering for the above-mentioned software to work. Here is what happened: the infrared receiver and the Plus button are connected to the same D2 pin.

If you are not going to use the infrared receiver at all (bad idea, since you loose functionality), no hardware modifications are required. If you decide that the infrared receiver must do its job, then you need to replace a trace and a resistor. The idea is to move the Plus button onto pin D3, leaving the infrared receiver on D2 (also associated with INT2).

Edit (Jan/10): Turns out that the IR receiver is mandatory after all, due to the software. If it is not soldered (or inserted in a 3-pin socket), it must be "replaced" with a 10k resistor that pulls up D2 input (that is, D2 is connected to Vcc through a 10k resistor).


These are the steps:
  • on the top (parts) face of the board, cut the trace to the Plus button and the resistor R13, as shown below in yellow;
  • on the back of the board, solder a wire between the newly disconnected pin of button Plus and pin 4 of the microcontroller;
  • solder a new 10k resistor between pin 4 of the microcontroller and Vcc; an easy way to do this is shown in the image below;


These hardware "bug fixes" will allow the infrared receiver and the Plus button to coexist peacefully. The latest software release has the Plus button on D3.

Note: The latest batch of Duino644 boards, shipped after Dec 7, 2009, have, by design, the IR receiver on D2 and the Plus button on D3, so they won't require any hacking.


The "Wise Clock 2 User Manual" should get an update as well.

Talking about storage, notice that Duino644 has four places where data can be stored persistently (that is, it is not lost after a power shutdown):
  1. SD card;
  2. on-board external EEPROM;
  3. RTC non-volatile RAM, powered by the backup battery;
  4. internal (micro controller) EEPROM.

One last news is related to the LED display panel from Sure Electronics: they now sell green 24x16 displays.