Gmail API Triggered Flag

1,158

21

3

"Mail Man" is a simple arduino based gmail notifier. It leverages the gmail api along with arduino serial communication to allow the arduino to control a servo and hence wave a gmail flag when a new message is received.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Items for This Project

You will need the following items for this project:

  1. An Arduino. ( I used an Arduino Uno)
  2. A small micro servo
  3. 3D printed flag.

Step 2: Flag

3D print the flag using the attached stl file. The servo from adafruit will come with 2 small screws that can be used to lock the flag onto the servo hand.

Step 3: Code

Python

This project will use a python script to make calls to the gmail api and an arduino scrip that will activate the servo. The python script will recognize whether a new email has been received by comparing the most recently stored email_id (an identifier used by the api to differentiate emails). The script will make this check every three seconds. If a new message is received, there will be a discrepancy between the email_id stored and a message will be sent to the arduino to trigger the servo.

Arduino

The arduino will be listening on at a baud of 9600. If a new message is received, it will rotate the servo.

please refer to this git repo for code - Notification Code

Step 4: That's It

Once the code is setup as mentioned in the repo, you should be good to go.

Think of creative ways of fastening the servo to your machine. I 3d printed a small hook (it is imperfect) and taped the servo to it. The hook is used to hang the servo on my screen.

Enhancement ideas.

  • Package the arduino and servo in a small box.
  • run a cron job to run the python script
  • try using google apps script.
  • use a raspberry pi instead of an arduino.

First Time Author Contest

Participated in the
First Time Author Contest

Automation Contest 2017

Participated in the
Automation Contest 2017

Makerspace Contest 2017

Participated in the
Makerspace Contest 2017

Be the First to Share

    Recommendations

    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    3 Discussions

    None
    JustABrokenRobot

    2 years ago

    It would be better if could stay straight still because if you are out and leave the PC opened you will see it from far that you have received a mail, this project(im not saying it is bad i really like it and well done to you because you think about it and you must know that i vote it for both challenges)but this project is only if you ARE at the computer so you can see it go up and down :) Good job again!!!

    1 reply
    None
    sher10JustABrokenRobot

    Reply 2 years ago

    Thanks for the suggestions. Will try and make a version with a raspberry pi or phone

    None
    Suisho

    2 years ago

    This is so cool!! im going to make one too. like today!