Monthly Archives: March 2015

Web-based Weather Station

This Arduino project displays information on a 4-line LCD of local weather conditions. Using an Ethernet shield on an Arduino UNO, the unit requests data from openweathermap.org (using their api) and parses the information to obtain temperature (current, min and max), humidity, pressure, wind speed and direction, and textual description of current conditions. It is intended that this project will migrate from using the current Ethernet shield / UNO combination to an Nano and ESP8266 WiFi module for simple WiFi connectivity, However, I thought that this current version – naked and unhoused – may be on interest to some of you.

Web Weather Station

Web Weather Station

Continue reading

Calculating day of the week

While adding software to perform an automatic adjustment of Daylight Savings Time to my clocks, I came across a problem. My GPS-powered gpSKY CLOCK does not contain a real-time clock. So? Well, the algorithm I used for determining whether or not a date is within Daylight Savings Time (from 2am on the 2nd Sunday in March to 2am on the 1st Sunday in November) relies on knowing the day of the week (0-Sunday, 1-Monday etc.) – data that is automatically calculated by the RTC.

So, I had to determine the day of the week in the gpsSKY CLOCK by other means. Trawling the Internet I came across many different calculations, most of which were complex and almost impossible to follow. However, I found an algorithm that is elegant, small and relatively simple. According to Wikipedia, this algorithm is based on work in 1990 by Michael Keith and Tom Craver and revised into its current form Tomohiko Sakamoto in 1993. Apparently it is accurate for any Gregorian date.

// dow() returns byte containing numeric day of the week [0-Sunday, 1-Monday etc.]
byte dow(int y, int m, int d) {
       static int t[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};
       y -= m < 3;
       return (y + y/4 - y/100 + y/400 + t[m-1] + d) % 7;
}

Elegantly simple; simply elegant!

Daylight Saving Time… simplified

So, I don’t know about you but I have a ton of clocks. So last Sunday, at the start of Daylight Saving Time (DST), every one of my @#$% clocks had to be adjusted manually. What a pain!

Now, I love making clocks and I also love trying to solve problems, so inevitably this led to finding a simple way to automatically set the clock forward at DST and backward again for the return to Standard Time (ST). Here’s how it’s done….

Continue reading

3 & 4-line Big Font Numerals

As an extension to the large numeral fonts for 4-line LCD displays, I have added a set of 3-line LCD numerals that can be combined at will. Both the 4-line and 3-line numbers 0 to 9 use combinations of the the same set of 8 glyphs. The 3- and 4-line height font design make the numerals both easy to differentiate and easy to read at a distance and ideal for displays that benefit from highlighting some numbers.

To illustrate the combination of 3-line and 4-line high fonts, large numbers are used to display the time from a software-derived clock. The hours and minutes are displayed in 3-line height numbers while the seconds are displayed using 4-line height numerals.

3-line and 4-line large font numerals

3-line and 4-line large font numerals

Continue reading