Shop OBEX P1 Docs P2 Docs Learn Events
Connect to BS2e over phone lines to transmit data — Parallax Forums

Connect to BS2e over phone lines to transmit data

jgradejgrade Posts: 7
edited 2008-04-23 14:32 in BASIC Stamp
I have an application where I need to be able to "call" a remote location using POTS and I assume a modem to gather remote data. I other words, I need to have my PC dial up the Stamp and get readings on the I/O ports to see what is happening at the remote location. I am capable of writing the code for a VB application to automate the process, but do not know how to interface the Stamp. Electronics are a hobby and I would put myself in the intermediate/beginner category.

Before it is suggested, I cannot use IP or any other network protocol. The remote location is a mechanical room far away from any internet connection so my only option is to use a phone line. The application will only gather static data and not streaming, I.E. what is the temp of the water. The sensors and programming don't seem to be an issue at the moment, just how to transmit the data.

I have found a little information concerning connecting a Stamp to an external modem, but not enough to even start. Besides, if possible, I don't want to have to source a modem every time I build this device. The data I need to send is very small. All the data would be represented as an integer or boolean.

Does anyone know of a modem board peripheral for the Stamp line?

Thanks in advance

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2008-04-21 18:08
    The nice thing about an external modem is that the interface has have changed very little in 10 years or so. And they're really inexpensive.

    One issue is most modems want an "analog" line -- while many office phones use a "digital" connection.
  • jgradejgrade Posts: 7
    edited 2008-04-21 19:01
    I thought about the digital or VoIP issue in some accounts, but I know that have to have at least one POTS line. If I thought I could get a signal, I would try cellular but it's spotty in some of the locations. I will have to look at some external modems to see cost and size.

    What is the best way to connect the two? I have a super carrier board for prototyping; should I use the serial connection or create my own using a few I/O's? Again, the electronic part is tricky for me. A schematic would be great if anyone knows of one.
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-04-21 19:13
    I think a single MAX232 chip with 4 capacitors and a DB-9 would be sufficient. That would give you two inbound and two outbound signals.
  • jgradejgrade Posts: 7
    edited 2008-04-21 19:39
    I have been looking at the Cermetek modems. The problem is that the newer modems do not have UARTs built in. I know some PICs have built in UARTs but I am not comfortable programming with PICs. Any suggestions as to a modem on a chip or a simple UART solution?

    I will look into the MAX232. That chip comes up over and over in discussions about RS232.
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2008-04-21 20:58
    I don't think you will find a modem with a UART built in. But the Stamp does the UART function with SERIN and SEROUT. If you use a modem module like the Cermetek CH1786, it will take signals at TTL levels directly to/from the Stamp. Parallax used to sell an app-module using the Cermetek modem, and the manual for that is probably still online somewhere.

    I have some information about the modem/stamp connections here:
    www.emesys.com/BS2modem.htm

    At one point in time, I got a pile of old Macintosh 2400 baud modems at less than $1 each. Those were designed to run off of 5 volt power from the desktop bus, so it was a natural for use with the Stamp.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • jgradejgrade Posts: 7
    edited 2008-04-21 21:25
    I saw the AppMod but noticed it was discontinued. I did some searchine and found the SocketModem by MutliTech. I think it will work, but am waiting for the development guide to get more information. I can buy a single board for $25. Not to shabby but again am lost on the connection to the Stamp.

    Tracy: Thanks for the link i will read closely.
  • Andy FoxAndy Fox Posts: 46
    edited 2008-04-22 03:17
    Once upon a time Parallax did offer a nice solution: the Modem AppMod:

    www.selectronic.fr/includes_selectronic/pdf/Parallax/Stamp-modem1.pdf

    It was based on the Cermetech chip as mentioned above. Yeah it seems to have been discontinued (yet again a perfectly useful product abandoned). You might be able to find one on eBay, but for quantities yeah I guess you might be up a creek on that one.

    -Update-

    Hang on... check out these products. I think one of these might suit your needs:

    www.radi.com/?gclid=CMLb9cDd7ZICFQYNswodBm9n4g

    Post Edited (Andy Fox) : 4/22/2008 3:34:32 AM GMT
  • stamptrolstamptrol Posts: 1,731
    edited 2008-04-22 11:59
    I'd use any commercially available, Hayes compatible modem. The 2400 baud ones are more than fast enough for what you're doing. They are approved for connection to a phone line, have good indication of their status by LEDs, and probably you can power the Stamp from the modem. At yardsales, you can get them for a couple of bucks each. (Get the wall wart, they are usually AC output).

    The modem's serial interface will work quite nicely through the Stamp without extra parts, although you can add a Max233 or 232 if desired.

    In a barebones setup, you would use Hyperterminal and the PC's modem to call the Stamp's modem. When they connect, the Stamp would spit out the data and you can read it on-screen or capture to a file.

    Of course, there's nothing to stop one Stamp and modem from calling the other and using the data to display it on an LCD screen or use the data to carry out some control function.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • jgradejgrade Posts: 7
    edited 2008-04-22 15:08
    Thanks Andy. I have e-mailed tech support for a data sheet. I find it amazing that a company like that would not have a data sheet available as a link on the site.

    stamptrol: The backend (or frontend depending on how you look at it) will be some VB code that I am writing to automatically poll the accounts during off hours. I was staying away from the external modem route just because I need some consistency in the product and am somewhat restricted by size

    A bit off topic, but what is the best way to store data during power loss with a stamp, I.E. flash etc.
  • stamptrolstamptrol Posts: 1,731
    edited 2008-04-22 16:59
    For what its worth, the beauty of the old-modem route is that by sticking to Hayes compatible "AT" commands ( which a great number of manufacturers did), you can replace the modem without changing the Stamp code.

    There are several storage options based on the SD card format. I think Hitt Consulting has one and SparkFun has a couple of models. Straightforward serial communication on the Stamp side, PC compatible file format on the SD card side.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Andy FoxAndy Fox Posts: 46
    edited 2008-04-23 13:34
    jgrade said...
    A bit off topic, but what is the best way to store data during power loss with a stamp, I.E. flash etc.

    I2C or SPI EEPROMs are a popular choice for storage temporary data (depending on the amount of data and the number of rewrites expected).
  • jgradejgrade Posts: 7
    edited 2008-04-23 14:07
    Andy Fox said...
    jgrade said...
    A bit off topic, but what is the best way to store data during power loss with a stamp, I.E. flash etc.

    I2C or SPI EEPROMs are a popular choice for storage temporary data (depending on the amount of data and the number of rewrites expected).

    Thank for the reply. I have done research and the basic read and write should work for the data collection. I am only looking for a snapshot; I.E. total gallons used and then write to a memory location in case of power loss since this variable is a total. So I would write the data to the location say each 10 gallons since this number does not have to be exact. After each successful remote call, I would reset the data and let the remote software totalize the volume.

    Just to verify, the stamp works on TTL levels correct? I have found a modem by Radicom for ~29.00 that is TTL so in theory I could connect it directly to an I/O and use the serin/serout. Or am I completely off base here?
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-23 14:32
    The Stamp works on +5V logic levels which is what is considered TTL most of the time. I've seen other logic levels described as TTL (+3.3V for example), so do check. It's always a good idea to use 220 Ohm resistors in series with the Stamp I/O pins when connecting to "outside logic" to protect against short circuits "by accident". There are some cases where you might not want to use the 220 Ohm resistors, but they're uncommon (like if an LED is connected to the external input and the 220 Ohm resistor will prevent the input from "seeing" a logic low).

    For storing a small amount of data (under 50 bytes or so), consider a real-time-clock chip with a backup battery and on-chip memory. The DS1302 and DS1307 come to mind for this.
Sign In or Register to comment.