Introduction: Arduino Servo Gmail Notifier

About: Raspberry Pi & Arduino explorer

Hello everybody.

The purpose of this project is to build an Arduino servo gmail notifier. It is a simply and easy to build project for your gmail inbox. The base will be an arduino with a sub-micro servo.

Every time that you have new e-mails the servo will move to notify you and after you read them, it will return to the previous position.

Lets start with the list of the hardware we need for this fun project.

Step 1: List of Hardware

We need the following items:

1.An Arduino. (i used a Yun) Buy an arduino

2.A sub-micro servo. (i used a Hitec HS-55) Buy a sub-micro servo

3.A pc. (I used my laptop with Linux. This project works also fine with Windows & Mac)

4.A white piece of paper & a pen

5.Liquid glue (i used a very strong super adhesive from Holland) Super glue

6.An old floppy disk (Probably somewhere in a closet or a drawer or inside an old pc)

7.3 jumper cables male-to-maleJumper cables

Lets go now to the next step and install all the software to the pc.

Step 2: Software.

List of software:

1. Arduino IDE (go and download it from here Arduino IDE. I used version 1.6.0 and if you want to work you have to install 1.5.4 and above due to the servo library).

2.Pyserial (go and download it from here Pyserial 2.7.)

3.Python 2.7 (go and download it from here Python 2.7 / Python for Windows / Python for Mac OS

4.Ardumail (go and download it from here Ardumail) When u download the zip you will find 4 files inside.The arduino.ino code, the and two text files. Extract only the

Lets go now and start build our notifier.

Step 3: Build the Notifier

Ok lets start building our notifier:

Step one: Take the old floppy drive and tear it down to its pieces. Put the plastics to a recycle bin and hold the metallic parts. Take and use the one that fits to your servo. Probably it will not be like my own but you can modify it anyway.

Step two: Take the glue and attach the servo to the metallic part of the floppy . Hold it for a couple of minutes.

Step three: Cut the white paper so it can fits to the metallic part and make a hole for the servo.

Step four: Apply the head for your servo from the horn set. I used the biggest.

*Notice: don't write nothing to the paper before you test it.

Step 4: Connect the Servo to Arduino.

Now that our notifier is ready we must connected it to the arduino.

First we must expand our servo cables with some simple jumper male-to-male cables.

Second we have to find the color code of our servo.Mine is a hitec and the color code is:

  1. Black cable to the GND pin of the arduino
  2. Red cable to the 5V pin of the arduino
  3. Yellow cable to pin 9 of the arduino

Connect the servo to arduino and we are ready to test it but not with our code.We will use the Sweep code of the IDE.

Third Open the Arduino IDE --> File --> Examples --> Servo --> Sweep and upload it to the arduino.

Now that our hardware is working with the software, we continue to the next step.

Step 5: Allow Your Gmail Account Access to Less Secure Apps .

In order to use the python script we must first allow our google gmail to use less secure apps.

You can find the full documentation here Google less secure apps

Turn on the Access for less secure apps from here Google less secure apps on/off

Step 6: Modify Python Script and Test It.

Ok we are heading to the end. One step to finalize our project

In this step we will :

  1. Modify the python script.
  2. Talk about the arduino code.
  3. Test the notifier.

Python script. I am using a Linux based system and it is much easier for me to use the command line. Open a terminal and cd to your folder where you download the ardumail zip from the github in step 3. Use a text editor and open the file example i used the command sudo nano We must change 3 things:

    1.ser = serial.Serial('/dev/ttyACM0', 9600) this is where your seial port goes. Open the arduino IDE and look down in your right you will see it.

    2 & 3.obj.login('*************', '*********') at the first field you must enter your email address and at the second field add your password.

    Save and exit the python script and continue with the


    Arduino code. The code for the arduino is very simple. It checks if the serial port is available, then if the value is 0 moves the servo 170 degrees and if the value is 1 moves the servo 90 degrees.


    Test the notifier. Upload the arduino code and open a terminal. Cd to your folder with your file and execute sudo python Continue and go to your gmail, send an email to yourself and you will see the servo moving.Then read that email and you will see the servo moves to its previous place.

    You can now take the pencil and draw whatever you want.Or you can let your kid do it.

    *The steps for the Windows and Mac users are the same. Modify the python script, upload the code to the arduino, run the python script send an email to yourself.

    Step 7: Demo Video

    This is the arduino servo gmail notifier that you can:

    1. built with your kids and have fun.
    2. use it with your Raspberry Pi.

    Have fun!!!