Showing posts with label Wise4Sure. Show all posts
Showing posts with label Wise4Sure. Show all posts

Tuesday, February 9, 2010

"Finished" Wise Clock 2 with Duino644

By "finished" I am only referring to the enclosure, not to the evolving (hopefully) software. Once released to the open source community, the software should be, in theory, never "finished", like a piece of art :)

Here is a photo of a simple (and cost-effective), yet elegant, enclosure, consisting in two laser-cut sheets of 1/8" plexiglass separated by plastic spacers.

Sunday, November 15, 2009

Wise Clock 2 - New software release

Before talking about the new software release, I must point out a few corrections/edits I made in earlier posts:
The new software release can be downloaded from here. Most of the items on a previous "to do" list have been addressed. Following are the items I managed to do so far:
  • included Tone library (written by B. Hagman) to generate alarm sounds;
  • implemented functionality for the three buttons (Menu, Set, Plus);
  • removed the branching for ATmega328 (#ifdef _ATMEGA328P_), since many of the features won't fit in its RAM anyway;
  • ability to set up the date the same way as the time, through the file time.txt on the SD card;
  • display notification when the SD card is not inserted (or, to be more accurate, file quotes.txt is not found);
  • implemented sleep mode (more work is required for waking up from sleep mode with the remote control);
  • scrolling speed adjustable through 1-button (Plus) pushes;
  • dimming adjustable through 1-button (Set) pushes;
  • select to display the date or not;
  • ability to set the alarm time;
  • enable/disable alarm.
(Details and explanations to follow.)

Saturday, November 7, 2009

Duino644 - Use it

The best tutorials I have seen are, by far, those from adafruit.com. With the effort I can spend, I will never be able to write anything better than those instructionals. So, as the saying goes, "if you can't beat them, join them", I will try to mimic. (One item on my "to do" list is the building of a project site, with a "normal" navigation: projects listed on the left column, description on the wider right column. Hopefully, all these postings will eventually become project chapters. And, of course, one chapter will be named "Use it".)

As we already know by now, Duino644 can be used independently of the LED display from Sure Electronics (this is one of the reasons I re-named the board Duino644 from the original Wise4Sure), more like an Arduino (or, I should say Sanguino) is. For this purpose, all 4 "ports" are exposed through 4 headers (8-pin connectors). On the board, these ports are named PORT_A, PORT_B, PORT_C and PORT_D, and they are highlighted in the picture below.


Since Duino644 is compatible with (or "piggybacking on") Sanguino, here is the pin mapping used when programmed Arduino-style (that is, using digitalWrite/digitalRead rather than accessing the ports directly):


                  +---\/---+
(D 0) PB0  1|        |40  PA0 (AI 0 / D31)
(D 1) PB1  2|        |39  PA1 (AI 1 / D30)
INT2 (D 2) PB2  3|        |38  PA2 (AI 2 / D29)
PWM (D 3) PB3  4|        |37  PA3 (AI 3 / D28)
PWM (D 4) PB4  5|        |36  PA4 (AI 4 / D27)
MOSI (D 5) PB5  6|        |35  PA5 (AI 5 / D26)
MISO (D 6) PB6  7|   A    |34  PA6 (AI 6 / D25)
SCK (D 7) PB7  8|   T    |33  PA7 (AI 7 / D24)
RST  9|   M    |32  AREF
VCC 10|   E    |31  GND
GND 11|   G    |30  AVCC
XTAL2 12|   A    |29  PC7 (D 23)
XTAL1 13|        |28  PC6 (D 22)
RX0 (D 8)  PD0 14|   6    |27  PC5 (D 21) TDI
TX0 (D 9)  PD1 15|   4    |26  PC4 (D 20) TDO
INT0(D 10) PD2 16|   4    |25  PC3 (D 19) TMS
INT1(D 11) PD3 17|        |24  PC2 (D 18) TCK
PWM (D 12) PD4 18|        |23  PC1 (D 17) SDA
PWM (D 13) PD5 19|        |22  PC0 (D 16) SCL
PWM (D 14) PD6 20|        |21  PD7 (D 15) PWM
+--------+

(to be continued)

References:

Friday, September 18, 2009

Buy Duino644 kit


Updated Sep 30, 2011 - DISCONTINUED
This kit is no longer offered. It was replaced by the Wise Clock 3 kit.


Updated Jan 27, 2011
A redesigned (revision 2.1) Duino644 is back in stock. Read more about it here.


Note: Although I added a few more components and I made the board a bit larger, I decided to keep the price unchanged. I hope this is appreciated :)
Also, the picture below won't accurately reflect the actual component set. Missing are the 4 right-angle push buttons (one is replacing the reset button), the micro-speaker and the high brightness blue LED.

I have a few Duino644 kits for sale, on hand and ready to ship. After they are gone, any order will be fulfilled in about 4 weeks time.
Duino644 kits are US$54, with free regular shipping to North America.

For only US$10 more, buy the 2416 LED matrix display from Sure Electronics (ebay), and you can have a nice gadget on your desk to impress your friends an colleagues.

The Duino644 kit includes the following parts:
  • PCB;
  • ATmega644 / 20MHz, with bootloader;
  • either 16 MHz resonator or crystal 16 MHz (plus 2 capacitors 22pF);
  • 40-pin socket for ATmega644;
  • SD card socket (SD card is not included);
  • DS1307 real time clock, either in DIP or SOIC package;
  • 24LC256 EEPROM, either in DIP or SOIC package;
  • 3V coin battery (CR1220 equivalent);
  • battery holder for CR1220;
  • crystal 32,768 Hz;
  • 2 x 16-pin (2x8) female headers;
  • 3 x capacitor 100nF;
  • 78L33 regulator (3V3);
  • 10 x resistor 10K;
  • 3 x resistor 4.7K;
  • micro push button (reset);
  • micro slide switch (power);
  • 6-pin angled male header (FTDI);
  • either USB miniB SMD connector or USB type B connector;
  • infrared receiver;
  • 40-pin female connector;
  • either molex 2-pin angled power connector or JST jack.





















Assembling instructions are published here.

Related posts:

Introducing Duino644

Updated Sep 30, 2011 - DISCONTINUED
This kit is no longer available. A very similar kit is the Wise Clock 3.

A simple name from a simple mind: think Arduino clone powered by ATmega644.

Compatible with Arduino software environment (thanks to the Sanguino board, from which it was inspired), Duino644 offers more capabilities than a regular, ATmega328-based Arduino, in the same price range.

Duino644 was originally designed to be used in an advanced new version of Wise Clock. It features the same combo RTC + EEPROM as Wiseduino, and also an SD card socket and connectors for the 24x16 LED matrix display from Sure Electronics.

Duino644 can also be used as a general-purpose Sanguino-compatible board, having all ports (input/ouput pins) exposed and available for use.

Here are some of Duino644 features:

  • PDIP (40 pin) ATmega644 on socket, running at 16 MHz;
  • compatible with Arduino software environment through the addition of Sanguino libraries;
  • directly pluggable into the 2416 LED display from Sure Electronics;
  • semi-pluggable (just one of the two connectors) into the 0832 LED matrix display from Sure Electronics; display type (2416 or 0832) is selectable through jumper;
  • compatible with uzebox game console (requires a different crystal and the "uzebox shield" (under development));
  • relatively easy to solder, with mostly through hole components;
  • on board socket for either SD card or microSD card;
  • on board RTC (DS1307) in either PDIP or SOIC package;
  • on board EEPROM (24LC256) in either PDIP or SOIC package;
  • 6-pin FTDI connector with automatic reset capability;
  • powered, with regulated 5V only, through either standard 2-pin power connector (MLX-WF02R from molex or JST jack from seeedstudio) or USB (type B or miniB connector);
  • power on/off micro switch, easily accessible on the side;
  • available interrupt output pin from RTC;
  • on board backup battery (CR1220), allowing RTC to keep time even when Duino644 is not powered;
  • infrared receiver for remote control;
  • all 4 ports made available through extension headers, spaced at 0.1" multiples, for use with prototype boards;
  • ISCP6 connector for AVR programming.






















A few Duino644 PCBs are shown in the photo below.












And this is an assembled Duino644, which is the base for Wise4Sure. With the current software, it works exactly like in this video.



















Assembling instructions can be found here.


Creative Commons License
Duino644 by FlorinC is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.


References:

Related posts:

Sunday, September 6, 2009

Assembling Duino644

This the schematic (download Eagle file) for Duino644 revision 1.1 (Oct/09)

and the board (download Eagle file):

If you bought the Duino644 kit, you received the following components:
  • PCB with the SD card socket soldered on it;
  • ATmega644 microcontroller and its 40-pin socket;
  • DS1307 real time controller, in either 8-pin DIP (with a socket) or SOIC (surface mounted) package;
  • 24LC256 EEPROM, in either 8-pin DIP (with a socket) or SOIC (surface mounted) package;
  • CR1220 (or equivalent) coin battery;
  • coin battery holder;
  • either a 16MHz crystal and 2 capacitors 22pF, or a 16MHz resonator;
  • crystal 32,768Hz for RTC;
  • 4 right angled push buttons;
  • micro-speaker;
  • high intensity blue LED (SMD, 1206 package);
  • USB miniB-type connector;
  • JSP 2-pin jack;
  • JST 2-pin power connector (with red-black cables soldered);
  • 2 female headers 2x8 pins;
  • 40-pin female header;
  • L78L33 voltage regulator (3V3);
  • infrared receiver IC;
  • 6-pin right angled male header (FTDI connector);
  • 3 decoupling 100nF capacitor;
  • 2x3 pin male header (ICSP connector);
  • 10 resistor 10K;
  • 3 resistor 4K7;
  • resistor 75R.
As with the other kits, soldering the components is not for absolut beginners: this should not be the first kit you assemble. The challenge comes from the few SMD components. Although these are the biggest SMD (surface mounted) packages you will find (SOIC for ICs, 1206 for LED, and the USB miniB), you would still need, depending on your experience, tweezers, de-soldering braid, flux pen.

So here is how we should proceed with the assembling.

1. Solder the USB miniB connector first. Place the connector with its bumps in its holes, so it fits in its place. Then solder the 4 outside extremities to the pads, so it becomes solidly attached to the board. Now solder the 5 pins, with disregard to the bridges that may occur. The next step should be to remove those bridges with the braid.

2. Solder the 75 ohm resistor in its place (R14). This is the current limiting resistor for the LED.

Note: The kit has 3 color-coded resistor values: 10K (brown, black, orange, gold), 4K7 (yellow, purple, black, brown, brown) and 75 ohm (purple, green, black, gold, brown). To simplify identification for those who don't want to consult the color-code chart, use the following photo.


3. Next, solder the SMD LED. The cathode of the LED is marked (green dot, visible through magnifying glass). The cathode is marked on the PCB as well, with 3 dots. Melt some solder on the cathode pad; place the LED's cathode over that pad and solder it; then solder the anode.

4. Time to check that the board gets power from USB, by plugging in the USB cable. The LED should become bright blue. We have ignition!

5. Perform this step if you have the SMD (surface mounted) version of the RTC and/or EEPROM. For best results, moist their pads with a flux pen before you solder them. Avoid using the "de-soldering braid" to remove the eventual bridges, since these are temperature sensitive, unlike the USB connector soldered earlier. (Pay attention to the orientation of these chips: the dots marking pin 1 must be closer to the bottom of the PCB.)

6. Solder the 4K7 resistors (yellow, purple, black, brown, brown), R5, R6 and R7. Then continue with the remaining resistors, all 10K.

7. Solder the IC sockets, for ATmega644, RTC and EEPROM (if the last two were provided). Pay attention to their orientation, so that their notches match the notch in the silkscreen (this is not vital, but it will help later to correctly place the ICs).

8. Solder the two crystals (16MHz and 32768Hz), then the capacitors (C1 and C2 are 22pF, the rest are 100nF). The 16MHz (bigger) crystal goes in the three-hole spot (center is not used) close to the pins 11-13 of the microcontroller. Latest PCB version has this spot marked "XTAL".

9. Solder the battery holder. (I personally cut the 3 bumps underneath, so it gets closer to the board.). Then solder the ISCP (optional) and FTDI connectors.

10. Solder the 4 right-angle push buttons, the micro-speaker and the JSP (power) jack. Continue with soldering the 2 LED display connectors (2x8 female headers).

11. Solder the 3V3 regulator after placing it to match the silkscreen.

12. Insert the ATmega644 chip in its socket, then the RTC and the EEPROM (if you have the DIP version). Pay attention to their orientation, by matching the notches on the IC with the notches in the socket (if they were placed correctly in step 7 :) Also, remember to bend their pins just a tiny bit, on a hard surface (e.g. desk) to make them parallel, as so nicely documented in many of ladyada's instructionals (including this one).

13. Optionally, solder the infrared receiver. (This part should be visible to the remote control. Therefore, its final place will be dictated by the enclosure. Depending on that, it may be necessary for the infrared receiver to be "extended" with some wires.)
Pay attention to its orientation: when inserted, the bump should be facing inwards, toward the board. To be visible by the remote control, the IR receiver should also stick out from behind the LED display, so it would need to be bent 90 degrees, as shown in the photo below.

It has been suggested (thanks Mowcius) that a 3-pin female header can be soldered in place of the IR receiver. This will act as a socket, eliminating the risk of soldering the part wrongly, as it happened in a few instances. More, it will allow for the cables to be unplugged when the device need to be dis-assembled (assuming that the IR receiver is fixed to the enclosure).


At this point, Duino644 is assembled and ready for testing (continue here).
It should look pretty close to the one below (which is missing a few non-essential parts).

Wednesday, September 2, 2009

Scrolling for LED displays from Sure Electronics

I am posting the code (Arduino sketch, of course) I use for driving an 8x32 LED matrix display from Sure Electronics. This code is an adaptation of the one published by Bill Westfield ("WestfW") in the Arduino forum, here. Through the use of a macro definition (#define _16x24_), the same code can be used for either 16x24 or 8x32 display. To generate code for the 8x32 display, simply comment out the above mentioned #define.

This is a re-created short version, since I am too frustrated to re-type everything after I lost the content several times, by pressing Ctrl Z (undo) too many times, it seems.

An observation about Google's Blogspot is that it sucks at displaying source code, compared with the support Wordpress gets for this purpose.
So, I decided to insert my code in a Wordpress blog, here.

If (and when) you use this code, make sure that you connect Arduino pins 6, 7, 8 to their corresponding display pins.

Also, font3.h, included in the sketch, contains the definitions of characters as 8x8 pixels, starting with ascii code 32 (space).
You can download this file here.

The sketch was tested successfully with Arduino IDE 14 on ATmega328. It scrolls "Hello world" from right to left, in a loop (similarly to what happens in with this video).

Friday, August 7, 2009

Wise4Sure - now featuring ATmega644

Last night I was able to finish the prototype of Wise4Sure. The board has ATmega644 as its core, as well as an SD card socket plus the additional circuitry (voltage divider resistors, 3V3 regulator), an RTC with DS1307 and backup battery, and a connector for the 16x32 LED display from Sure Electronics (hence its name).


Amazingly, after the few modifications, required by ATmega644, of the SDuFAT and Wire libraries, it worked from the first try.

Following are photos of the assembled and partially encased Wise4Sure project. It contains the LED display attached to the plexiglass panel, and the Wise4Sure board plugged in the back of the display. Power is provided through either FTDI or USB connector.




The 4KB RAM of ATmega644 should allow for more complex applications, including IR control, wireless (XBee) communication, networking (Ethernet), X10, wave playing etc. Really looking forward to the expanded capabilities. (With ATmega328, I was barely able to combine reading from the SD card with outputting on the LED display.)

Next step would be the design of a proper PCB.

Friday, July 24, 2009

Brief comparison between SD card shields

Before I started the Wise4Sure project, which uses SD card, I did some research on a few SD card shields available commercially. This post is a summary of my findings.

I looked at three SD card shields: one from Libelium (US$28), one from Seeedstudio (US$15) and Wave shield from Adafruit (US$22, although this is more than an SD card shield).

The similarities are:
  • all SD cards require 3.3V;
  • all connect to the SPI port (pins 10-13);
  • they all need a voltage divider (2 resistors x 3 signals) to adapt between the 5V level from Arduino and 3.3V level of the SD card;
These are the particularities:
  • Libelium's small form factor shield comes assembled (SMD components) and tested, and includes a microSD card. It offers the nice feature of plugging the shield to either pins 8-13 (power is extracted from pin 8, set as high) or to the ICSP connector. It is not stackable (no more shields on top of it). It makes its own 3.3V from an onboard regulator.
  • Seeedstudio's also small form factor comes assembled and tested. It accepts both SD and microSD, manually selectable through a switch. 3.3V comes from Arduino. It is also not stackable.
  • Adafruit's Wave shield is a full size shield, designed to play wave files from the SD card. It comes as a kit, with through-hole components and clear assembling instructions. It has a powerful (100mA) 3.3V regulator on board and it is stackable. After interfacing with Wave shield, only pins 6 to 9 are left available for other use.
In my pre-prototype of Wise4Sure I used the Wave shield, since it was the only SD card shield I had. The integration went seemlessly, everything worked from the start.

Monday, July 20, 2009

When 2K is not enough

Good thing I started Wise4Sure as a "pre-prototype" (proof-of-concept). Imagine the frustration of things working weirdly with a prototype board, parts soldered maybe not perfectly, wires over wires, solder bridges and many other potential hardware issues. Then realize that the problems are really in the software, where 2KB of RAM is not enough, due to the SD card library (SHuFAT), which itself uses a half KB buffer to read a sector (see this post).

Based on the newly acquired facts, I decided that the prototype will use an ATmega644, the core of the sanguino. Here are a few technical specs:
  • 4KB static RAM (that's the main reason I chose it);
  • 64KB flash memory;
  • 2KB EEPROM;
  • completely through-hole.
Not many stores sell the sanguinos, nor the ATmega644, especially with the bootloader. I ordered mine from wulfden.org.

I already started building the board, and one of the first observations is that the distance between the two connectors (2x8-pin) on the back of the 0832 display module from Sure is not multiple of 0.1", as I expected. So my plan to use the connectors as plug-ins the "mother-board" is half ruined. I may need to use only one connector, which would confer less mechanical sturdiness, or have the "mother-board" un-attached mechanically, but connected through the short parallel cable that comes with the display. Both suck.

Related posts:

Sunday, July 19, 2009

Wise4Sure - Wise Clock with LED display from Sure Electronics

I was finally able to finish the "pre-prototype" of Wise4Sure, the version of Wise Clock that uses a 32x8 LED display from Sure Electronics. These LED matrices are single color (I have seen red, green and yellow so far), have a controller on board (Holtek1632) and can be bought for about US$10 (free shipping). Unbeatable. So, I could not resist the temptation of building Wise Clock around this display. Courtesy of Mr. Bill Westfield ("WestfW") who wrote the demo sketch (see here), displaying to the Sure LED matrix module becomes a trivial task. With a few small modifications (adaptations from the original 24x16 matrix to my 32x8), the sketch worked perfectly.

Another "improvement" is the introduction of the SD card. Previous versions of Wise Clock stored the text quotations in EEPROM, which had a few inconveniences:
- there was a limit of 32KB of storage;
- the process of loading the EEPROM was relatively complex and time consuming.

Replacing the EEPROM with an SD card solves these inconveniences and offers a few other advantages:
- quotations (or any message for that matter) can be changed/updated much easier, since it involves only the modification of a text file;
- quotations can be edited with a PC, directly on the SD card;
- there is no need to transfer the text, from a file on PC to Arduino, through serial port.

Integrating the SD card with Wise4Sure was the challenge. From h/w perspective, all SD solutions use the SPI (digital pins 10-13). As for the s/w, I opted for SDuFAT, from Arduino playground. It seems that this library is RAM hungry (I should mention that I did not look at the others, which may be as hungry). A big chunk of RAM, 512 bytes, is taken by the buffer that stores a sector after it is read from SD. (So, I assume that all other libraries should have this buffer as well).

After I eliminated some variables and functions which I did not use, everything (scrolling quotations) seemed to be working fine. Until I included the code for RTC (DS1307), when the returned time was consistently same bogus value. I narrowed the problem down to, again, memory (RAM) use. I adjusted my own text buffer a million times, until I got the RTC working. You may ask, as I did, what has the RTC got to do with the memory? Well, I can tell you, when the RAM is in "short supply", the time returned from RTC is just wrong (for example, "18:00" at all times). Keep in mind that RAM is consummed by the processor/program stack as well: the more functions are called, and the more parameters are passed, the more RAM is taken.

I said "pre-prototype" because, as SD card "shield", I used ladyada's Wave Shield. As for Arduino, I used my own Arduino clone, WiseDuino (just came up with the name, it used to be called Wise Clock, but this may lead to confusion). By the way, WiseDuino is now at revision 1.3 and the PCB is being manufactured by seeedstudio. I should be getting some boards soon and it seems that they will be also available for sale, under open source projects, from seeedstudio.com site.

In the end I got it working, so here it is in action (video).

The device is currently powered by 4 AA eneloop rechargeable batteries. The measured consumption is around 200 mA (as mentioned, using Wave Shield as SD card module). For practical purposes, this may require a wall wart power supply.

Next step is to build a real prototype, on perfboard, attached to the LED display board. Basically a whole Arduino, with an RTC and an SD card, with connectors for the LED display (pseudo) "shield".