veebch / hometime

A physical progress bar based on Google Calendar events
GNU General Public License v3.0
45 stars 6 forks source link

Hometime: A work/school day progress bar linked to a Google Calendar

YouTube Channel Views Instagram

A physical LED progress bar for the working day based on information from a public Google Calendar. The bar uses an addressable led strip and a Raspberry Pi Pico W. It:

Videos

Tap on the picture for a video of it being assembled and working as part of a home made whiteboard. Since the video was made, there have been some improvements to how meetings are displayed, that is shown in the second short video.

Video

Mod demo

Tutorial

There's a pretty comprehensive start-to-finish walkthrough by Dan Ionescu here

How it works

The progress bar displays your progress through the working day. It connects to wifi, grabs the time from a time api, then shows you how far through the day you are.

The events are maintained in a public Google calendar, and connection parameters are stored in the config file. For getting an API key, visit https://console.cloud.google.com/apis/credentials. For getting the calendar link just select 'share calendar' on google calendar and copy the link (it ends in @group.calendar.google.com)

If the current time is outside of the working hours, no lights show.

Hardware

Assembly

Attach the Light Strip to the Pico as described below:

Pico GPIO Light Strip
VBUS VCC
GND GND
15 DATA

Schematic:

Schematic

Installing

Download a uf2 image and install it on the Pico W according to the instructions on the Raspberry Pi website.

Clone this repository to your computer using the commands (from a terminal):

cd ~
git clone https://github.com/veebch/hometime.git
cd hometime
mv config_example.py config.py

Check the port of the pico with the port listing command:

python -m serial.tools.list_ports

Now, using the port path (in our case /dev/ttyACM0) copy the contents to the repository by installing ampy and using and the commands:

ampy -p /dev/ttyACM0 put main.py 
ampy -p /dev/ttyACM0 put config.py
ampy -p /dev/ttyACM0 put phew
ampy -p /dev/ttyACM0 put ap_templates

(NB. make sure you are using the right port name, as shown in the port listing command above)

Done! All the required files should now be on the Pico. Whenever you connect to USB power the script will autorun.

Setup

On the first run, the pico will realise that it has no valid WiFi credentials and start up as an access point. The neopixels will turn red to indicate that it is in setup mode. To add WiFi credentials, on another WiFi enabled device (eg smartphone) connect to the network 'veebprojects'. You'll then be prompted to provide login credentials for your WiFi network.

Once you've added these, the pico will restart and connect to WiFi. If there are any problems in connecting, the bar will turn red again and setup mode will be started again.

Configuration

Parameters are in config.py.

That's it. Now whenever you plug it in to power, the code will autorun.