loading

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

<p>this Email.vbs is windows dependent, what would be this vbscript implementation on linux to send key &quot;a&quot; ?</p>
<p>I'm not a linux user, so I really can't say. But if I were to guess, I'd try looking for some sort of program (Maybe AutoHotKey?) that is a simple *.exe (or whatever Linux uses) that can type a keystroke when run. I'm sure that there's something out there. Since Linux is open source, it shouldn't be too hard to find.</p><p>Cheers,</p><p>G</p>
<p>Hello,</p><p>Can I set a rule in outlook to start a program which sends different letters?</p><p>I want to create a module connected to an RGB led which detects certain phrases, to which the led responds with different colors.</p><p>Any ideas?</p>
<p>Easy. Look in the pics of step 3. you'll see that i set the program to run when my name is in the recipient box. But there was also another checkbox there that said, 'run on specific word', or something like that. Just make two or more vbs programs, each one for a different color. </p><p>Ex: Arduino receive '1', turn red. Arduino receive '2', turn blue.</p><p>Then have outlook open the corresponding vbs according to what phrase and color. Hope this helps,</p><p>Gogoguy.</p>
<p>means the computer should always turn on ? or in sleep mode?</p>
<p>Keep your computer on. It has to be on, or otherwise it can't see the email as it comes in.</p>
<p>I want to thank <a href="https://www.instructables.com/member/Volthaus%20Electronics%20Laboratory" rel="nofollow">Volthaus Electronics Laboratory</a> for inspiring me to start putting my arduino projects on instructables.</p>
<p>Great work gogoguy! Featured by Arduino World on Face Book! </p><p>https://www.facebook.com/arduino24x7</p>
Thanks!

About This Instructable

4,780views

29favorites

License:

Bio: I like coding.
More by gogoguy:The Bubbles of Awesomeness Sweet Child o' Mine - Solo Sweet Child of Mine 
Add instructable to: