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

33 comments:

  1. I've got a question for you :)

    How do you distinguish between May (Ma) and March (also Ma) on the clock when it's in portrait mode? Or do you just hope your memory is good enough :p

    Mowcius

    ReplyDelete
  2. Like the expiration date/month on the milk cartons :)

    ReplyDelete
  3. Anonymous said...Hello

    I tried to use my arduino duemilanove (Atmega328p) to build the book clock, I could compile the code from your download site in my arduino ide 22 and upload the sketch to my arduino without any issues. I connected the sure electronis 3208 display and the DS1307 according to your schematis of wiseduino with its own 10k resistors for the scl and sda lines and the 32khz cap ( i did not initiatlise the RTC with the time setting sketch though and I have not connected any eprom in the circuit ( I just wanted to see the basic clock display. But when I power up nothng happens. I have connected the digital pin 8,7,6 with pins 1,5,7 of the display and the display gets powered from the same suppy as the arduino.

    Can you please explain if I am missing anything or it is not supposed to run from a standalone arduino. I repeat, I had no issues in compiling and uploading the sketch to the arduino.

    I will really appreciate your feedback as I am really looking forward to building the book clock.
    Abosebkk

    ReplyDelete
  4. Hello

    I tried to use my arduino duemilanove (Atmega328p) to build the book clock, I could compile the code from your download site in my arduino ide 22 and upload the sketch to my arduino without any issues. I connected the sure electronis 3208 display and the DS1307 according to your schematis of wiseduino with its own 10k resistors for the scl and sda lines and the 32khz cap ( i did not initiatlise the RTC with the time setting sketch though and I have not connected any eprom in the circuit ( I just wanted to see the basic clock display. But when I power up nothng happens. I have connected the digital pin 8,7,6 with pins 1,5,7 of the display and the display gets powered from the same suppy as the arduino.

    Can you please explain if I am missing anything or it is not supposed to run from a standalone arduino. I repeat, I had no issues in compiling and uploading the sketch to the arduino.

    I will really appreciate your feedback as I am really looking forward to building the book clock.
    Abosebkk

    ReplyDelete
  5. First, we need to make sure your 3208 display works and it is compatible with mine. Can you point me to its datasheet? Did you run any test sketch that displays something?

    ReplyDelete
  6. Hi thanks for responding so fast! Yes, the 3208 display works fine. I have tested it with the driver board from sure electronics and there is no problem. I am also puzzled with this. Just one more question, Does your wiseduino use a standard arduino bootloader (something that is available from the arduino site or it is a custom code?

    This is the only document link i found for the display;
    http://www.sure-electronics.net/download/DE-DP13111_Ver1.0_EN.pdf

    ReplyDelete
  7. OK, if there is no hardware issue, let's look at the software.
    Since you have no I2C eeprom, either pull up D14/A0 (10k resistor to Vcc) or un-comment line
    // tilt = HIGH;
    so that function displayVertical() gets executed every time in the loop (function displayHorizontal() won't display anything without the I2C eeprom).

    ReplyDelete
  8. I am also looking at the datasheet, and I see this:

    Pin 1 - CS2
    Pin 2 - CS3
    Pin 3 - CS1
    Pin 4 - CS4

    In your case, with pin 1 connected to Arduino, you must have CS2 in the ON position (all others OFF).

    ReplyDelete
  9. Yes, that is what I set , i put cs2 on and all others off. this is also what you have said in your instructable as well.

    I am also looking at the setup code below: do you think there is something unusual here?



    void ht1632_setup()
    {
    pinMode(HT1632_CS, OUTPUT);
    digitalWrite(HT1632_CS, HIGH); // unselect (active low)
    pinMode(HT1632_WRCLK, OUTPUT);
    pinMode(HT1632_DATA, OUTPUT);
    ht1632_sendcmd(HT1632_CMD_SYSDIS); // Disable system

    #ifdef _16x24_
    ht1632_sendcmd(HT1632_CMD_COMS11); // 16*32, PMOS drivers
    #else
    // (fc)
    ht1632_sendcmd(HT1632_CMD_COMS10); // 32x8, PMOS drivers
    #endif

    ReplyDelete
  10. Ok, I will try to uncomment the tilt and see if it works . Will let you know in few minutes

    ReplyDelete
  11. The ifdef above is used for covering both 2416 and 3206 displays. As long as you have the line
    // #define _16x24_
    commented out, you should be fine (it assumes the displays is 3208).

    ReplyDelete
  12. Hi

    I have changed the tilt to be high all the time (uncommented the line) still nothing happens. One interesting thing to note is that when i check the serial terminal it continues to show time =0:00 and tilt= 0 even if i have the RTC connected.

    ReplyDelete
  13. i see that might be the problem as in my code that line is not commented as i mentioned above. let me try this now then . I will keep you posted

    ReplyDelete
  14. i have changed the code as below but no luck yet. sorry to bother you , i really appreciate your time and thought for this.


    // #ifdef _16x24_
    // ht1632_sendcmd(HT1632_CMD_COMS11); // 16*32, PMOS drivers

    // (fc)
    ht1632_sendcmd(HT1632_CMD_COMS10); // 32x8, PMOS drivers

    ReplyDelete
  15. You misunderstood me on this last one.
    I was not referring to the #ifdef line, but to the #define _16x24_ at the top of the file.
    Leave the line #ifdef _16x24_ as is (un-commented).

    To simplify a bit more, replace your loop() function with this one:

    void loop()
    {
    displayVertical();
    }

    ReplyDelete
  16. Ok I see what you mean. Let me try this and will get back to you. Any idea why the serial monitor is showing time=0:00 . this is getting me startled as i have the RTC connected.

    ReplyDelete
  17. Hi
    Now with the loop running the displayVertical function , i only see some lines and dots appearing randomly. no time is being shown. At least the display is showing signs of life ! Any ideas? we seem to be making some progress :)

    ReplyDelete
  18. At this point, I would make sure the RTC is connected and working properly. Do you have a schematic or photo? Did you run a test sketch for the RTC, including setting up the time?

    ReplyDelete
  19. No I did not run the sketch for the RTC. I assumed it would be initiated with the defaults. Let me run that sketch and then load the main sketch. Can you please guide me where can i get the sketch for the RTC?

    I am using the same schematic for the ds1307 that you had for your wiseduino ( pin 5 and 6 connected to analog 4, 5 or arduino and the 32k crystal on pin 1 and 2. I also have the 10k resistors connected to these pins

    ReplyDelete
  20. I just uploaded here the test sketch I usually use:
    http://code.google.com/p/wiseclock2/downloads/detail?name=ds1307.zip&can=2&q=

    It sends some data to the serial monitor as well.

    ReplyDelete
  21. Hi

    Thanks so much for the RTC sketch.

    I have uploaded and tested the sketch for the RTC and it works fine. Now when i see the terminal from the main sketch it shows the time correctly on the serial monitor. But for some reasons the display of 3208 is not showing anything but the dots and lines. :( will keep you posted

    ReplyDelete
  22. hello

    something must have gone wrong, now the display is not showing anything at all. I have tried with a spare one and the same results. Hope the display are fine ( i will check later with my demo board again) we came to so close of solving this case, i feel a bit dejected, but will continue to try. It indeed is baffling.

    i have disconnected the RTC and the same results , no display

    ReplyDelete
  23. I just noticed that your display is a bit different than mine. Datasheet for the one I used is here:
    https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B01cjIbSk11NYzY5ZmE2MDktNGU0YS00NjVkLWI0ZGUtMGU5YzBlODU5OGM5&authkey=CJzzx7YK&hl=en_US

    The memory mapping seems to be different. Mine is using only 4 bits per byte, yours is using all 8 bits.

    ReplyDelete
  24. I uploaded here a sketch to test the display in isolation:
    http://code.google.com/p/wiseclock2/downloads/detail?name=Test_3208.pde&can=2&q=
    Before anything else, we need to make this to work. It is supposed to scroll "Hello world".

    ReplyDelete
  25. i have uploaded the test sketch for hello world but unfortunately the display is still blank
    i am lost now. I do not know what had happened but the display was is showing no signs of life .

    ReplyDelete
  26. HI there

    I have a 3216 board (RG) as well. Do you think this would be easier to setup compared to the 3208? i am so much interested in the book clock design , it would be shame not to have it. I am so grateful to you for your continued efforts to help me out.

    ReplyDelete
  27. The code for 3216 is already figured out. First, try this demo code on your 3216 display:
    http://code.google.com/p/wiseclock2/downloads/detail?name=HT1632.zip&can=2&q=

    Or, you can build yourself an Wise Clock 3.

    ReplyDelete
  28. i am actually very much interested in the wise clock 3 and have made the pcbs for it already some tine ago but where I live, i can not seem to get the mega644 anywhere. I have already got the ds3231 and other stuff , just waiting for the mega644. i have requested samples from atmel but they have not arrived yet. definitely the wiseclock 3 is in my list but before that
    i wanted to build the book clock too as I thought it is such a cool idea. Also I have an arduino which makes it easier.

    i had already tested scrolling text display on my 3216 displays with my arduino few days ago, but was not sure if i could use them for the book clock.
    but judging from your response , it would not be difficult. Can you guide me a little bit with that as i am not an expert on C programming. You definitely seem to be a super expert on all these. Thank you very much for your help.

    ReplyDelete
  29. Thanks. I'll try to help.
    If you want, please contact me directly at the email address (it's somewhere in the top-right corner of this page).

    ReplyDelete
  30. Thank you very much for your offer to help. I will email you with my questions. It would be great if i can build the book clock with my arduino setup and the 3216 displays and also figure out how to port the wiseclock 3 to fit controllers with 32k mem or get the 644 from somewhere

    Best regards to you.

    ReplyDelete
  31. Hi
    I have tested the code that you have sent for 3216 demo and it works ok . Just wanted to let you know.

    ReplyDelete