INSPIRATION NEEDED: arduino + e-mail: cool uses?

hey there!*

i have devised a (fairly quick&dirty) way to control my arduino via e-mail. -> details see below.

now i am looking for inspiration as to WHAT to control with this system?
i will motorize my curtains soon to be able to control them (a separate project aims to combine them with my alarm clock to help wake me up).
i could also turn the lights in my room on and off using relays.
but now i turn to you to get some more inspiration as to what cool stuff could be done with the system i have running?

i can control the arduino via serial commands and read out serial data as well, so basically i can do whatever i want, control all pins and read all inputs.

details on the system:
basically it is a visual basic program running on an old laptop hidden in the closet that checks for e-mail every minute (on a dedicated address). if an e-mail is received, its body is simply read and sent via serial to the attached arduino. also, whenever serial data is received from the arduino, it is sent via e-mail. no real processing happens inside the program, it's just an e-mail<->serial interface.
so if i send a mail with the word "arduino" in it, exactly that string is passed on to the arduino, and it decides what to make of it. display on LCD? turn on a certain pin? read an input and send the value back via serial? all happening inside the arduino, the pc just acts as my link to the internet.
if anybody is interested, you may send me a private message and i will notify you as soon as i have documented everything.

so now, what fun would you have with such a system? i am looking forward to your comments! :smiley:

  • sorry if this is not the right board for the topic, it's my very first post here and i didn't find a more suitable board.

relpy this is really cool! Do send me the software you have going, I'd like to take a peek at your code.

I'm currently working on some similar home automation stuff. Currently working on a todo list creator in the kitchen.

Its basicly and LCD screen than uses a potentiomer and a few buttons as a keyboard. After an item is typed up, a send button send the item over the internet to a mysql db.

Next step is to create a vb program that retrieves all the new entries from the database and prints it out into a shopping list.

Hopefully this will keep me from making multiple trips cause I forgot to pick up milk!

Also looking for a few more ideas. I just purchased 5 BBBoarduino.

maaan!
five minutes later, a reply and the first awesome idea! :smiley:
hey that's cool, adding stuff to a todo list!
or, i could place a display on the door of my dorm room and post the status of where i am right now. nice!

i will zip up the vb project when i've worked out some bugs and send it to you!

haha that is really sick actually. If you use a web server that would be way easier. Create a php script that has a text box and a button, . Text gets sent to arduino which displays message. If you use a sophisitcated serial driver, you don't even ahve to worry much about formatting. A cool mod of this would be to use the facebook API and make the display sync with your status update!

too bad i can't set up a server.
our dormitory is hooked up to the university's intranet and the ports for a webserver are blocked. or so i've been told, and it's a technical university.. all those IT students can't be wrong!

so i'm stuck using some indirect way of control. and i wanted to do it without the need of client software, so that's cool. all i need is another pc with internet and a decent browser right now :slight_smile:
and maybe a more compact pc to use as my bridge... but hey, it works!
now all i need is to find some cool use for it.

You wouldn't need to use an in dorm server at all. Two possible options..

  1. Run a php/perl/ruby/python/processing script on your laptop that calls [the facebook api to get your status | twitter api to get the latest message].. send response to arduino

  2. Setup php/perl/.net... application on server outside of dorm. Laptop requests a file from that server, sends results to arduino

-tim

Interesting. I would like to see it being able to set/get temperature if was going to make something like this.

Btw, I think you can save a lot of code space on arduino when the software on the PC 'decrypts' the email and send short commands to your Arduino, instead of sending the complete subject of an email.

The software on the PC has to know anyway what to do after sending a message to your Arduino in case it needs to wait for an input.

hi, thanks for the replies!

@timmah:
i have never used processing, but i've seen it mentioned in some arduino examples. i might try that. has the twitter api thing been done before? any code samples you would recommend?

@CrashingDutchman:
that is true.
however, right now i wanted to devise a very simple way to link the serial interface with an e-mail account and keep it universal. if i do actually build something more concrete, i might take your suggestion and move the processing to the PC, freeing arduino memory. but for now, i'm very happy with what i've got :

come on people, more ideas! :smiley: i am starting to like this forum!

how about this:

get an old large vintage voltmeter and use it to display the messages count in your inbox. use every scale unit for one email.

does it only work in one direction? if it can send stuff out:

get some ir motiondetectors in every part of the dorm and send status to your facebook where you are right now.

"... is in the bathroom"
"... is in the main room"
(if no detection for some while)
"... is not in his room"
(or if you can make it intelligent)
"... is sleeping"
(use some photosensor)
"just turned the light out"

...
...

@bara.munchies

those two are some incredibly awesome ideas!!
i absolutely love the voltmeter inbox counter thing, i think i might at least give it a try with some old and ugly voltmeter i have lying around, and if i find a nice one for cheap, it's done!
have you already done something like this?

and regarding your question:
yes it can send stuff out. while it can only receive e-mail once every minute, it will send a mail immediately when something is received at the serial port.
and the motion detector idea is pretty sweet, too. though i think i just would drive everyone crazy posting something everytime i go to the toilet or go make a sandwich in the kitchen ;D

nice ideas, this thread is cool!

ps: i wish i drank coffee... it would be sweet to send a mail from somewhere to find the cup steaming and ready when i get home! and hacking a coffee machine sounds like fun.

To run a webserver on the University network, change the PORT=80 of the web server to something over 1024. Most routers will leave ports over 1024 alone.

For example:
If you use port=1234
and the web server IP address was 192.168.1.100,
Then the URL would be: http://192.168.1.100:1234
The :1234 on the end overrides the default port=80 in your browser.

ok... how about something like this... say you are offline and your friends want you to come online they just send an email to this id of the arduino with a specific subject and your arduino starts an alarm or starts glowing weird lights all around your room :wink:

I would love to look at your code...do send it to me once you are done

Send me the code to. I am trying to make a Internet control 3d axis thing.

I code VB to.

I am also interested in the VB code you use to read the email and send it via serial. I am currently trying to think of ideas for my senior design project for next semester and I was trying to come up with a way to control the arduino via the internet.

Heres an idea-

Door lock control - I realize your in a dorm so drilling holes in your door probably isn't a good idea, however if you could devise a way to control your door lock, you could lock and unlock it by sending an email which would be helpful if you lock yourself out or if you leave and forget to lock the door.

Why not set your email client to look for keywords in your email and launch an appropriate action through your arduino?

I'd get the email of my cell phone (All cellphones that are capable of text messaging can receive emails as texts) and set my client to check for keywords when receiving a message from my phone.

Then you can control whatever you want by simply texting your email address.
:wink:

To run a webserver on the University network, change the PORT=80 of the web server to something over 1024. Most routers will leave ports over 1024 alone.

For example:
If you use port=1234
and the web server IP address was 192.168.1.100,
Then the URL would be: http://192.168.1.100:1234
The :1234 on the end overrides the default port=80 in your browser.

I don't think that would work, unfortunately. :-/ If the router does NATing, how will the router know which computer on the internal network it should forward the connection to?

I really like the idea of using e-mail like this, but only for alerts or for having regular updates sent to you. For controlling stuff, you'd be much better off if you could get rid of the need to poll info like that.

The only solution I see is this: If you have some programming skills as well as access to a computer on the internet, you could make a server application on that server. Then, you get your laptop to establish a connection to the server (inside -> outside will work) and keep the connection up. If the connection is lost, the laptop tries to re-establish the connection every minute or something.

The server-app would also need to listen to a second port, to accept commands from a frontend written in php (or some other web scripting language with socket support). So..

Laptop:

  1. Laptop connects to server
  2. Keep connection alive, while redirecting any incoming traffic to the Arduino
  3. If connection is broken, wait a minute and retry point 1.

Server:

  1. Listen for connections from two ports above 1024 (one for the laptop, one for the web-frontend)
  2. Relay all data from web-frontend -> laptop -> Arduino.

Web-frontend:

  1. Display graphical stuff of choice, with links going to something like backend.php?data=stuffyouwanttosend.
  2. backend.php gets data, connects to Server, sends, and redirects the user back to the web-frontend.

If course, this has an important flaw, namely the Arduino's inability to send data to the front-end. This is easily remedied by writing another php-script and hosting it with the web-frontend, let's call it log.php. You add an Internet Explorer control to the VB program running on your laptop, and whenever the Arduino sends data, you do an

InternetExplorer.Navigate "http://frontendaddress.com/log.php?data=" + data$

Log.php formats and logs the data and stores it in a file or a database, so that the web-frontend can retrieve it and display graphs, history, current temp/light/etc.

Now for project ideas...

  • I made my Arduino send NEC IR signals to control my tv a while back. Web remote control goes pretty well with my girlfriends new WiFi-enabled cellphone, and can with a little effort be extended to control our dvd-player and other IR-controlled equipment as well.
  • (I also have some vague plans of combining the IR-remote with data pulled from a web tv-guide, so I can "schedule" stuff I really want to see and when it begins, the Arduino+pc sets the right channel)
  • Place simple switches in your doors and log when they are opened and closed (used this to bust my little sis in sneaking around my room back when I lived with my mom ::)).
  • How about temperature and light logging?
  • Control of media playback. It doesn't really involve the Arduino but it goes well with the whole tv-control system. Have a computer connected to your tv, make the ir-remote set the tv to the right channel, launch the right movie on media-computer. Not sure how you'd want to do this.. Perhaps a VB program using either WMP or vlc components, or simply reading up on vlc's telnet/socket control function.

hi you all again :slight_smile:

i am loving the feedback on this thread!

@Mark Bramwell:
as PlastBox said, that is impossible for me sadly (forwarding data inside my intranet).

@PlastBox:
the idea of a web frontend is, of course, the most elegant solution. but as you already noticed, i don't have access to a computer on the internet.
sure there are free hosts with PHP, etc. but that is too complicated for my purposes. i haven't done any more testing anyways. right now it's just a proof of concept.

an update on the project itself: i will be trying the suggestion of using an analog voltmeter as an "unread mail" indicator (for my personal e-mail, not the arduino dedicated one).
if i can find a nice solenoid, i also want to build an analog mail counter using one of these tally counters:


for total mails received.

also, i am planning to motorize the curtains in my room, but i haven't figured out how just yet. a webcam mounted on a stepper motor would also be sweet (sending images as attachments!).

the only progress i have made is buying a 4GB CF card and a CF to IDE adaptor to build a perfectly silent server (booting from the CF card, no fans are involved so no noise at all!). they should arrive in about two weeks, i hope i will have the analog mail notifier ready for then!
(if anybody knows of a good source of 5V analog meters in germany, please let me know! the one i have is not soooo pretty :wink: i also have no clue where to buy a solenoid here)

for the people waiting for the source code: fret not, it should be ready (i.e. presentable) in a few days, two weeks max!

see you!

I have the solution to your router problem! It's so obvious it felt like a slap in the face when it came to me. :stuck_out_tongue:

What is your mail-software doing? Well, it connects out to a server, gets info, and does it's thang depending on that info. Problem is, this protocol doesn't support always-up connections! So my brain goes "damn, what would be an easy-to-implement, ready, free alternative for a protocol where your software can always stay connected to, and recieve messages from the server in realtime?".

Omfg, IRC! Use your VB skills to hack together an IRC client. It's damn simple. Basically you just connect, send USER+NICK commands, reply to PING commands, and react to PRIVMSG commands by sending the content of the message directly to your Arduino (or whatever pre-processing you choose to implement).

IRC and VB tutorial: xtremevbtalk.com

You'd have an always-online IRC bot that you could send commands to using either an IRC client or a web frontend (using php). If you need some help with this, just say so and I will gladly provide whatever help I can. I have written simple IRC clients in both php and VB before, I just haven't used them like this.

I can also help you implement a php-script for logging that works by your VB program fetching "http://frontendurl.com/log.php?data=whateverlogdata" so that logged info can show up on your website in near-realtime (updated every time the system polls new values from it's sensors).

Will that solution do it for your webfrontend? :wink:

So how is your project coming along?