Project tutorial

Android Things Word Clock © CC BY

An Android Things-powered clock that allows the user to actually READ the time! Control it via Nearby API or through voice commands.

  • 11,455 views
  • 7 comments
  • 79 respects

Components and supplies

Pi 3 02
Raspberry Pi 3 Model B
×1
Ard nano
Arduino Nano R3
×1
Neopixel strip
NeoPixel strip
×1
Picture frame
×1
Laser-cut letters layout
×1
Extra piece of wood (same size of the layout)
×1

Necessary tools and machines

09507 01
Soldering iron (generic)

Apps and online services

About this project

What about a clock that speaks the user own language? Here it is!

The core concept of this clock is that during the day, only the letters needed to create the current time in words will be on, while the others will be off.

This project is a perfect example of Smart Home device, providing smooth integration with the Google Assistant which allows a natural interaction using voice commands, all in a final package that it is nice looking and can be place in any living room.

Build your own

The first thing to do is to create a layout with all the letters and have it laser-cut of the right size to fit inside the picture frame and with every letter at the same distance between each others as the LEDs in the strip are.

In the project repository I placed the vector files for both the English and Italian version of the clock, with more languages to come:

Speaking about the LEDs, the project will both work with WS2801 and WS2812B strips. The only difference is that WS2801 LEDs will work directly with a Raspberry Pi (or other Android Things compatible board), while WS2812B LEDs will require a separate unit to control them (I used an Arduino Nano connected to the Android Things board via USB serial connection). The source code for the Android Things app in the repo will provide two variant, one for each LED format and the relative schematics.

We need to cut and re-assemble the LEDs strip so that it will form some sort of zig-zag pattern. That will be placed behind the letters layout, each LED responsible of lighting one single letter.

We need to be sure that the light from one LED will be directed towards a single letter, and not spread to adjacent ones. I solved this problem by drilling some holes in a piece of wood, one for each letter, wide enough to include the whole letter.

The LEDs are then placed inside the holes and attached using some tape.

We can now put the layout into the picture frame, so that the letters are correctly readable from the front of the frame and after that place the piece of wood with the connected LEDs.

Now we can connect the LEDs to the Android Things board, depending on the format of the LEDs we choose:

Before building the app with Android Studio, we need to select the right version of the app from the Build Variants menu of Android Studio:

Here we have one version for each combination of layout language and LED format.

We build the app and run it on the Android Things board, after setting the right parameter for the WiFi network. Given an active Interned connection, Android will automatically set the current time and it will start displaying it turning on the right letters forming the time sentence.

In case of missing Internet connection after a reboot, an appropriate error state will be displayed:

Android companion app

In the Github repository is also present the code for an Android mobile companion app that allows the user to change the color of the LEDs and the timezone (coming soon) of the clock.

Once installed and run the app will look for a clock in range, using Android Nearby API, without any user configuration. Once the clock is found, the color palette is displayed and as soon as the user selects a new color, the LEDs are updated using that color.

Smart Home

Using Smart Home it is possible to change the clock LEDs color through the Google Assistant. This will trigger a Firebase Function changing some values in the project's Firebase Realtime DB, which will be read by the Android Things board. The changes will then be reflected on the actual clock.

In the Github repository it is possible to find all the needed steps to configure Smart Home for the Word Clock, and once done it will be possible to control both color and brightness, as shown in the following video:

Code

Schematics

WS2801
Direct connection of the 4 wires required by the WS2801 LED strip to the Android Things board
ws2801_NrdL4yHYgS.fzz
WS2812B
With WS2812B LEDs, we need to use an external module (in this case an Arduino Nano) as a man in the middle between the LEDs and the Android Things board.
ws2812b_dE6hG5tmEZ.fzz

Comments

Similar projects you might like

The Drawing Machine

Project showcase by kramick

  • 788 views
  • 4 comments
  • 3 respects

Arduino Serial Plotter & Capacitors

Project in progress by Koiotti

  • 745 views
  • 0 comments
  • 5 respects

BBC Micro Online

Project in progress by 8bitkick

  • 5,770 views
  • 6 comments
  • 11 respects

Arduino MIDI Arpeggiator

Project tutorial by Dmitry

  • 6,871 views
  • 26 comments
  • 53 respects

Arduino-Based Shower Cabin FM Radio

Project tutorial by Saulius Bandzevičius

  • 2,157 views
  • 2 comments
  • 11 respects

Auto Power Controller

by Revathi Kannan

  • 813 views
  • 0 comments
  • 6 respects
Add projectSign up / Login