Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Challenge: GPO feature - What have you developed for your station?
#3

I have developed the GPO function I run on my weather station a little more.

Now, not only will it warn me of a low battery, but it will also warn me of high wind gusts and extreme temperatures.

Using the same LED illumination as mentioned above, the GPO function will check for high wind gust values and pre-set temperature ranges. As the GPO function runs once a minute, the LED illumination and screen text will only display for minimum of 1 minute or while the condition is true. This is enough time to take note if you are in the room to see it.

As previously written, this is a two part process. The GPO function will illuminate LEDs through the relay output and also replace the date/time text with a written warning.

The conditions I am checking are:
BatVolt = Battery Voltage of TX unit
Output_WGust = High wind gusts
Output_T_Out = Outside Temperature

Code:
GPO_state = 0;
//Check the TX battery voltage for set values. This value will leave LEDs on

if ((Unit[0].BatVolt / 100.0) <= 12.10 && (Unit[0].BatVolt / 100.0) != 0 )
{  
setPortHIGH(PORTD, 3); //Turn on the GPO pin
lcd.setCursor(0, 0); //Set cursor to top row (over write date/time)
lcd.print(F("BATTERY LOW!! ")); // Print battery warning text
lcd.print(Unit[0].BatVolt / 100.0, 2); // Print battery voltage
lcd.print(F("V"));
GPO_state = 1;
}

//Check the TX battery voltage for set values. This value will flash LEDs on and off (pre low warning)

else if ((Unit[0].BatVolt / 100.0) <= 12.15 && (Unit[0].BatVolt / 100.0) != 0 )
{  
setPortHIGH(PORTD, 3); //Turn on the GPO pin
lcd.setCursor(0, 0); //Set cursor to top row (over write date/time)
lcd.print(F("BATTERY LOW!! ")); // Print battery warning text
lcd.print(Unit[0].BatVolt / 100.0, 2); // Print battery voltage
lcd.print(F("V"));
setPortLOW(PORTD, 3); //Turn off the GPO pin (looks like a flash of light)      
GPO_state = 1;
}

else if (Output_WGust >= 45) // Wind Warning
   {  
setPortHIGH(PORTD, 3);
lcd.setCursor(0, 0);
lcd.print(F("!HIGH WIND "));
lcd.print(Output_WGust, 1);
lcd.print(F("km/h!"));
GPO_state = 1;
   }

else if ((Output_T_Out / 10.0) >= 30) // Temperature warning above 30
   {  
setPortHIGH(PORTD, 3);
lcd.setCursor(0, 0);
lcd.print(F("!HIGH TEMP.  "));
lcd.print(Output_T_Out / 10.0, 2);
lcd.write(B11011111);   // Degree Symbol
lcd.print(F("C!"));
GPO_state = 1;
   }

else if ((Output_T_Out / 10.0) <= -0.01) // Temperature warning below zero
   {  
setPortHIGH(PORTD, 3);
lcd.setCursor(0, 0);
lcd.print(F("!LOW  TEMP.  "));
lcd.print(Output_T_Out / 10.0, 2);
lcd.write(B11011111);   // Degree Symbol
lcd.print(F("C!"));
GPO_state = 1;
   }
else setPortLOW(PORTD, 3);


Next step I will be looking at trying to add is a "high rain rate" alarm, but at this stage do not know how to check for this condition. Time will tell.
Reply


Messages In This Thread



Users browsing this thread: 1 Guest(s)