Sending data over a phone line
homosapien
Posts: 147
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
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
Jeff
-Phil
Hack an old cassette-based telephone answering machine and replace the cassette audio with a text to speech module speaking the temperature.
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?
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)
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
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.
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
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
Sensaphone http://www.sensaphone.com/sensaphone_400.php
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.
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.
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.
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
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.
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.
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!
-Phil