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

Saturday, September 5, 2009

Wise Clock 2 (Duino644-based) user manual

A user manual for Wise Clock is long overdue. I myself need to look through the code in order to find out what the commands are and how they work.

This "manual" is for Wise Clock 2, the one based on Duino644. It has extended functionality over Wise Clock ("glass domed"), since it is based on a more powerful processor and "platform" (featuring SD card, speaker, more buttons etc).

It will be long until this post becomes a proper manual, and hopefully I will find the time to update it regularly, as the features evolve, get refined (or dropped :) etc.

I should start by stating that the main feature of the Wise Clock 2 is to display the time, along with a user-defined scrolling text. The text is usually quotations (wisdom by famous people, funny punches, philosophic one-liners, sayings, maxims etc) gathered in the file named quotes.txt on the SD card. This file can be edited by anyone, on a PC.

Another feature that makes Wise Clock 2 original is the display: relatively large LED matrix, with a 16x24 resolution, readable from a considerable distance. Scrolling, at user-defined variable speed, enables even long text messages to be displayed in an effective manner and read easily.

Although some of the features may not be implemented yet, I think it is good to have them enumerated as requirements, so they are not forgotten :)

Commands

User command are issued through either the on-board buttons or through the Sony TV remote control (using Sony-standard infrared signals).

1. Remote control
  • CH+
  • CH-
  • VOL+
  • VOL-
  • digits
  • Enter
  • Power On/Off

2. Menu button
  • access the menu list at any time;
3. Set button
  • select a menu item from the menu list;
  • increase scrolling speed at any time;
  • set time for alarm, when in the right menu item;
  • set alarm on/off, when in the right menu item;
4. + button
  • increase display brightness at any time;
  • browse through the menu items;
  • increase speaker volume when in the right menu item;

Configuration

Time can also (besides the buttons) be set using the SD card time.txt file, featured presented here.

There is a default scrolling speed and a default display brightness.

Other configuration parameters can be set through a configuration file on the SD card.

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

Monday, August 31, 2009

My shield collection

While waiting for the bulk of Wiseduino PCBs to arrive, I was thinking of showing off my, rather modest, collection of (professional) Arduino shields.


















It consists of:
    • Wave shield, from adafruit;
    • Ethernet shield, from nuelectronics;
    • LCD keypad shield, from nuelectronics;
    • Motor shield, from adafruit;
    • Color LCD and joystick shield, from nuelectronics;
    • LED matrix shield, my own creation, used in Wise Clock;
    • Protoshield, from NKCelectronics.

    Related posts:

    Sunday, August 30, 2009

    Testing Wiseduino - EEPROM

    This is the second post related to the testing of Wiseduino. The first one talked about RTC and it started by showing how to correctly plug in the FTDI cable or the FTDI breakout.

    Now lets move on, to the external EEPROM, a 24LC256 memory chip, with a capacity of 32KB. It is connected on I2C (analog 4 and 5) and uses the Wire library to talk with the microcontroller.

    We will test the EEPROM by loading some text from a file. This is how this works: a program on the PC reads the text file and sends the characters to Wiseduino, which, in turn, is running a sketch that reads the incoming characters and saves them to EEPROM.

    Download the sketch here.

    Some VBscript code is included at the bottom of the pde file. Cut and paste that VBscript code into its own file, and name it writeFileToCom.vbs, for example (the extension vbs is mandatory). (This is tested and working on Windows. On Linux or Mac OSX, this script needs to be re-written.)

    How this works was explained earlier, in this post.

    With the eeprom_quotes.pde sketch uploaded, Wiseduino waits for characters to be received from the PC. Now execute the writeFileToCom.vbs VBscript by double clicking on the file (Windows associates the file with its script engine, wscript.exe).
    The VBscript opens the file C:\docs\quotes.txt, reads 10 characters at a time, then sends them over the serial port, until the end of file is reached.
    Two things are required in preparation for the text transfer:

    1. create the C:\docs\quotes.txt text file (or download this file to c:/docs);
    2. in the VBscript, change the COM port number from COM7 to the one you are using;

    The process of transferring the content of the file takes about 10 minutes for a 32KB of text at a baud rate of 9600.

    We check that the text was saved correctly in the EEPROM by reading its content. We will use the same eeprom_quotes.pde to read data from EEPROM. To do this, open the serial monitor, then type "\l" (backslash, lower l) in its input box and hit "Send" button. The bottom window should start displaying the lines of text stored in the EEPROM.


    Related posts: