Introduction: Gmail API Triggered Flag

Picture of Gmail API Triggered Flag

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

Step 1: Items for This Project

Picture of 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

Picture of 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.

Comments

JustABrokenRobot (author)2017-09-06

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

sher10 (author)JustABrokenRobot2017-09-12

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

Suisho (author)2017-08-28

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

About This Instructable

709views

19favorites

License:

More by sher10:Gmail API triggered flag
Add instructable to: