Neusse

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: GPS not updating Alpha 5 Clock-Solved! #29987
    Neusse
    Participant

    IO know this is old but I thought I would add my two cents. I found that you do not need a GPS location fix that is communicating with 4 or more satellites. You only need one unless you are looking for millisecond accuracy. Turns out that even without a fix you are receiving a good time from at least one satellite. That is all most of us really need. I modified my the GPS code to ignore the fix and simplify the whole acquisition of date and time. Here is a quote from an article that seems to validate this.

    Explination of not waiting for a GPS fix to set time:

    Each satellite broadcasts time. Only one is needed to determine the time with accuracy to distance to the satellite in light seconds – under 0.088s of error. But you need at least three, preferably more satellites to get the location fix and the high-precision time (adjusted for distance from the satellite = time it takes for the signal to reach you.) As your GPS obtains more signals, it calculates its position (fix) and adjusts the clock, but the initial first broadcast is enough to establish timestamps.

    Neusse
    Participant

    I know this is very old. But I found that if you are using the chronodot with your Alpha 5 Clock there is already a temperature sensor built into the ds3231 chip. there is already an Arduino library for the specific chip. But the code that is distributed with the Alpha 5 is using the DS1307RTC library. I added the DS3231 library and could access the temperature. just a couple lines of code and your good. I checked its accuracy against an indor thermometer and it was about .5 degrees off. Good enough.

    Here is some of the code.

    else if (DisplayModeLocal == 99) // show DS3231 RTC chip temperature
    {
    // conversion of C to F (28.25°C × 9/5) + 32 = 82.85°F
    int myTemp = ((myclock.getTemperature() * 1.8) + 32) * 100; // * 100 to shift the decimal out

    int frac = myTemp % 100;
    int t = myTemp / 100;

    WordIn[0] = U16DIVBY10(t) + a5_integerOffset;
    WordIn[1] = t % 10 + a5_integerOffset;
    WordIn[2] = U16DIVBY10(frac) + a5_integerOffset;
    //WordIn[3] = frac % 10 + a5_integerOffset;
    WordIn[3] = ‘ ‘;
    WordIn[4] = ‘F’;

    if (forceUpdateCopy)
    {
    a5clearOSB();
    a5loadOSB_Ascii(WordIn, a5_brightLevel);
    a5loadOSB_DP(“01020”, a5_brightLevel);

    if (AlarmIndicate())
    a5loadOSB_DP(“20000”, a5_brightLevel);
    else
    a5loadOSB_DP(“00000”, a5_brightLevel);

    a5BeginFadeToOSB();
    }

Viewing 2 posts - 1 through 2 (of 2 total)