Monday, December 20, 2010

Experimenting with 3216 LED display from Sure Electronics

In case you did not follow this thread in the arduino forum, here is a summary.
We were able to adapt the ht1632 library written by westfw for the 2416 monochrome display, to the new and improved, bigger and better, 3216 dual color LED display (datasheet here).

The biggest challenge was to figure out that each chip (of the four) on the display board requires its own CS (chip select) signal. The result of this understanding allowed the modification of the old functions by adding an extra parameter to specify which chip will get the command or the data.

Below is a short video of the game of life running on Arduino 328 connected to the 3216 display. Note that an extra wire is required (to carry the CS signal), compared to the old 2416 display (which had 4 switches to select the CS "address", useful for cascading).

The demo code is available for download here (tested with Arduino IDE 21).

Saturday, December 18, 2010

New and improved "Dual LED matrix shield"

Updated June 12/2011
Added schematic and board images, and provided the Eagle files.

The latest revision of the "Dual LED matrix shield" is shown in the photos below.

This board is a bit longer so that it can be fitted with standoffs on both sides.
It also features an on-board tilt switch (white cylinder in the photo above), two push buttons and an infrared receiver.

The two RG (Red, Green, Yellow) LED matrices are inserted in the machined headers (round pins), after the components are soldered to the board.

The schematic and board (also available as Eagle files here and here, respectively) are shown in the images below.

(Click on the image to get a bigger size.)

Related posts:

Wednesday, December 8, 2010

Troubleshooting Wise Clock 2

It happened to me (and to others as well) that sometimes, after uploading the sketch, Wise Clock 2 displays the message "Failed to read quotes.txt from SD card" even though the SD card is inserted and has the right files on it. Obviously, this is a problem. First impulse is to try another SD card (and another and another). Still same error. Panic.

Here is a list of points to follow in this case.
  • check that all components are soldered (believe it or not, it happened to me once that I forgot to solder the 3V3 voltage regulator);
  • check that all pins of the SD socket are soldered; since the kit comes with the SD card socket already soldered (by myself), any un-soldered pins is my fault (I apologize in advance if that happens; it did happen);
  • with the multimeter, check all connections to the SD socket;
  • make sure that the resistors in the voltage divider (4K7 and 10K, under the microcontroller) are correctly placed, as shown in photo 4 in the posting "Assembling Duino644".

Here is a tip on how to find out easily the polarity of a LED (especially useful for SMDs, either in circuit or not): with the multimeter's switch on the "check continuity" position (beeps), measure the "continuity" of the LED. The correct polarity will make the LED light up faintly.

Tuesday, December 7, 2010

Plastic case for BookClock

In case you did not like the bamboo BookClock (introduced here), this is another shot: a sleek, black plastic, version. The construction is similar to the wooden box, made of interlocking laser-cut plastic faces, with a transparent acrylic screen.

Related postings:

Saturday, December 4, 2010

Wiseduino revision 1.7

Updated May 16, 2011
Courtesy of Scott, for those who want to take a quick peek (without downloading the Eagle files), here are the schematic in PDF and the board in PDF.

Updated Dec 14/2010
Revision 1.7 has a glitch: SCL and SDA pins of DS1307 are left un-connected. This should be an easy fix (shown in the photo below), yet an embarassing mistake on my side.

So here is the deal: until the whole lot is gone, every buyer of Wiseduino kit will get an extra one of these boards for free, or any other freebee by request.

Wiseduino is one of many Arduino clones, fully compatible with Arduino shields and Arduino software environment (IDE).
What makes Wiseduino unique is the on-board real time clock (with DS1307)(*) with backup battery, and the 32KB EEPROM (with 24LC256).

(*) Wiseduino+ has on-board DS3231, an extremely accurate real time clock.

The latest revision of Wiseduino is blue (as I mentioned in a previous post, black boards are not a choice these days anymore). In addition, these are the other differences:
  • changed layout: some of the parts are a bit re-organized;
  • oscillator can also take a crystal (not only a resonator as before);
  • manual trace routing: allowed for better connections (no traces between the header pins, for example).

All the other great features :) are still in place:
  • on-board DS1307 (real time clock) with backup battery, and 24LS256 (EEPROM);
  • support for XBee adapter from Adafruit (radio communication, remote uploading of sketches);
  • parallel row of headers, compatible with prototyping boards;
  • power micro switch;
  • detachable prototyping area, with pad for an 8-pin SOIC;
  • all ICs on sockets;
  • 6-pin FTDI connector for uploading sketches (requires FTDI cable of FTDI breakout).

The new board is shown in the photo below.

I personally used Wiseduino for the WiseClock and BookClock projects. Others have used it for data logging (recording data to the external 32KB EEPROM) and general Arduino projects (since it is shield and software compatible).

The (corrected) board layout looks as in the image below.

The Eagle files can be found here (download schematic, download board).

Related posts:

Thursday, November 18, 2010

"The Complete BookClock kit" now offered in store

This latest offering is a kit which, once assembled, will look as in the video below.

The Complete BookClock kit includes:
  • Wiseduino kit (see content here);
  • 8x32 LED matrix display from Sure Electronics;
  • laser-cut parts of the enclosure (1/4" bamboo plywood, 3/16" plexiglass front screen);
  • screws/nuts and ribbon cable for display;
  • tilt sensor.

Assembling instructions can be found here.

The Complete BookClock kit will be shipped 2 weeks after the order is placed. Drop me a line (s o m e o n e @ c i f o . c o m) if you are interested in purchasing this kit.

Updated Dec 4/2010
The source code (, downloadable here) is missing ht1632.h header file; I added this file by itself to the repository.
Also, if you have this file (or similar files containing HT1632 function definitions) around, in other projects (arduinoX/libraries folder), you may get compilation errors ("multiple definitions for function ..."). In this case, remove all other HT1632-related files and leave only BookClock project.

Related postings:

Monday, November 15, 2010

BookClock contest winner

The contest for a BookClock enclosure has a winner. Among the few designs entered, one definitely stands out. An important criteria was the ability to produce the box, equally easy, on both small and large scale manufacturing. This hinted that the design should be based on a laser-cut solution. Below is the final sketch (there have been a few iterations) for the winning design.

I liked the way the box gets assembled, like a 3D puzzle, and also the fact that there are no screws sticking out from the front acrylic panel. The four screws that hold the display in place could be hidden even more if
the front panel is colored acrylic instead of the clear kind.

I already had two boxes made, one of bamboo plywood, the other one of black acrylic.
Below are some photos of BookClock box with the displayed attached, Wiseduino board not in yet.

Monday, November 1, 2010

Wiseduino+ kit available for sale

Update July 5, 2015
A redesigned wsduino kit is now available.

Updated Apr 24, 2012
This kit is DISCONTINUED (not available for sale anymore).

If you are looking into building an Arduino-based clock or a system that requires time keeping, this board is for you. Wiseduino+ not only offers an on-board real time clock, but an extremely accurate one, based on the DS3231 chip from Maxim.

Wiseduino+ is fully compatible with Arduino Duemilanove, from both the hardware (shields) and software (Arduino IDE) perspectives.

Since many people dislike (or are not comfortable with) soldering SMDs, the kit comes with the RTC chip DS3231 already soldered. (Note that there is no DS3231 in DIP form available.) All other parts are through-hole. Sockets are provided for the two other ICs (ATmega328 microcontroller and 24LC256 EEPROM).

Wiseduino+ kit contains the following parts:
  • PCB (green), with a (cuttable) prototyping area;
  • ATmega328 microcontroller chip, with 28-pin DIL socket;
  • DS3231 RTC chip, soldered on the board;
  • 24LC256 EEPROM chip, with 16-pin DIL socket;
  • 16MHz crystal;
  • 2 x 22pF capacitors;
  • 2N2222 npn transistor;
  • 4 x 100nF decoupling capacitors;
  • 6 x 10k resistors;
  • 40-pin female header;
  • CR1220 coin battery, with socket;
  • micro power switch;
  • 2-pin polarized power connector with wires attached;
  • clip for 9V-style battery (for use with a battery holder ONLY; NEVER connect to a 9V battery);
  • 6-pin right angle male header, used as FTDI connector.
To assemble the board, use the same (similar) instructions for building Wiseduino.
A partially assembled board is shown in the photo below.

From the software perspective, any sketch developed for Wiseduino should work without changes on Wiseduino+.

Related postings:

Saturday, October 30, 2010

Introducing Wiseduino+

Updated June 10/2011
Added images of the schematic and board and provided the Eagles files.

On this new Arduino-compatible board, similar in form and function to the older Wiseduino, DS1307 was replaced with the extremely accurate real time clock DS3231 from Maxim.

All the other feature were left intact:
  • ATmega328;
  • on-board real time clock with battery backup;
  • on-board EEPROM (32K);
  • connector for XBee adapter from Adafruit (with remote upload capabilities);
  • parallel row of prototyping board-compatible headers;
  • power switch;
  • prototyping area (which can be cut off, if desired, and used as breakout for an 8-pin SOIC SMD);
  • 6-pin FTDI connector;
  • sketches for Wiseduino work without modifications.
Enhancements include:
  • ability to use either resonator or crystal (and 2 capacitors);
  • ability to connect to the interrupt pins of DS3231;
  • better (manual) trace routing.

Here are the top and the bottom of the board:

Here are Wiseduino+ and Wiseduino (both partially assembled) side by side:

As a note, the PCB manufacturer cannot currently make black boards anymore (or it is prohibitively expensive).

Monday, October 11, 2010

Contest - enclosure for BookClock

I am of the opinion that an electronics project is not finished until it is encased. I have lots of working boards sitting around and collecting dust (literally). They cannot be displayed/shown and sometimes not even touched as they are, since there is a potential for shorts or breaking connections because of the open circuitry or fragile wiring.

Here is an idea: a contest for the design of an enclosure, specifically for the BookClock project. I originally used a cardboard box as case, but that looks rather shabby. I tried to explore other, mostly wood-based (because opacity should be a requirement) solutions, but they are too complicated to manufacture (involving tooling, die-cuts etc). I think that one of the best suited solution for "mass" production and also accessible to amateurs and hobbyists, is laser-cutting the box sides, but this is just my suggestion.

So here are the contest rules and details:
  1. submit plans, containing drawings with dimensions, for a box for BookClock; basically, the book-sized box should hold the 8x32 LED matrix display from Sure Electronics (datasheet here) on a side, and the Arduino board inside.
  2. email the design file (PDF, DGW, DXF, PNG, BMP, JPG) to s o m e o n e @ c i f o . c o m;
  3. deadline for submission is Nov 15, 2010;
  4. the best design(s) will be awarded DWex watch(es);
  5. the design must be open source (publishable, downloadable);

The winner(s) will be chosen based on the following criteria, not necessarily in this order:
  • solution cost: the cheaper, the better; this involves materials and processing work (labor/machining/assembly/finishing);
  • design: how it looks;
  • originality, special features, cool factor.

I will be posting on the contest entries and announce the winner a few days after the contest ends on Nov 15.

Thursday, October 7, 2010

DWex is here! Real and ready!

Thank you for 17 days of unbelievable patience.
I will ship all outstanding orders tomorrow, plus the promised (see comments here) gift (a small step to your next clock project).
It may sound like an excuse, but this kind of delay happens in the big leagues as well, even at a grander scale. I myself ordered from Texas Instruments their Chronos watch development kit, in November of 2009. Almost one year later, I received the shipping confirmation. If you don't believe me, look at the snapshot below.

Saturday, September 11, 2010

New in the Shoppe: Wise Clock 2 - assembled, tested and ready for use

Updated May 5, 2011  - This product is now DISCONTINUED.

The latest issue (Sep 2010) of Elektor magazine has a catchy title on its cover: "Give your projects simple grace with the Elektor project case". Browsing the magazine curiously, I found out that the mentioned project case is actually the way I enclose my own projects, made out of two laser-cut plates of transparent acrylic. I am glad I am not far off from "perfection" :)

Since it cannot be said better, here is the quote from the Elektor article:

A brief tour of the World Wide Web clearly shows one of the problems facing many electronic enthusiasts: the enclosure. All too often it’s a plastic box in a dismal shade of grey, cluttered with an awkward arrangement of connectors, controls and indicators. You spent hours designing a stunning PCB layout, assembled the board neatly, and it ends up in a humdrum plastic box. Isn’t there a better way?

Starting today, for people who don't own (and are not interested in owning) a soldering iron, I am making available the assembled and tested version of the Wise Clock 2. It comes with the SD card, formatted and with the right files on it, the USB power adapter (5V DC output) and a 4-foot miniB USB cable (used to power the clock from either a computer or the USB adapter). In the assembled Wise Clock 2, the transparent acrylic plates are thicker, at 4mm (1/6"). The ATmega644 microcontroller comes programmed with the latest software (since new feature are added periodically). The display can be chosen between red and green.

Wise Clock 2 is shown in the photo at right and also in this video.

The clock is available for shipping to North America only, for the price of US$125, with free shipping.

Thursday, September 2, 2010

Cases for DWex

I've been looking around trying to find a solution for encasing the DWex watch.
A few ideas popped up:
  • use a case from an old pocket watch or stop watch;
  • build a machined-aluminum (CNCed) case from scratch (this would be an expensive venture), similar to that of the Nixie watch;
  • stich a tennis-cuff-like "soft case", with a transparent film material on top;
  • print a plastic case with a 3D printer  (e.g. reprap);
  • screw together a few layers of laser-cut acrylic.
The last two solutions seem to be suitable for "mass production". Some plans (for Makerbot watch) are already available, but they may need to be adjusted to fit the DWex.

Here are some links I found after googling around:

Related posts:

Monday, August 30, 2010

Programming DWex

All DWex boards are shipped with the latest software (available here) loaded and tested. The on-board ATmega328 controller has the bootloader already burned in.

I don't expect users ("experimenters" in the case of DWex :) not to modify and improve the code. In fact, I have a long list of TODOs myself. To help speed up the process, here are some tips and heads-up.

1. To upload the sketches, use the 3V3 FTDI breakout board or the 3V3 FTDI cable (remember that the board is designed to work at 3V; it is 5V tolerant though).

2. Use a 6-pin male header between the FTDI cable/breakout and the DWex board, inserted as shown below.

3. Make sure that the "green" wire of the FTDI cable (also marked on the FTDI breakout) goes to the pin marked "Green" on the DWex board.

4. The CR2032 battery must be inserted in the holder when uploading the sketch. The DWex board is not powered from the FTDI cable/breakout (pin 4 of the FTDI header is not connected).

5. In Arduino IDE, select the board as "Lilypad with ATmega328", as shown in the screenshot below.

6. The available pins (not taken by LED matrix and button) are:
  • D11, D12, D13 (MOSI, MISO, SCK respectively) accessible through the ICSP connector;
  • D0, D1 (Rx, Tx respectively) accessible through the FTDI connector;
  • D2, accessible and marked on the board as JP2;
  • D10, not connected to any pad.

7. The second (un-soldered) holder would connect another CR2032 in parallel. Although at the beginning it seemed to boost the power supply, I realized after some research that it may not be a good idea after all. I am still debating on this and I am open to suggestions.

8. With the current code, to set the time, hold the button pressed for 3-4 seconds, until the LEDs light up in circle, one after the other. When the correct time is reached, release the button. The time will then be saved in the RTC. Obviously, this method does not confer the highest accuracy.

9. The state diagram for the current implementation is shown below.

Related posts:

Sunday, August 29, 2010

DWex - an alternative to Makerbot watch

I always wanted to buy a Makerbot watch, but never had the chance. That's because they were (and still are, at the time of writing) always "out of stock" in the Makerbot store. Then I decided to make my own and better version, called DWex, an acronym for Duino Watch for experimenters (introduced here a while back). I actually borrowed some of the ideas from Makerbot watch, including the round shape :) and the LED arrangement, as two circles of 12 LEDs.

Here is a brief comparison between the two:
  • DWex is based on ATmega328 running at 8MHz (as opposed to 16MHz); that should make it take less juice out of the 3V coin battery;
  • DWex has only one button (as opposed to 3); and even that could be eliminated eventually (replaced with a tilt switch, for example);
  • DWex has 4 fewer LEDs; the way to show the time (software) does not require the extra 4 LEDs of Makerbot watch;
  • DWex spends most of its time in sleep mode (I don't know how Makerbot watch works though, to be honest, but I think time is kept by the ATmega chip itself; therefore, no sleep for it); it only wakes up when the button is pressed, to show the time;
  • DWex is thinner, and that may be due to the much bigger crystal used by Makerbot;
  • DWex does not have a buzzer;
  • Like Makerbot watch, DWex has both the ICSP and FTDI connectors on board, making it an "Arduino environment on your wrist" as well.
  • They both cost the same, US$30 (plus $3 regular shipping to North America). DWex is in stock though. It is real and working.

Some of the features of DWex are:
  • time is shown by lighting/flickering only two LEDs, for hours and minutes;
  • time can be set by the user through the button, without connecting the board to the PC;
  • consumption is 12mA when the time is shown, 120uA when asleep; the CR2032 coin battery should last at least a few months;
  • can be re-programmed to make use of the alarms of on-board DS1337 RTC (this functionality is not implemented, but the hardware capabilities are in place).

 US$33, including regular shipping to North America

 US$36, including regular shipping to anywhere in the world

Related posts:

Friday, August 27, 2010

Nixie clock

I could not resist adding yet another clock to my collection. This one is Nixie, although not Arduino-based. I bought the kit on ebay and assembled it in a couple of hours. It's got a PIC microcontroller and a DS3231 "extremely accurate RTC". In the process I learned that Nixie tubes need around 170V to work, voltage generated by a DC-to-DC converter built with a 555.

Although the schematic is provided, the code is not.

Here are a couple of photos.

The kit did not come with an enclosure, so I mounted the board between two laser-cut acrylic plates.

A wooden (oak) frame should give it a better look. But that's another project in itself.

Sunday, August 1, 2010

Features added to Wise Clock 2

The latest version of Wise Clock 2 includes a couple of new features:
  • displaying UTC time along with local time (menu item UTC); the time zone (for calculating the UTC) is specified in the file time.txt, as follows:
  • displaying the time in big font (menu item BIG); time will be shown as H12:MM; the digits are defined in grids of 6x12 pixels (file fontBig.h).

The good thing about ATmega644 is that one, apparently, can add code without thinking (yet) of memory limitations.
A few more ideas to follow in the future are:
- display bitmaps loaded from SD card;

The current version defaults to the RED 16x24 display.
If you plan on uploading this version and you have the green display, do not forget to un-comment the line
//#define _GREEN_DISPLAY_
in file ht1632.cpp.

Related posts:
  • Wise Clock 2 - alarm clock with large LED display
  • Duino644 - Sanguino compatible board with extra features

Monday, June 28, 2010

Wise Clocks on the Make: Staff Pick List

Updated July 9/10
Not in the MakersMarket anymore. To be able to afford the fees, sales must be pretty consistent, which was not the case with the wise clocks, unfortunately.

It is nice to see that two of my Wise Clocks made it on the Make: staff pick list.
I offer them for sale, assembled and tested, in the MakersMarket store.

One could win one of the assembled Wise Clocks, or any other product in the MakersMarket store, by participating in their contest, see rules here.

The technically inclined could buy the kits at a fraction of those prices, and also learn and have fun in the process of assembling them.

Thank you, Make: staff.

Wednesday, June 23, 2010

Introducing DWex - Duino Watch for experimenters

This watch is built around a 3V-powered ATmega328P running at 8MHz.
Time is shown using 2 circles of 12 LEDs, in a manner similar to an analog watch (with hands). Minutes are indicated on the exterior circle of green LEDs; hours are indicated on the interior circle of red LEDs, as shown in this video.

To make the watch practical (that is, wearable), the battery life should be at least in the order of months. This can only be achieved by keeping the processor in sleep mode most of the time. At the push of a button the microcontroller becomes active and lights up the appropriate LEDs for 3-5 seconds; then it goes back to sleep.

The diameter of the board is 4.8mm (1 7/8 inches), determined mainly by the size of the coin batteries.
The thickness of the assembled board is 8mm (a little less than 3/8").

DS1337 real time clock chip keeps the time. It was chosen over DS1307 because it has alarm capabilities. This allows the microcontroller to wake up on an interrupt when the alarm is triggered.

The watch is powered by two 3V coin batteries (CR2032) connected in parallel and mounted on the back of the board. Their total capacity is 450mAh (2 x 225mAh). They should last about 3 months of "normal" use (pressing the "display" button several times an hour) based on the sleep mode consumption of around 120microAmps and on the "active" consumption (LEDs on) of 12mA for 5 seconds at a time.

Most of the components are surface mounted. Both ICSP6 and FTDI connectors are on board. This would allow it to be used as a miniature Arduino (with on-board RTC ), for other-than-watch purposes.

Schematics and board layout are shown below (I will publish the Eagle files soon, after a thorough revision).

An original feature of the watch is the single push button used for both showing the time and setting up the time. Basically, the first button push will wake up the controller from the sleep mode and light up the appropriate LEDs. If the user presses the button for a longer period, the LEDs are activated in sequence, simulating the rotation of minutes and hour hands. When the desired time is reached, the user releases the button, thus setting a new time.

The source code can be downloaded here.

An interesting challenge will be to find (or design and make) a proper case. Ideally, it would resemble the black anodized machined aluminum case of the Nixie watch. (But then, the button should be replaced with a tilt switch as well.)

More details to come.

Related postings:

Thursday, June 17, 2010

Wise Clock 2 now comes with ATmega644P programmed

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).

Price for the kit remains the same, US$84, with free shipping (only to North America). Buy it here.

Related postings:

Thursday, May 20, 2010

On Google Ads and other "ad revenue streams"

Updated Sep 7, 2010
Today I received an email from Makersmarket. They ceased operation. Their business model didn't work. I guess that the high monthly fees they charged made other sellers to pull out as well.

Updated July 9, 2010
The book promised by makersmarket never showed up. (I also closed my "store" on makersmarket because the fees were really eating the little revenue I made there.) Therefore, I took out their logo as well (shown below for "commemorative" purposes).

This has nothing to do with Arduino, but I thought it is still a piece of information (that others may find useful) and not just noise.
Out of curiosity, I signed up with Google Ads (aka AdSense) when I first developed this blog. I could have filled the screen with "AdSense gadgets" as they are called, by I chose the most modest of the advertisement modes, the one that displays a few line of ads between postings (plus one at the bottom of the page).

A year later, I made US$30. Well, I did not really cash it in, since Google sends out checks of a minimum US$100. So I will have to wait patiently (and write diligently) about 2 more years to see any money from Google ads.
Also worth mentioning is the number of hits ("page impressions") for the last year: 37K.

A little rough estimate of potential revenue from Google ads (if they would display Google ads) is somewhere around US$3,000 a year, which would be 100 times more than this blog (I remember them mentioning 1M pages served; that would be roughly 30 times more, which looks hugely underestimated). Again, $3,000 if the ads would be lightly displayed. Not bad, but not great either, considering they have sales in excess of US$1M a year.

On the same line (ads), also out of curiosity, I signed up with Amazon, although I did not start using their service yet. Expect some postings on books I read (or plan to) in the future, when I will find the time.

Thirdly, makersmarket, where I listed assembled wise clocks, offers a book (a value of $25) to the first 50 fellows who display their logo. Which is exactly what I did yesterday. This would be a much better ("efficient") deal than Google Ads, obviously.

And lastly, I got hooked up, also out of curiosity, with yet another "ad revenue stream", a business model developed by a friend who is trying to take over Google (I am kidding, evidently). The result is the "Rent this space" box on the right column.

Now you have all the explanations and excuses for all the ads you see on this blog. As they say, "don't blame the player, blame the game". Seriously, it is just a way to get a little understanding of what's going on.
I cannot resist to close with another saying: "if you are not outraged, you are not paying attention".

Thursday, May 6, 2010

New version of Wiseduino

The new Wiseduino board offers several improvements (I would like to think) over the old one:
  • prototyping area, with pads for an 8-pin SOIC chip; this part can be sawed off along the fine holes, to match the dimensions of a small shield (and of the previous version); the intention was for this piece to be broken off by hand, but the PCB is too thick to make this possible;
  • two mounting holes for screws/standoffs;
  • power (5V) provided through the FTDI connector as well;
  • through-hole power switch.

The prototyping area can be used to add buttons, buzzer, LEDs, or even a voltage regulator.

Eagle files are available: schematic hereboard here.

Related posts:

Saturday, May 1, 2010

Prototype of an analog clock with LEDs

Inspired by Makerbot Watch, I designed my own version of an analog clock with LEDs.

The prototype uses a Wiseduino with DS1337 and a protoshield with 24 SMD LEDs.
Physically, on the board, the LEDs are placed in 2 "rings" of 12, the outside ring designated for minutes (red LEDs), the inside one for hours (green LEDs).

In the circuit, the LEDs are organized as a matrix of 5x5, as shown below.

The challenge is to display the time in an intuitive manner. For example, an analog clock moves its hour hand proportionally with the minutes. This is hard to achieve with relatively few stationary LEDs. Tricks need to be "invented" and even those may not be enough for an "accurate" display. Watch this video and let me know if what's shown is intelligible as a clock reading.

As seen in the video, the time is shown after the button is pressed. There are two reasons for that:
  • since LEDs are the biggest consumers on this board, try to light them up only when necessary;
  • for counting the flashing minutes there should be a start moment, and this is what the button provides.

Since this project will eventually evolve into a wrist-watch, a very important aspect is the power consumption.
Here are a few numbers so far (idle current/current with LEDs on):
  1. normal loop, with no sleep: 4.7mA/12.2mA
  2. "unoptimized" sleep mode most of the time: 0.13mA/12.2mA
  3. "optimized" sleep mode: (to be completed)

To be practical as a watch, it will need a way to set up the time, which may require a second button (plus software, of course, to navigate the hours and the minutes).

Optionally, the watch may also have an alarm. This feature would require a small buzzer (plus, again, software to set up the alarm time and to activate the sound). The board size will be bigger and current consumption will be greater.

Somewhat similar projects on the interwebs (both featuring Microchip microcontrollers):

Sunday, April 18, 2010

SMT kits

My friend Charley, the author of Intruderchron software for the adafruit's Monochron clock, sent me this SMTCylon kit he sells through his web site. It is an SMD-only kit, that is, all components are surface mounted.

Although I soldered SMDs before, this was the first time I built an entire kit made of SMDs.
As challenging as it looks at first sight, after warming up by soldering a few LEDs, one may be inclined to give up through-hole soldering altogether. Soldering SMDs is not as scary as it sounds once one gets the technique, described in 4 steps: "wet" one pad, place the SMD on its pads, solder one terminal to the "wet" pad, then solder the other terminal.

The step-by-step tutorial for assembling the "SMTCylon" is very good, in the adafruit style, with lots of photos. Assembling takes about half an hour. The attiny microcontroller comes already programmed.

I highly recommend this kit as a great introduction to SMD soldering. And after the soldering fun was over (with absolutely no glitches), the playing fun started. I am thinking of incorporating the small board into a bigger project.

Friday, April 16, 2010

New features in the latest "Wise Clock 2" software

A week ago I received a version of the Wise Clock 2 code, improved and enhanced by MarkS. This library is posted here as well (together with the others, for historical reasons, let's say).

The new features implemented by Mark are:
  • ability to set the time through the buttons (instead of only through teh time.txt file on the SD card) ;
  • when setting the time, either current or alarm, the part (hours or minutes) being set is blinking;
  • time is displayed in either 12 or 24 hour format, as chosen through a menu option.
Mark also created a set of core files for Duino644 board, which can be used instead of the Sanguino core files.
Starting from Mark's changes, I restructured the latest code a bit, trying, in a hurry, an object-oriented approach. I also implemented a couple of new features:
  • quotes.txt now allows for lines to be commented out, so they don't get displayed;
  • a personalized message (e.g. "Happy birthday!", "Merry Christmas"), defined by the user in a file on SD card, can now be displayed between quotations, similar to the date.
This latest "Wise Clock 2" library is a lot of header and cpp files, some of them containing just straight C functions (HT1632.cpp, for example), some of them containing class definitions.
In the new library, Wise4Sure.pde has become very light and streamlined. The clock's functionality is now "encapsulated" in aptly named (I hope) files. Macrodefinitions are now scattered through the files, somewhat intuitively. For example, the macro _GREEN_DISPLAY_ is now found in HT1632.h file, which only deals with the display. (The ht1632 code is still the old bunch of C functions, no class at the moment.)
The OO Wise Clock 2 library can be downloaded from the same place as the others, here.

Thursday, April 8, 2010

Countdown timer prototype

While waiting for an 8MHz resonator to finish a previous project and post the result, I put together a prototype of a countdown timer that shows the time passing by changing the display color from green, through orange, to red.

This is just a different way to display information, color versus digits, similar to analog vs digital speedometer, if you will.

The timer is built with an Arduino Diecimila (with ATmega168) and the LED matrix shield.

Sunday, March 21, 2010

Wiseduino with DS1337

DS1337 is another real time clock (RTC) from Maxim, closely resembling DS1307 that comes with the Wiseduino kit.

The main difference between these two chips is the ability of DS1337 to handle (set, trigger) an alarm. Otherwise, both have similar pin configurations, both "talk" I2C, and both use a 3V coin battery (DS1307 only as backup, DS1337 as the only power source).

Many others have included DS1337 on their boards and wrote libraries for this chip. I thought I should give it a try myself, especially because of the alarm capability. The easiest way was to modify an Wiseduino board, by cutting 3 traces and adding 2 wires, as shown in this image:

The cuts are shown with yellow lines, the wires are light blue. The rightmost cut is on the back of the board.

Updated Apr 17/2010
After I started the actual work, I realized that, since DS1337 is powered by the 3V coin battery, voltage level adapters (on SCL and SDA lines) need to be used between the clock and a 5V-powered Wiseduino. So I decided to power Wiseduino with 3V as well (2xAA batteries). This means the frequency cannot be 16MHz (according to ATmega168/328 datasheet); so I installed an 8MHz resonator instead. So far so good. I am able to upload the DS1337 sketch and read back the time. Current consumption is a under 5mA.

Here are a few other things I did to make this work:
  • on Wiseduino, I am using an ATmega168 with the bootloader, instead of the 328;
  • I changed boards.txt to accommodate the 8MHz working frequency:
  • tried unsuccessfully JLuciani's DS1337 library; it seems to require/use a different set of "wire" files than those coming with Arduino IDE 18; confusion ensues; files and functions need to be renamed etc etc; I just gave up;
  • tried, with limited success, xSmurf's DS1337 library; there seem to be multiple versions of the DS1337 class (and header), no sample sketch that uses the class; I had to eliminate some alarm-related stuff, define some macros etc. In the end, I have a simplified version working;
  • to upload the sketch to the board, I used the 3V3 version of the FTDI breakout from sparkfun (the 5V has the signal voltages too high).
Next steps:
  • put the microcontroller to sleep when time is not read (this will reduce the consumption to micro amps, hopefully);
  • implement the alarm functionality, with interrupts.

Conclusion DS1307 vs DS1337:
  • DS1337 should be used in a 3V3 environment; it is not meant to be mixed with 5V signals;
  • DS1337 libraries I looked at so far are pretty finicky compared to DS1307 libraries;
  • an equivalent of (that is, as easy to use as) DS1307 for 3V3 is DS1340 (used by JeeLabs in their JeeNode boards).

Sunday, March 14, 2010

Scrolling text on the Dual RG matrix shield

As one may recall, the "Dual RG matrix shield" was introduced as the display for IllyClock. In that case, it showed the time (hour and minutes) statically.

Earlier, I wrote a sketch for this shield that displays moving (scrolling) text. Somebody may find it useful, and that is why I thought of sharing it.

The demo sketch, tested with Arduino IDE 18, can be downloaded here.
This is how it looks in action.

Saturday, March 13, 2010

BookClock - new member of the Wise Clock family

Don't throw away that carboard box your Monochron was packaged in. You can use it as enclosure for the cheapest (yet) member of the Wise Clock family, currently named "BookClock" (for the reason that it can be placed on a book shelf, among books).

Note: The featured cardboard box is sold by ULine. It has the code ULine S-974 and can be found here.

The BookClock contains only two elements: Wiseduino, of course, and the 8x32 LED display from Sure Electronics. One nifty addition is a tilt sensor that changes what is displayed depending on the clock orientation (standing on the smallest side as a book, or laying flat on the largest side).

To build it, let's start with the enclosure, the cardboard box. With an xacto knife, cut an opening for the display.

The opening, waiting for the display, should look like this:

Stick some scotch tape along the cut lines to strengthen (and also smooth) them.
After inserting the display, attach it to the box with some sticky tape (I used electrical tape).
This is how it looks when standing, as a book on the shelf.

The "guts" of the BookClock is a "hacked" Wiseduino board, which looks like this:

This board does not have the extension (female) headers, since there will be no shield mounted anyway. So I soldered (the required wires of) the 16-wire ribbon cable directly where the headers would have been.

Wires number 15 and 16 of the ribbon are GND and Vcc (5V) respectively. For mechanical reasons I soldered them into D0 and D1, whose lines were previously cut. (I then re-connected D0 and D1 to Vcc and GND respectively, see the red and blue wires.)

The board also has a tilt sensor soldered between analog 0 (A0) and ground. A 10K resistor pulls A0 up (connects it to Vcc).

This is how it looks on the inside (not yet connected to power).

Thursday, February 18, 2010

Memory mapping in 16x24 LED displays from Sure Electronics

When Sure Electronics released their green version of the 16x24 LED display, I was surprised to notice that this display was not compatible with the red one. One could not just unplug the red display and replace it with the green one and expect it to work. I found out about this the hard way. After a bit of confusion (I thought that my green display was defective), it was pointed out to me that the datasheets for the two displays are different. It took a little effort to accommodate the green display in the Wise Clock 2 software. Essentially, I had to adapt the function ht1632_plot to work with the new display.

I show below some diagrams representing the memory mapping for the two displays.
The datasheets (red here, green here) do not explain this mapping very clearly. I thought my drawings may bring some better understanding to others as well.

Friday, February 12, 2010

Assembling the "Dual Bi-color LED matrix shield" kit

This kit contains the following parts:
  • PCB (compatible with Arduino shields);
  • two 8x8 bi-color bright LED matrices (side is 47mm or 1 7/8" in length, 5mm LEDs);
  • 4 x 74HC595 shift registers;
  • ULN2803 transistor array;
  • 4 x 16-pin IC socket;
  • 32 current-limiting resistors;
  • 4 x 100nF decoupling capacitors (color may vary);
  • 4 x 12-pin machined female headers;
  • 40-pin male header;
  • rotary encoder with push button and knob.

To assemble the kit, follow the step-by-step process below.
  1. insert the four 16-pin IC sockets, making sure that their notches match those in the silkscreen; their orientation is important (errors are not fatal though), since it will indicate the orientation of the ICs which will be later plugged into them; solder the sockets, making sure that they are close to (touching) the board;

  2. cut the 40-pin male header in 4 pieces, two 8-pin and two 6-pin, then solder them in their corresponding places; these are the pins which will plug into Arduino's (female) extension headers; as always with the shields, it is advisable to have them plugged into the Arduino extension connectors while soldering them to the shield;

  3. solder the four 12-pin female headers; these are the connectors for the LED matrices;

  4. solder each resistor after placing it vertically (bend one terminal 180 degrees);

  5. solder the decoupling capacitors;

  6. place the ULN2803 chip, paying attention to its orientation (notch on chip must match notch on silkscreen) and solder it;
  7. carefully insert the integrated circuits into their respective sockets, matching the notches (socket-chip); to make sure they can be inserted, bend the pins on both sides just a tad (as shown here, courtesy of adafruit), so they become parallel;

  8. insert the LED matrices, paying attention to their orientation: pin 1 of the matrix must match pin 1 on the board (the pin numbers are hand-written by me on the back).

    The assembled shield should look like the one below.

    Related posts: