circuitcellar.com
Magazine Support   Digital Library   Products & Services   Suppliers Directory 
 
 





 

Issue 146 September 2002
Internet Enabling Made Easy


by Fred Eady

APPLYING THE 2124

Now you know how to use the 2124 modem as a stand-alone e-mail generator. By introducing you to Press4Service, I’ve saved you enough money to buy that Gulfstream V and a set of lures. If you’re not the corporate type and need to do some tricks with the CH2124, the 2124 modem is just as easy to deploy with your favorite microcontroller.

Most 2124 modem applications can be effective with only the resources provided by the 2124 modem. There will be applications that require an e-mail to be sent that is relative to more external variables than the 2124 modem can handle natively.

For instance, let’s suppose you’re monitoring door and window activity in a security application. Rather than place a 2124 modem at every door and window that you want to secure, sensors are mounted at each desired location. The external microcontroller is programmed to scan the door and window intrusion sensors. E-mail is sent immediately that details which sensor was triggered. Because of the high level of integration found in the iNet@T command set, this design can be easily implemented.

When a sensor triggers, the external microcontroller, using its software of hardware UART, issues iNet@T commands directly to the 2124 modem. These iNet@T command strings are built dynamically by the external microcontroller depending on the door and window sensor input. For instance, each door and window could be identified by a name that’s associated with a sensor input bit on the external microcontroller.

Assume at this point that the ISP phone number, login name, login password, e-mail passwords, as well as the e-mail From:, To:, and Subject: fields within the 2124 modem were initialized when this modem node was installed. Note that with that information already loaded, the external microcontroller only has to send two iNet@T commands to the 2124 modem to dispatch the e-mail message.

The first iNet@T command would load the dynamically created e-mail message into the 2124 modem’s flash memory. The second command would send the e-mail. Using a Custom Computer Services PIC C compiler, I’ve coded a simple example that uses a PIC16F876 as the external microcontroller (see Listing 1). Although the example code works, you’ll want to add code to check the 2124 modem’s progress and respond to its messages in a real application.