A sign for my bedroom door which displays what I'm doing right now
C++ Arduino Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
CAD
bin
firmware
Door Sign Breadboard.png
Door Sign Fritzing.fzz
Gemfile
Gemfile.lock
LICENSE
README.md

README.md

Door Sign

An LCD sign to go on my door that displays what's currently happening in my calendar, called "Door Sign" because nobody who was sitting around me at the time had a better name.

Photo

Hardware

You need:

Wire it up like:

Breadboard

Firmware

Make a new project in the Spark online IDE named whatever you want, then copy in the contents of door-sign.ino. Click the + button in the tab bar of the IDE, and add a .h and .cpp file for the LiquidCrystal library.

Then flash it to the Spark with the little lightning bolt button.

Software

Put all the code on a Heroku thing.

Obtain a Google Client ID and Secret:

  1. Go to the Google Developers Console.
  2. Select a project, or create a new one.
  3. In the sidebar on the left, expand APIs & auth. Next, click APIs. In the list of APIs, make sure the status is ON for the Calendar API.
  4. In the sidebar on the left, select Credentials.
  5. In either case, you end up on the Credentials page and can create your project's credentials from here.
  6. If you haven't done so already, create your OAuth 2.0 credentials by clicking Create new Client ID under the OAuth heading. Use the "Installed Application" option, with "Other" as the platform. Next, look for your application's client ID and client secret in the relevant table. You may also create and edit redirect URIs from this page.

Add your config:

heroku config:set CLIENT_ID="abc" CLIENT_SECRET="def" SPARK_ID="mysparkid" SPARK_TOKEN="mysparktoken"

Spark ID is the device ID for your core that can be found in the IDE by clicking the target symbol in the bottom left and then the arrow next to your core. Your Spark token can be found in the settings page of your Spark IDE.

Next, find your calendar IDs

  1. Visit Google Calendar in your web browser.
  2. In the calendar list on the left, click the down-arrow button next to the appropriate calendar, then select Calendar settings.
  3. In the Calendar Address section, locate the Calendar ID listed next to the XML, ICAL and HTML buttons.
  4. Copy the Calendar ID.

Edit bin/door-sign and add the IDs and each calendar's friendly name.

Next, you need to obtain an access token (refresh token). To do so, run this command and follow the instructions:

heroku run bundle exec ruby bin/authorize

Then add a scheduler to run the update script:

heroku addons:add scheduler

Then set it up to run this command every ten minutes:

bundle exec ruby bin/door-sign

Then stick the sign on your door and be happy.