Introduction: Arduino Email Alert

About: I like coding.

Hi! In this instructable, I'll show how to trigger an LED when you get an email. The reason I made this is because when I get home from school, I want to know whether I should bother checking my email.

It's very simple.

Here are the components that you will need:

Arduino board $9.99

http://www.amazon.com/LANMU%C2%AE-Atmega328p-Atmeg...

LED Lightbulb $3.30

http://www.amazon.com/Round-Superbright-Light-Emit...

Arduino Wires $1.00

http://www.amazon.com/Jumper-Wires-Premium-200mm--...

Arduino Bluetooth Module $8.98

http://www.amazon.com/Innogear-Wireless-Bluetooth-...

Solderless Breadboard $4.49

http://www.amazon.com/Solderless-Plug--BreadBoard-...

Here are the programs you must have:

Microsoft Outlook Price varies

https://products.office.com/en-ca/buy/office

Putty FREE

http://the.earth.li/~sgtatham/putty/latest/x86/put...

Note: To use this wirelessly, your computer must have bluetooth capabilities.

Step 1: The Arduino Code

Here is the code to upload to your arduino:

int led1 = 13; //LED pluggued into 13th pin on arduino

int state;

void setup() {

Serial.begin(9600); // initialize serial communication at 9600 bits per second

}

void loop() {

if (Serial.available() > 0) {

state = Serial.read();

}

else if (state == 'a') {

tone(led1, 264, 500);

}

}

Step 2: The VB Code

Don't wonder what this is now. You'll understand later on. But for now, here's what you need to do.

Paste the following into 'Notepad':

set ghost = wscript.CreateObject("WScript.Shell")

ghost.sendkeys "a"

Now, save it as 'Email.vbs'.

*Important*

Before you press 'Save', make sure you click on 'File Type: .TXT', and change it to 'All Files'.

Step 3: Microsoft Outlook

Open Outlook.

-Click on 'Rules'

-Click 'Manage rules and alerts'

-Click on 'New Rule'

-Click 'Apply on messages I receive', then click 'Next'

-Click 'Where my name is in the To Box', then click 'Next'

-Click 'Start application', then near the bottom of the window, click 'application'

-In the new window, first change 'Executable Files (EXE)', to 'All files'

-Then, find and select the VB file we made before, 'Email.vbs', and push 'Open'

-Name this rule whatever you want, then push 'Finish'

-Click 'Apply'

Step 4: Arduino

Here's how to hook everything up. It's fairly simple, actually.

You can use a breadboard for this part.

Take your HC-05 bluetooth module and attach the VCC pin on it to either 3.3 or 5 volt pin on your arduino.

Take the GND (ground) pin on your module, and hook it up to any GND pin on your arduino.

Connect the TXD to the RX on the arduino, and the RXD to the TX.

Now, grab an LED lightbulb. Hook it up on your breadboard, with one pin going to GND on the arduino, and another to the 13th digital pin. (Make sure that the polarity is correct)

And that's all for the wiring. You're almost done!

Step 5: Connections

Time to connect your arduino.

Open 'Control Panel'.

Navigate to 'Hardware and Sound'.

Plug in your arduino. The blue light on the bluetooth module should be blinking rapidly.

Select 'Add a Device'.

Wait until you see HC-05 appear. Then, click on it.

When prompted for a code, type '1234'.

Wait until it says that it's connected.

Your bluetooth module should be blinking much slower than before, indicating that it's connected.

Now, find a bluetooth icon on your taskbar. Right-click it, and select 'Open Settings'.

At the top of the window, click 'COM Ports'.

Find the COM port number of the Outgoing port.

Remember that number. You'll be needing it in a minute.

Step 6: Putty

Open 'Putty.exe'.

Click 'Serial'.

Change 'COM1' to 'COM(whatever your number from last step was)'

ex: COM72
Push 'OPEN'.

If you did everything correctly, a new window should open. I resembles 'Command Prompt'. (Black background).

You're done!

Note: Outlook must open right now.

Stay in this new window.

Now, on a different device, say a phone, email yourself something. If you did everything right, then about 10 seconds later, your LED lightbulb will light up! Now you know whether you should bother checking your email when you get home from school!

Step 7: Summary

Ok, so here's what's actually going on.

Someone sends you an email.

Outlook sees it, and starts your VB program.

The VB program types the letter 'a' into a window that's communicating with the arduino.

The arduino receives the letter, and that is what causes the LED lightbulb to turn on.



If you don't have a Bluetooth module, you can connect to your arduino through usb. In putty, type in COM5.

Step 8: Video

Tech Contest

Participated in the
Tech Contest