Easy Unread Email Notifier

by Shan Peiris in Circuits > Gadgets

457 Views, 3 Favorites, 0 Comments

Easy Unread Email Notifier

20200505_082953.jpg
20200430_160047.jpg
20200430_160917.jpg
20200505_083146.jpg

Hi All, welcome to yet another Instructable.With the current situation of working from home, I am facing some challenges because I received emails from my Company Time to time.Then I was thinking to make a Desk Notifier which will notify me about my new email and finally I made it. I used the coolest single board Nodemcu to bring the thing in reality. This Desk Notifier will notify you about your new Gmail and will show you the total number of new emails.

Supplies

1X Nextion 3.2 TFT Display

1X Node MCU

1X Red LED

1X 5V 1000mA Power Supply

1X 220 Ohm Resistor

1X AMS 1117 3.3V Regulator

Jumper Wires

Hot Glue Gun

Wire Cutter

Cardboard Box

Showing the Number of Unread Emails

20200430_161432.jpg

To communicate with Google's Gmail servers, we have to establish a secure connection to the server and send a secure HTTPS request with our email address and password. Gmail will then respond with an XML document containing all kinds of information, like (parts of) your most recent messages and the number of unread emails.

To make sure we don't send our Google password to a malicious server, we have to check the server's identity, using the SHA-1 fingerprint of the SSL certificate. This is a unique sequence of hexadecimal characters that identifies the server.

Hardware & Wiring

Untitled Sketch 2_bb.jpg
20200430_132427.jpg

I included a couple of photos above

  • 220 ohm resistor between the LED and D3 pins Wire between GND.
  • The TX pin is connected to the RX pin of NEXTION Display.
  • The RX pin is connected to the TX pin of NEXTION Display.

Set Up Nextion Display

Paste this .tft file in an empty micro sd card. We then place this SD card in the sd card slot at the back of the Nextion Display.If we now power up the display, it will update the code that the display is executing. If we now remove the SD card and power up the display one more time, the new graphical user interface will appear.

Code & How It Works

20200430_134252.jpg

Ok, so here's what's actually going on.

Someone sends you an email. Gmail sees it, and starts your Nodemcu program.The Nodemcu receives the HTTP Response, and that is what causes the LED light bulb to turn on. and also displays the count of unread emails.

Required Files

Downloads

Encoding Your Login Credentials

To get access to the feed, you have to enter your email address and password. You can't send them as plain text, you have to encode them to base64 first. Use the following command in a terminal (Linux & Mac):

echo -n "email.address@gmail.com:password" | base64

Then add it to the sketch. For example:

const char* credentials = "ZW1haWwuYWRkcmVzc0BnbWFpbC5jb206cGFzc3dvcmQ=";

Testing & Summery

20200430_150707.jpg
20200430_160829.jpg
20200430_134317.jpg

Hope this can be helpful for someone and learned as much as I did. You can use all the files shared here and have a go yourself.

Any comments are welcome, if you if you enjoyed it share your feedback and Vote. Thanks everyone and see you soon. Happy making!