Arduino Email Alert




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

LED Lightbulb $3.30

Arduino Wires $1.00

Arduino Bluetooth Module $8.98

Solderless Breadboard $4.49

Here are the programs you must have:

Microsoft Outlook Price varies

Putty FREE

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 =;


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'.


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

Be the First to Share


    • Game Design: Student Design Challenge

      Game Design: Student Design Challenge
    • Block Code Contest

      Block Code Contest
    • Clocks Contest

      Clocks Contest



    2 years ago on Step 7

    This recap is a great format for helping people quickly understand your project! Thanks


    Question 2 years ago

    Will it work with LoRa Antenna & Board so you can have longer range?


    3 years ago on Step 8

    email.vbs not sending letter 'a' to putty . so the system not working. Please help


    3 years ago

    That's good but how do you turn off the LED after that?


    Question 5 years ago on Step 1

    hi there whats the software used in coding the program?


    6 years ago

    this Email.vbs is windows dependent, what would be this vbscript implementation on linux to send key "a" ?


    Reply 5 years ago

    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.




    6 years ago


    Can I set a rule in outlook to start a program which sends different letters?

    I want to create a module connected to an RGB led which detects certain phrases, to which the led responds with different colors.

    Any ideas?


    Reply 6 years ago

    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.

    Ex: Arduino receive '1', turn red. Arduino receive '2', turn blue.

    Then have outlook open the corresponding vbs according to what phrase and color. Hope this helps,



    7 years ago

    means the computer should always turn on ? or in sleep mode?


    Reply 7 years ago

    Keep your computer on. It has to be on, or otherwise it can't see the email as it comes in.

    Volthaus Electronics Laboratory
    Volthaus Electronics Laboratory

    Reply 7 years ago

    Great work gogoguy! Featured by Arduino World on Face Book!


    Reply 7 years ago