Shop OBEX P1 Docs P2 Docs Learn Events
Sending data over a phone line — Parallax Forums

Sending data over a phone line

homosapienhomosapien Posts: 147
edited 2013-02-08 13:12 in General Discussion
I am looking to monitor the indoor temperature of a vacation cabin, to detect potential freeze-ups during the winter due to a heating system malfunction. The cabin to be monitored does have a phone line (and phone) and AC electricity available. I plan on building a Propeller based solution.

The first quick and dirty solution to occur to me is to hack a cheap phone into a low-speed, DTMF based modem - I would use the prop and small speaker to generate DTMF tones that could transmit the monitored temperature, and perhaps a microphone to allow the application to listen for potential commands. I'm thinking the hack of a cheap phone with prop-controlled speaker and microphone would allow me to avoid having to deal with Telco line voltages. The data to be transmitted would probably be a couple of bytes of information once a day, so communication speed is not a priority.


Questions:

Is this solution making more work than is really needed? Is there a safe and easy way to interface with the telco voltages that would negate the hacking of a phone?

Would it be easier to try to find some old modems that I could use for communications, so I don't have to figure out how to create, and more importantly, decode DTMF tones? Any model suggestions?


Thanks in advance,

Nate

Comments

  • FranklinFranklin Posts: 4,747
    edited 2013-02-06 18:14
    Would it be easier to try to find some old modems that I could use for communications, so I don't have to figure out how to create, and more importantly, decode DTMF tones?
    I think that is the easiest way to go. You could also get a cell modem if you can get celular where you are and text a message.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2013-02-06 18:14
    A couple external modems and two MAX3232 chips and you'd be in business. (or at least close)

    Jeff
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-02-06 18:26
    Commercial modems include the necessary data access arrangement (DAA) required by FCC Part 68 rules. So, yes, a commercial modem is likely to be your most direct path to a solution.

    -Phil
  • ercoerco Posts: 20,259
    edited 2013-02-06 19:27
    Man up, old school. :)

    Hack an old cassette-based telephone answering machine and replace the cassette audio with a text to speech module speaking the temperature.
  • homosapienhomosapien Posts: 147
    edited 2013-02-06 20:10
    OK, I was mulling the situation over a bit since my original post, and I'm still thinking the old telephone hack is the best way to go (No cell coverage in the camp area). But, I am thinking the data will simply be sent out by having a piezo buzzer send the temperature in a kind of morse binary code to eliminate the whole DTMF business. It would work like this:

    1) The modem-phone would be hooked up in parallel with the normal camp phone (so one could use the normal phone in normal fashion if at camp). The Prop would in monitor the ringer of the modem-phone (via either microphone or voltage detect in the bell).

    2) If the modified phone rang more than 6 times without a pickup (ie, the normal phone was not going to be answered, no one is at camp) the prop would 'pick up' the phone via a relay to open/close the hook switch.

    3) The prop would sound the piezo near the handset ~5 short bursts to allow the calling party be know data was imminent.

    4) Prop would then sound piezo in morse/binary code (short sound = 0, long sound = 1), send 8 sounds for a byte of temp data.

    5) Prop would then 'hang-up' phone via hook switch relay.


    I'm thinking this would not run into issues with the FCC Part 68, the worst I can think would happen is if there was a relay malfunction the phone would stay off the hook, but I don't think that is a criminal offense (if it was, I have a few family members who would already be in hot water....)

    I wouldn't mind going the old modem route, but actually finding/actually getting some old/cheap ones and then figuring out how to interface would probably take much longer than I really want to spend....

    Am I heading in the wrong direction?
  • homosapienhomosapien Posts: 147
    edited 2013-02-06 20:22
    @erco

    LIke your idea, actually already looked into the text-to-speech module, but it is pretty expensive for this job. Also, I am thinking the binary/morse code will allow me to develop a automated prop caller that will call the camp, decode the tones and display the temp for me to see without having to do the calling and listening/decodeing manually...

    Also there is the usual issue of finding and modifying to work such a style answering machine (I have thrown away several over the years, but have none on hand now, of course)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-02-06 23:19
    Modems are still very valid tools for direct communication, and better privacy.

    You just have one device make a direct call to another modem and download to a file with the information required. If you already have 24/7 telephone service in place, why bother with yet another monthly bill for ADSL?

    And with cellphone modems, all sorts of odd ball stuff can be done -- like monitoring a boat's bilge pumps and assuring dock side security. Getting wiring out to the end of a pier is often impossible, and even then it is hard to maintain.

    So, one end can be a BS2 or a Propeller. The other end can be a regular computer or if you have the right router/gateway with USB port, you can have that take messages from a modem (think of a Spinerette from Modem RS223 to LAN or a USB modem direct to a router/gateway's USB port).

    I have a router/gateway with modified Linux loaded that could do this and is already always on. I use the USB port to extend the Linux file system for added storage and more software (Try OpenWRT) and a second USB for a printer server. But the router/gateway also has two RS232 ports if I am wiling to hack into it and set them up.

    I am not very interested in DIY modems as the interface to the telephone company is supposed to have specific devices and lightning protection. And you have to get DTMF working right - that can be tricky to match impedances.

    Need an old 56K modem... try EBay or Egghead. I saved my 56K modem for future projects. Think about exactly what you want and buy a pair (one for each end)

    http://www.ebay.com/sch/i.html?_trksid=p5360.m570.l1313&_nkw=56K+modem&_sacat=0&_from=R40
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2013-02-07 03:19
    The most reliable modem we have found so far is the multitech with the voice modem firmware. http://www.multitech.com/en_US/PRODUCTS/Families/MultiModemZBA/ ZBA-V

    The main difference between voice and non voice is that the voice firmware dtmf detection is much better.

    These are what is inside - http://www.multitech.com/en_US/PRODUCTS/Families/SocketModem/ , however without a voice modem option. Last time I tried, with some semi-devious methods, you could put the voice firmware on a non voice model. Not sure exactly how to program these modules, might need a dev kit?

    With an SD card to buffer the data you could do voice prompts. (warning! significant time outlay for that idea) Its also possible to send texts to certain carriers that support TAP paging. If you are quick with your typing and prefigure the checksum, you can send a text from hyperterminal or the like.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-02-07 04:10
    I don't think I'd buy another modem with being sure of ample documentation. So if you have an eye on a particular brand and model, download the manual and such.

    After thinking about this a bit, I'd likely have the modem pick up after 8 or 10 rings if it will configure as such. I'd have the remote call once a day and leave a normal status message. That means the a Real Time Clock might be a needed feature on the remote. And from home, I'd like to be able to call the remote at any time and get a status report immediately delivered via a call back or input from a touch tone. Much depends on how confident you are with programing modems, microcontroller, and the computers involved.

    This project is an excellent on-going case study in remote site communications. So start out simple and every few months you might add another feature that you have developed.

    When to call? Well if it was once a day, you could have the remote device serve as your personal wake-up call each morning. Just don't answer the phone and let the modem kick in. If that isn't acceptable, you may have to consider a dedicated modem line and I am not sure that is any more attractive than installing ADSL at your cablin. Another alternative is to have the remote call when nobody is home if there is a reguilar period where everyone is away from the house. And if some one does pick up the hone, there should be some way to verify the message has been successfully delivered (a receipt acknowledge). In that way, if there is an accidental pickup by a real person, the modem will make another delivery attempt in 15 minutes (this could also act as a snooze alarm on that wake up call).

    At the remote site, you require a modem that can make out-going calls. Most do feature this, especially fax modems. But you will need to study how to code a serial message to have the modem send control messages.

    Here is a link to the AT control codes http://www.zoltrix.com/support_html/modem/USEMODEM.HTM#Issuing AT Commands

    Here is something to get started with. http://www.tldp.org/HOWTO/Modem-HOWTO-4.html
  • homosapienhomosapien Posts: 147
    edited 2013-02-07 05:44
    @Loopy I like the idea of the 56K modems - I was searching for 'old modem' and that was not working out well. My experience with modems has been very limited, usually plug it in, configure through vendor supplied software, fire and forget. Using a modem is going to be a lot more learning on my part (as opposed to the homebrew-piezo-bit-bang-phone-hack I had come up with), but will probably result in a device/software I could implement in other projects that need a 'professional' look.

    I have done a quick perusal of your AT command link, I'm wondering if there is a 'standard' for AT commands for modems, or are there a bunch of different command sets for different manufacturers? I see the basic 'Hayes' AT command set here:
    http://www.computerhope.com/atcom.htm and they appear to be the same as the Zoltrix.

    So I guess my next question is what do these AT commands actually do - for example, when you send a 'ATDT800551234 <enter> into a terminal window, what is sent out over the USB - ASCII chars of the command, or is there more translation behind the scenes?

    I'm thinking that most modem manuals are going to detail how to use their propitiatory auto-setup software, not tell me the nuts and bolts of what their devices want on a bit-wise level, which I will need if I am going to write a propeller obj that communicates with the modem.


    Nate
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2013-02-07 06:00
    There is a product that is designed to meet your goals
    Sensaphone http://www.sensaphone.com/sensaphone_400.php
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2013-02-07 06:01
    Multitech docs have all the AT commands their modem supports, its pretty comprehensive. There are quite a few commands that work across manufacturers, but many won't give you that info. You are best off looking at the chip on the modem, and searching for docs that way. However, companies like Multitech are putting their own firmware in an LSI?? chip, so thats not always foolproof.

    Beware here, that many modems do not support, or have flakey dtmf decoding support.

    The best way to learn is to plug in a modem, connect it to a terminal program, and start typing. I like digi-maxstream-XCTU about the best, although prop terminal should be fine also.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-02-07 06:58
    I guess the caller ID feature would be extremely useful to verify that the real call site is contacting you. In this way, other modem driven or fax machine driven auto-callers could be ignored... as well as voice call. That would mean not having to depend entirely on the number of rings to connect.

    There is quite a bit of code to learn to handle a modem well, but that is the fun of it all to me. I guess I should pick up a 2nd modem and do something creative.

    ~~~~~
    The more I think about the Spinnerette, the more I like the destination modem connnected to it. It has a RTC and an SDcard ... so it can log data from the remote, sit on your LAN and merely generate an email that the data has arrived. If you want to check the log, you go into the Spinnerette's SDcard (maybe pull the card and do a spread sheet of the data).

    At the remote a Propeller Protoboard would offer a lot of flexibility for whatever your sensor scheme might be. But I personally I was wanting a RTC added to the board, so that it would be able to send messages at a predictable time. It would work, but read below.

    On the other hand, you could just rely on the Spinnerette for its RTC and make two calls - call out to the remote to request a data report and the remote would then call back or immediately download a report. That certainly has a lot of pluses ... less hardware costs, one less clock to set, and the remote would not have to be visited to change the call schedule. In other words, forget the RTC on the remote site device.
  • kwinnkwinn Posts: 8,697
    edited 2013-02-07 08:07
    I am surprised no one (including Phil) has mentioned Phil's Bell 202 Modem object. From what I read in the downloaded documentation it sounds like it would be perfect for this if you used an old phone to provide the DAA.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-02-07 08:18
    @kwinn
    The trade offs are significant. If you really want to construct a modem from scratch, you may loose a lot of the functionality unless you provide all of the code for AT codes, proper isolation of the device from the telephone line and so on.

    If you buy a 56K modem on Ebay, all you have to do is provide the RS232 interface and exploit its features. The powers that be keep driving us to buy the black box rather than build from scratch as the results are usually quicker to achieve.

    Economies of scale not only make big enterprises more efficient and cost effective; they make the rest of us reluctant to start from scratch unless we really want to learn something.
  • kwinnkwinn Posts: 8,697
    edited 2013-02-07 13:00
    @kwinn
    The trade offs are significant. If you really want to construct a modem from scratch, you may loose a lot of the functionality unless you provide all of the code for AT codes, proper isolation of the device from the telephone line and so on.

    If you buy a 56K modem on Ebay, all you have to do is provide the RS232 interface and exploit its features. The powers that be keep driving us to buy the black box rather than build from scratch as the results are usually quicker to achieve.

    Economies of scale not only make big enterprises more efficient and cost effective; they make the rest of us reluctant to start from scratch unless we really want to learn something.

    I am in 99.44% agreement with what you say, but in this case the op already has to buy/build a propeller board. Monitoring a temperature will take very little cpu hp so there should be lots of resources left over for the modem. By connecting the prop output on the handset side in the telephone you can use the phones DAA, and only 2 additional relays would be required, one in parallel with the hook switch to access the phone line, and one for pulse dialing. The only additional items that might be of use are dial tone and ring detection.

    Now that I think of it, the modem software may not even be required. The pulse dialing relay could be used to send the temperature data.
  • homosapienhomosapien Posts: 147
    edited 2013-02-07 19:52
    @Ron - I see your post and get the point, but when it is a choice of buying something that will work and building it myself (hopefully at lowish cost and not too many nights of work) I almost always go for the DIY. Foolish, I know, but I cannot help myself... Also, it seemed the linked item had no posted price, which usually means 'if you have to ask, you cannot afford it' haha

    I am probably going to order a couple of the 56K USB modems to fool around with tomorrow (during what is being billed as yet another 'Epic, Historic, This-Never-happens, 100 year snowstorm here in NE). I have not spent much time working with modems and their AT commands, or the USB port directly, so this will be a good chance to learn.

    @Kwinn - Phil's Bell 202 Modem object and the posts about it had come up in my searches before I posted - Connecting to the POTS with hardware I personally assembled makes me a little nervous. I don't mind crashing my own system and smoking a few components, but I would rather use a $5 mass produced product that hopefully was tested and passed Re the ol' part 68 FCC thingamajig (particularly isolation). It's the whole 'risk-adverse' mindset...


    Nate
  • HumanoidoHumanoido Posts: 5,770
    edited 2013-02-08 00:21
    Gestetner has old machines that may do what you want. Check out some of the dedicated office supply and service companies that handle old machines.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-02-08 03:20
    I've been pondering some more about what to do with my 56K modem.

    The first dilemma is rather amusing. I don't have another telephone number to call... or at least, I don't think so. For ages I presumed that I'd use a pair of modems for calling back and forth, but it seems to me with the right scripting, one can actually call one's ISP and drop off an email. Check with you ISP for a dial-in modem for roaming service... it just may be free.

    In that context, you wouldn't need but one modem.

    Gestetner? What kind of machines. I can only think of mimeograph.... messy blue ink and stinky printouts.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2013-02-08 04:38
    Using usb is going to be the same, as you'll use a virtual com port. It would be better to get an rs232 modem and use a ftdi converter, that way when you go to do the prop thing, none of your commands will change.

    Windows and usb modems actions can be changed by the .ini file. I have used a usb modem that with one driver supported Voice, and the other didn't.
  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2013-02-08 07:38
    homosapien wrote: »
    @Ron - I see your post and get the point, but when it is a choice of buying something that will work and building it myself (hopefully at lowish cost and not too many nights of work) I almost always go for the DIY. Foolish, I know, but I cannot help myself... Also, it seemed the linked item had no posted price, which usually means 'if you have to ask, you cannot afford it' haha

    Nate

    The Sensaphone is rather expensive but I saw a used one on eBay for $100. I understand that DIY approach though. The ability to customize a device is certainly a plus!
Sign In or Register to comment.