Epaper Display and Google Calendar With ESP8266
by AZDelivery in Circuits > Arduino
167 Views, 2 Favorites, 0 Comments
Epaper Display and Google Calendar With ESP8266

Nowadays, many people use their smartphones to take care of everyday things like planning appointments. But with so many notifications coming in, it's easy to lose track of upcoming appointments. In this blog post, we will build a calendar with an e-paper display and an ESP8266 microcontroller that displays upcoming appointments. To ensure that the appointments are always up to date, we access them via the internet using a so-called API interface. One programme that includes this function is Google Calendar, which is also available on many operating systems. All you need is a Google account, which you can create for free if you don't already have one.
Supplies
We need hardware:
ESP8266 microcontroller Nodemcu or D1 Mini
Optional:
3D printed housing
Screws & melting thread
First of all, the display must be connected to the microcontroller. This can either be connected via a cable connection directly soldered, or via a self -cramped cable, which is plugged into the pen strip of the display.
Wiring with a socket bar
Soldering the socket bar as shown
Software
The required software consists of two parts:
1 Google script
First go to the Google Calendar website, register with your account and create a new calendar on the left at "More Calendar". Under this calendar, you will save all appointments that are to be displayed on the display in the future.
Now open the Google Script website, register with the same Google account as above. Next, click on the "New Project" button on the top left,
Now a window opens in which you copy the following code:
Finally, press the blue field “Provide"And choose there"New provision" out of. In the newly opened window, select the deployment option “Web app“.
Now enter a description and change the right of access to "Everyone". In the next step you will be a "Defective ID"Displayed. This is the Api-Key, via which the ESP can later access the data. This must then be inserted into the source code. To test the script, you can open the link below. As a result, the dates of the next 14 days with a start and end date should be displayed separately with a semicolon.
This script only reads the dates from a calendar. If you want to display several calendars, you have to copy the block and insert it with a changed calendar name. (However, only the first 4 appointments of the chain are displayed on the display).
If you want to read further data from your calendar, you will find the necessary information in the Google Developer Docs.
2 Arduino Ide/Platform IO
Arduino IDE
First you have to install the associated libraries:
If you are programming a microcontroller with ESP8266 processor for the first time, you must still Preferences in the Board administrator-URL Copy field: http://arduino.esp8266.com/stable/package_esp8266com_index.json. Then install via the Board manager the ESP8266 Package.
Platform io
Copy the following lines into the Platformio.ini file of your project:
The Sketch
First, the required libraries and the fonts (fonts) installed with the Library display are integrated.
Subsequently structs created for the individual dates and their time. These are then saved in the form of a list of four elements.
After that, variables for the line break are initialized for longer names and for the network.
Now we create objects for the Wificlient, which will later be used By the which will later be used By removing the comment sign of the line.
Below you can set the colors of the title, the appointments and the appointment time, as well as the title.
In the set up() Only the display and the LED status is initialized.
In the Loop () The ESP first connects to the WLAN, during which the status LED flashes. If no connection is still established after 20 seconds, the ESP is restarted. After a successful connection, the display is using the method Display event () described.
The following method establishes a connection to the server, reads the data in the form of a string and extracted By calling up Extractdata () The individual data (start time, name, end time).
In the night function, searches for the semicolons that separate the individual data and then stored this data as a string in the list, in the associated elements.
The following method reads out of the string, which stores time, the minute, hour, day and the day of the week and saves it in struct Time of the individual elements.
The method Convdayname () Convert the English weekday name in the Germans.
Display event () is in the Loop () Called up function to display the event with the handed over on the display.
The following method is called to display a disturbance on the LED status:
Assembly and Operation
Print The housing With a 3D printer and press the melting thread (M3) into the intended holes with a hot soldering iron. Finally, glue the board with the USB socket in the recess and recently screw the display with the right screws from the outside.
After you have connected a power supply, the next four appointments will be displayed automatically every hour on the display. After pressing the button, the appointments are updated immediately. The display will flash several times while describing. This is normal, the color capsules are aligned on the display.