In the United States and Canada there is a network of radio transmitters operating in the 160 MHz band that send out weather and other such warnings. The current systems use Specific Area Message Encoding (SAME) to send out the messages. The general specifications are:
The NOAA Weather Radio home page can be found here. A well written Wikipedia article is here. While there are plenty of Weather Alert Receivers on the market, I thought it would make a good Arduino project.
You don't really need a special receiver to get the audio. The audio is repeated on AM/FM radio, Television stations and Cable channels. You can even decode streaming audio from the Weather Underground. If you search the internet, you can find some high quality test recordings to play with.
Using an Arduino Uno and a few other external components, I've been able to reliably decode the SAME messages. The complete file including the schematic diagram, Arduino library and sample sketches can be downloaded here.
The library uses many functions in the style that Arduino users should be familiar with. Here are some examples:
Same.begin() // Starts SAME processing.
Same.end() // Stops SAME processing.
Same.available() // Returns the number of characters in the receive buffer.
Same.read() // Reads characters from the receive buffer.
Same.parse() // Used to parse a valid SAME message.
Same.flush() // Flushes the SAME buffers.
Same.fill() // Makes it easy to create your own messages. Added 06/11/12.
The following global variables are created:
uint16_t SameOriginatorCode; // Originator Code in hex.
uint16_t SameEventCode; // Event Code in hex.
uint16_t SamePlusIndex; // Location of the '+' in the string.
uint16_t SameLocations; // Number of locations total.
uint32_t SameLocationCodes; // The actual location codes.
uint16_t SameDuration; // The duration in minutes.
uint16_t SameDay; // The Julian Day.
uint16_t SameTime; // The UTC time.
char SameHeader; // Either "ZCZC" or "NNNN".
char SameCallSign; // The originating station.
char SameOriginatorName; // The full name of the Originator.
char SameEventName; // The full name of the Event.
A status byte (SameStatus) is also available with the following bit mapping:
#define PRE 0x01 // 1 = Preamble detected.
#define HDR 0x02 // 1 = Header detected.
#define MSG 0x04 // 1 = A SAME messsage is available to be displayed.
#define WAT 0x08 // 1 = Warning Alert Tone HIGH during detection.
#define EOM 0x10 // 1 = End Of Message detected.
#define ERR 0x20 // 1 = An Error has occurred.
#define AVL 0x40 // 1 = A validated SAME Message is available to be parsed.
There are five example sketches that demonstrate most of the above features included. County Codes (US), Canadian Location Code (CLC) and Marine Areas are all supported.
The most current version supports the MEGA1280/2560 and is compatable with the Ethernet/SD card shield. It now includes a simple sketch (using the Twitter library by NeoCat) that can send alerts via Twitter autonomously. It was uploaded on August 17, 2012.
Any comments or suggestions are more than welcome!