Sunday, September 28, 2014

Blast from the past

MikeM sent this photo he took of the guts of the revolutionary-at the-time Sinclair Black watch beside the Bubble clock shield.


Mike also noticed odd behaviour of the clock shields (both bubble and OLED) when powered from the 3.7V LiPo battery (as shown here). After a while, the RTC returns bogus time. A quick check of the DS1307 datasheet (page 3) confirmed my suspicion:
When 5V is applied within normal limits, the device is fully accessible and data can be written and read. When a 3V battery is connected to the device and VCC is below 1.25 x VBAT, reads and writes are inhibited. However, the timekeeping function continues unaffected by the lower input voltage. As VCC falls below VBAT the RAM and timekeeper are switched over to the external power supply (nominal 3.0V DC) at VBAT.

Therefore, if one really wants the clock(s) powered from LiPo, a step-up converter must be used.
Another solution is to replace the DS1307 with the (almost) pin-to-pin compatible DS1337. This one does not provide support for a backup battery, relying instead on the main power (Vcc). Which shouldn't be a problem with a LiPo. The software would need to set the ATmega328 to sleep when the LiPo voltage drops under a certain (e.g. 3.5V) value. Once the display goes blank, the user should know it's time to charge the battery. (Note that another nice feature of DS1337 is alarm capabilities.)

I actually went through a similar exercise in the past, when I had to pick DS1337 over DS1307, for the exact same reason, but I forgot about it.

Conclusion: do not use DS1307 when the design calls for powering from 3V3 or directly from 3.7V LiPo.

Wednesday, September 24, 2014

Adding RF remote control to Wise Clock 4

Nick asked me once about adding remote control to his mega wise clock, similar to those pictured here (or any wise clock that may hang on a wall, for that matter). An obvious way to quickly and easily do this is by wiring the "simple RF M4 receiver" from adafruit to the 3 buttons of the Wise Clock. This 315MHz receiver module works in conjunction with the 4-button keyfob, also from adafruit. Note that the receiver comes in 3 flavors: momentary, toggle and latch. The one that "simulates" the touch buttons is the momentary one, hence the "M4" in the name (momentary, 4 outputs).

The schematic I used to connect the receiver module to the Wise Clock board is shown below.


I tested it and it works fine. Almost always :)
That is, ALWAYS when the display is not plugged in the clock board, NEVER when the display is connected. Which led me to conclude that either the display emits in the 315 MHz band (interfering with the receiver module; which it didn't; I checked by shielding the receiver in a metal case, wire antenna out), or it gets the power too dirty for the receiver.

An oscilloscope would have quickly answered my question. But since I don't have one, I tried all kinds of power adapters (from the fake-$1-on-ebay iPhone ones, to genuine 2A Samsung), up to batteries (4xAA). Incredibly, only the latter did the trick. Again, to emphasize, this is ONLY when the 3216 display is connected.

Below are some photos of the setup.


Note how the receiver is powered directly from the AA batteries. There is a common ground with the clock board though (black wire).


The LEDs are not mandatory, I added them just for visual feedback. They light up when either the board's or keyfob's buttons are pressed.

In any case, using the batteries to power the module is just to prove that this solution works. To be practical, I should add a DC-DC step-up voltage converter. According to the PT2272 datasheet (the chip on the M4 receiver), the module can be powered from 5V to 10V. I am not sure a boost converter would work in this case, unless it outputs really clean voltage, but it's the only practical solution I see at the moment.

Once I have this figured out, I plan on designing a small add-on board. The receiver module will plug into this add-on board, which will be connected to the Wise Clock's board through 5 wires.

As always, feedback (and help) is greatly appreciated.


PS I forgot to mention that I tried filtering the power with capacitors, up to 1000uF, with no success. (The 2-pin female header where the battery wires are plugged in were initially used to insert different capacitors.)


Saturday, September 6, 2014

HDSP clock mod displays proverbs

MikeM ported this "proverb clock" to HDSP clock. I did not have a chance to try the code myself yet (I am out of displays at the moment), but he vouches for it:
The proverb code is in place and working well.  I created a simple menu, accessed by pressing the hour and the minute buttons at the same time.  I have a 12 hour/24 hour selector, brightness selector, and Proverbs on/off selector.
Grahame Marsh's original proverb list was all in upper-case because his VFD displays only handled upper-case.  I've regenerated the compressed proverb list after changing it to only capitalize the first letter.  To do more than that I'd have to proof-read each of the 770 proverbs and find all the proper nouns to capitalize.  Capitalizing the first letter as a compromise doesn't look bad.  It helps the eye find the start of the word while the proverb is scrolling.

Mike also 3D-printed this stand, re-scaling to 72% this iPhone dock from thingiverse.

Thanks Mike!

P.S. I was a backer for this kickstarter clock. I like the way it turned out. It looks pretty similar to my old BookClock, using a similar 32x8 display, but centered around a Raspberry Pi (instead of just a simple Arduino), the main reason being the need to access the internet (to get the time, quotes, personal financial data etc). The only issue with this clock is that it is not open source (well, at least not the software). But I am sure an equivalent functionality can be achieved with a WiFi module (e.g. the cheap and famous by now ESP8266) connected to BookClock's Arduino.