Arduino Servo Gmail Notifier

by Tsartsanis in Circuits > Arduino

10365 Views, 116 Favorites, 0 Comments

Arduino Servo Gmail Notifier

IMG_20151204_022515.jpg
IMG_20151202_174828.jpg

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.

List of Hardware

IMG_20151202_152551.jpg

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-male Jumper cables

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

Software.

python.jpg
arduinologo.jpg
pyserial.png

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 ardumail.py and two text files. Extract only the ardumail.py

Lets go now and start build our notifier.

Build the Notifier

IMG_20151202_152740.jpg
IMG_20151202_154040.jpg
IMG_20151202_154102.jpg
IMG_20151202_154117.jpg
IMG_20151202_154126.jpg
IMG_20151202_154247.jpg
IMG_20151202_154302.jpg
IMG_20151202_155310.jpg
IMG_20151202_153135.jpg
IMG_20151202_153151.jpg
IMG_20151202_154436.jpg
IMG_20151202_160049.jpg

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.

Connect the Servo to Arduino.

IMG_20151202_160304.jpg
IMG_20151202_160329.jpg
hitecconnector.png
IMG_20151202_164552.jpg
Screenshot - arduino-code.png
arduino servo gmail notifier sweep test

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.

Allow Your Gmail Account Access to Less Secure Apps .

Screenshot - secure apps.png
Screenshot - google on.png

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

Modify Python Script and Test It.

arduino servo gmail notifier test 1
Screenshot - python.png
Screenshot - pythonscript.png
IMG_20151202_174347.jpg
IMG_20151202_174724.jpg

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 ardumail.py.(for example i used the command sudo nano ardumail.py). 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('*************@gmail.com', '*********') 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 ardumail.py file and execute sudo python ardumail.py. 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.

Demo Video

arduino servo gmail notifier final

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!!!