Can an Arduino send a dialup email message?

Can an Arduino send a dialup email message?
I live on a campground with a remote building where the furnace sometimes quits. The building has a telephone line, but not ethernet, and not (currently) a computer. I'd like to be able to put an Arduino there, have it collect temperature data every half hour or so, and then send a dialup email over the telephone line containing the temperature data. But can I do that with JUST an Arduino, or will I have to have a computer there to do it? Or is there some better to remotely monitor the temperature in the building? Thanks in advance for any suggestions.

Oh, cool idea :slight_smile:

I don't know about creating an actual tcp-ip based dialup connection, but you could take any old external modem and make it dial the phone and send stuff over it to another computer, or have the other computer call it, arduino BBS :slight_smile: Depends on which site can tolerate the ringing (or can turn off the ringer), or the phone charges.

Once you have the data on the other computer then it should be pretty straight forward.

A serial based duino should help, might need a little circuit bending though.

I don't think you can do that entirely with an arduino

What you could do is install the arduino where you need to monitor the temperature and then run up to 4,000ft of cable to a PC and do RS-422 or RS-485 over UTP, you may need some additional equipment to do RS-422 or RS-485

Or you can install a DS18S20 and run 600ft of cable put a 10uf tantalum capacitor across the power supply pin and then plug it into the arduino

:slight_smile:

If you have reliable power in the building you want to monitor then you could provide power to a DS18S20 locally, then provide a common ground and run the common ground and signal cable to your arduino which could be 600 or more feet away from the DS18S20 temp sensor

You can also use a K145

:slight_smile:

"run up to 4,000ft of cable to a PC "

No computer in the building. It does have a phone line. An external modem would be about perfect and it should be easy to make an arduino dial another computer with simple AT commands, or have the arduino answer the phone.

Heres one for $3 plus shipping:
http://cgi.ebay.com/Zoom-56K-V-92-V-90-Modem-External-Serial-Model-3048-New_W0QQitemZ120364573492QQcmdZViewItemQQptZPCC_Modems?hash=item120364573492&_trksid=p3286.c0.m14&_trkparms=66%3A2|65%3A15|39%3A1|240%3A1318

Someone you know probably has something similiar in a closet collecting dust.

I assumed, perhaps incorrectly, that there was a PC within about 4,000ft

In theory a DS18S20 can work at much longer distances also ( beyond 600ft, 200 yards, 182m ) as long as you can give it a solid 4.4 - 5V DC

@OP is the phone line an active telephone line? Is it a PSTN line? Are you paying for it?

If the phone line is not a live phone line you can use the twisted pairs for the DS18S20 or arduino as long as you can ensure no one tries to put 48VDC down the line, which would fry your 5VDC DS18S20 and arduino

:slight_smile:

Wired is more reliable but a wireless module ( Xbee? ) would probably work :slight_smile:

It sounds to me as if an arduino and any external modem should be fine. Three points though... 1: If power is problem or not reliable you could power both the arduino and modem off of a battery. In fact, with a transistor or relay you could have the arduino power up the modem when needed, dial out, and shut it back off. Which leads me to point 2: The arduino only needs to send the temperature or at least a message, when the temperature is outside of normal bounds. No need to dial out every 30 minutes if nothing is wrong. And 3: The arduino serial output is TTL. The external modem will want RS232. You would probably need a MAX232 chip.

You would need to program the arduino to speak XModem or Kermit or something and a computer on the other end with a modem and the appropriate software to talk to

The arduino cannot send email, it cannot really do PPP or SMTP

Now if the phone line is active it has 48VDC on it and could be used to power a small device like the arduino with the appropriate DC to DC step down regulator ( 48VDC to 5VDC )

If you can add repeaters you can build an RS-422 or RS-485 network with 4,000ft segments between repeaters

Phone cable can be used for RS-422 or RS-485 but you have to make sure no one tries to use the cable for regular phone or you'll fry your devices

:slight_smile:

It could just do normal ascii or anything really. It all depends on what is running on the dialed line. If the computer on the other end is running custom software then the arduino could speak to it in a freshly constructed protocol for all it matters. Or, let's say the original poster has a cell phone. If the arduino only calls in case of emergency then one could assume that a mysterious phone call from a virtually unused line is a sign of trouble. Plenty of possibilities.

Yes, active phone lines run 48V but they also spike up higher (usually 90V) when they ring so one has to be careful of that. Also, they don't exactly support a whole bunch of current which is why external modems tend to be powered off of wall warts instead of directly off the line.

Yes, phone lines can be funky :slight_smile:

Which is why it is rather critical to know if the building in question has reliable power or not and we need to know about this phone line

Any kind of solution ( arduino, DS18S20, K145, arduino + modem, or anything else ) will require stable power from some source and probably a battery backup as well

While the arduino is very low power you will need a reliable power source to run it, external modems are very power hungry compared to the arduino

:slight_smile:

Wow, thanks to everybody for all of your replies. I will study them to try to decide the best approach. I'm just starting on this project so it will be a while before I get something ready to try. In the meantime, here are some comments that occur to me:

  1. Sending a dialup email message would be best because the temperature data would be stored as an email message that could be retrieved at my convenience and no other computer/hardware/etc is needed. That could easily be done with a laptop, but, as has been mentioned, it sounds like it would be too difficult to get an Arduino to do it.

  2. The telephone line is an active line and is an extension from the main office, so I don't think it would work to try use the line for a remote DS18S20. I was going to use an LM34 temperature sensor anyway since the interface to the Arduino seems a lot simpler than the DS18S20.

  3. It does seem like an external serial modem is the next best option, although then I have to provide power to both the Arduino and the modem. The power in the building is not entirely reliable. I could run the Arduino off of the telephone line, I think, but I'm not sure how to do that for the modem, which uses conventional 120 volts. I suppose I could take the modem apart and try to supply whatever it needs internally.

  4. In order not to need a dedicated computer elsewhere that the Arduino is calling, I think it might be better to have the Arduino accumulate temperature data in its own memory and then I will call it when I want to know what's going on. I'll have to figure out how much memory is available for data storage. And this would require the modem to be on all the time so that it could listen for my call.

As I said, it's probably going to be some time before I get this working, but thanks again for all of your comments and any additional advice. (Also going to bed now, so I won't be back until tomorrow.....)

The arduino only has 1K RAM and 16K flash ( about 14K usable since 2K is for the boot loader ) so it would be hard to store your program and all your temperature data on the onboard flash

You could use an external data logger http://wulfden.org/TheShoppe/DataLogger/index.shtml

Or an SPI to SD interface and log on a relatively inexpressive SD card ( $5 for 2GB of storage )

Since your power source is not particularly reliable then you should definitely look at some sort of battery backup or a solar battery charger

:slight_smile:

  1. It does seem like an external serial modem is the next best option, although then I have to provide power to both the Arduino and the modem. The power in the building is not entirely reliable. I could run the Arduino off of the telephone line, I think, but I'm not sure how to do that for the modem, which uses conventional 120 volts. I suppose I could take the modem apart and try to supply whatever it needs internally.

Actually, the modem is likely something like 5 - 9v DC. The wall mounted transformer steps it from 120v AC to whatever it is that it uses. I think I've seen external modems that input ac at 9-12V but I think most are DC.

As for the building power, you could run everything off of a battery and charge the battery when you do have power.

  1. In order not to need a dedicated computer elsewhere that the Arduino is calling, I think it might be better to have the Arduino accumulate temperature data in its own memory and then I will call it when I want to know what's going on. I'll have to figure out how much memory is available for data storage. And this would require the modem to be on all the time so that it could listen for my call.

Well, the arduino has 1K ram, 16K flash, and 512 bytes EEPROM. If you store temperature as a signed byte (plus or minus 127) you could store 512 readings in EEPROM or maybe 700 - 900 in ram depending on how much ram you use. You could even use progmem and store things in the flash but it's more complicated. Then you could conceivably store upwards of 12k temperature bytes.

I still say you are better off calling when there is a problem and letting everything stay low power until then. But that would require you have something which it can call. A pager or cellphone perhaps.

Anyway, there has been a lot of ideas posted here. Hopefully they all lead you toward a good solution. Best of luck and don't hesitate to keep chatting until you've got something great!

How far is the building from the main office?

An arduino with the ethernet shield can be 328ft or 100m away from the switch or computer on the other end

You can usually find small low-power Linux computers for about $65 - $100 online ( optionally with solid state storage for the OS ) which could log to an SD card or a hard drive and would be able to send email and would be fully networkable ( wired and WiFi ) and SSHable

One option would be

temp_sensor <====> arduino <====> Low-power Linux PC <=====> communication_interface <=====> remote_system

The communication interface can be ethernet ( 10Base-2, 10Base-5, 100Base-T ), WiFi, RS-422 or RS-485 serial, old schoold modem, wireless ( besides WiFi ), GSM modem, IrDA, or what have you

If you had a GSM cellular modem or something like that you could send SMS messages directly to the Cell phone network

:slight_smile:

Thanks again for your additional comments. After thinking about my goal overnight (while I was asleep !), I think I have been making this project too complicated. What I really need is to be able to check the temperature in the remote building at will. To do that, all I need is a serial modem attached to an Arduino that has a temperature sensor.

The Arduino would have to monitor and answer my incoming call (through the serial modem) and respond with the current temperature. This would serve my purpose and would avoid any problems either with power or with data storage on the Arduino. If I wanted to store temperature data and/or call repeatedly, I could do that with the calling computer.

During operation, if I get a response from the Arduino with the appropriate temperature, then the situation is OK. If I get a response with a low temperature, then I need to investigate the situation. If I get no response at all, either due to a power failure or some other cause, then I still need to investigate. That arrangement would serve the purpose that I am trying to address. A few additional comments:

  1. The remote building is about 3/4 mile from the main office, so I think that's too far for some of the ideas mentioned previously.

  2. I do want a positive response from the system on demand, not just an error message when the temperature is outside of the limit, since the absence of an error message doesn't indicate whether some other problem (such as power failure) has occurred.

  3. If I wanted to find a low power Linux computer on ebay, what's the best way to search for it?

So I think my next step is to try to find a cheap, working serial modem. I'll look on ebay as was previously mentioned. If anybody knows of any other source, please let me know. I want to try to avoid the expensive ones. (I've got a Arduino Duemilanove on order but it's not here yet.) Thanks again.

The remote building is about 3/4 mile from the main office, so I think that's too far for some of the ideas mentioned previously.

The specified outdoor line-of-sight distance for an XBee Pro with a whip antenna
is 4382ft. It may be possible to do this with two XBees -- one attached to a temperature
sensor the other attached to your PC. The XBee has an uC + A/D converter and can be
setup to continuously measure and transmit. IIRC the XBee uC can be programmed
to only transmit a change outside of a range. You can always ping the XBee to
make sure it is alive.

(* jcl *)

I see the modems occasionally at the thrift stores, garage sales, maybe craigslist or freecycle.org. You can buy a new one for less than $30: TigerDirect Sunset

And a serial duino is like $17
http://www.nkcelectronics.com/freeduino-serial-v20-board-kit-arduino-diecimila-compatib20.html

It should be just a matter of having the right serial cable to connect the *duino to your computer (which needs a serial port) and then to the modem and a couple power adapters in the remote building.

Oh, and you need to procure a thermistor, can probably just stick it in an analog port and turn on the pullup resistor.

I like your "call the remote building" plan. You might even set it up so the arduino just doesn't answer when the temp is too low, so you can call it from any phone and will know if you need to take action (It didn't answer, I better get someone over there).

Now that I've thought about it a bit too, it seems that the modem might not even be necessary. It is useful certainly, and saves a lot of headache, but if you want to use an ordinary phone as well to check on the building with more options than "it answered or it didn't" then here is a more advanced plan:

A phone is off the hook at about 680 ohms,
http://www.next.gr/telephone/various-circuits/Phone-Off-Hook-Indicator-l2734.html

if your arduino in the building can listen for the TIP signal and take the phone off hook (a resistor and a transistor or somesuch) then it can send various audio tones/patterns that the human caller, or another arduino plugged into a computer, would be able to recognize as either all-clear, or too cold, or too hot, or too flooded, or???

But it sounds like you have an immediate need, so may be best to stick with the modem approach instead of chasing all the possibilities, can always do that later :slight_smile: I do like this idea though, now I need to try and make an arduino based caller ID :slight_smile: