Jeff Epler's blog

18 July 2020, 13:21 UTC

Quad CharliePlex FeatherWing hack

Adafruit makes these neat "CharlieWing" displays that allow you to control a 15x7 LED matrix using the I2C bus. I2C uses two signal wires (called SDA and SCL, for Serial DAta and Serial CLock), and can connect multiple devices as long as they have different addresses.

I noticed that the bigger brother of this device, with a whopping 144 LEDs, could be configured for 4 different I2C addresses, while this one could only be configured for 2.

Or could it?

read more…

17 July 2020, 21:37 UTC

Minimal Time-Zone Handling for CircuitPython

For my clock, I want automatic handling of Daylight Saving Time. However, CircuitPython doesn't build in any distinction between local and UTC time, and fitting in the entire Python3 datetime module or an Olson time zone database is simply not going to happen. What can we do that is simple enough to fit, but can represent the reality of timezones where I live?

read more…

16 July 2020, 18:22 UTC

Calibrating the DS3231 and PCF8523 RTCs

The DS3231 and PCF8523 real time clocks (RTCs) can both be calibrated by writing various register values. To follow the calibration procedures you'll need a frequency counter you trust, with at least 6 digits to calibrate the PCF8523 and 7 digits to calibrate the DS3231. (It also has to operate at the comparatively low frequency of 32.768kHz; a common inexpensive 8-digit frequency counter such as the "SANJIAN STUDIO" has a minimum of 100kHz so it's not usable for this purpose) I use an old HP 5315B universal counter that has been calibrated against GPS time.

read more…

16 July 2020, 15:12 UTC

Helpful Scripts for CircuitPython & Real Time Clocks (RTCs)

I have used two different RTCs in the Feather form factor. One has the PCF8523, and the other has the DS3231. The former has an SD card slot while the latter has higher precision including a temperature-compensated crystal oscillator.

read more…

25 July 2011, 13:41 UTC

wwvbpy: WWVB timecode generator in python

A few weeks ago, I posted about a WWVB timecode generator written in C. Unfortunately, this timecode generator did not have a clear license permitting modification or redistribution, so I felt I was unable to incorporate it into a project of my own.

Thus was born my own timecode generator, called wwvbpy. Its primary output mode is compatible with the "wwvb2.c" that inspired it. It also has a few features that wwvb2.c didn't: automatic handling of DST, DUT1, and leap seconds. DST is handled according to the operating system's rules for Denver. DUT1 and leap seconds are handled using data from IERS (As a result, my program's DUT1 does not exactly match past broadcast data on WWVB, as the data NIST broadcasts is "an average value for an extended range of dates").

It also has a set of tests of interesting times, such as the first and second days after a DST change, the last and last-but-one days of leap and non-leap years, a historical leap second, etc. (where possible, these test vectors were originally generated by wwvb2; however, some of the tests—such as the DST tests—had to be hand-generated, as wwvb2 couldn't generate them; besides this limitation, I also uncovered a bug in wwvb2 where non-leap years were treated as having 364 days and leap-years were treated as having 365!)

An option to output the timecode data to a serial device is contemplated but not finished; ultimately, this would work together with an Arduino/AVR firmware to produce a logic-level and/or 60kHz modulated version of the signal for testing hardware devices.

wwvbpy is covered by the GNU GPL v2+. It can be obtained from my public git repository:;a=summary.


23 June 2011, 21:38 UTC

Side track: wwvb links

Chris asks what advantage GPS has over WWVB for my clock project. I don't have a good answer for that (except that having enough controls to select one of 4 mainland US timezones and whether to apply DST is undesirable). However, this did prompt me to do some googling about WWVB. I found some interesting links about generating WWVB signals at home.

read more…

22 June 2011, 20:19 UTC

Towards my GPS LED Light Clock

A few years ago, I made a CCFL light clock using an Arduino with a custom shield containing a transformer (to get a reliable 60Hz timebase) and a triac (for solid-state switching of the lamp). By having a simple 7-day alarm calendar (set at compile time), the clock seldom requires interaction except for the reading lamp function.

However, the design has two main problems:

read more…

29 June 2009, 12:19 UTC

at90usb162 single-sided board

I got an e-mail request for this board. You may use this eagle (4.x) library, schematic, and board under the GNU GPL version 2 or later, or CC-BY-SA.

read more…

5 May 2009, 1:43 UTC

qq: quick & dirty terminal

13 March 2009, 1:33 UTC

Facepalm of the day

31 January 2009, 16:29 UTC

Red Alert Box

4 October 2008, 12:54 UTC

Autoreprogram for DFU devices

4 October 2008, 3:05 UTC

at90usb162 gotcha: PC0 vs XTAL2

All older entries
Website Copyright © 2004-2018 Jeff Epler