Skip to content

Python script to show current time and current outdoor temp (from Weather Underground's API) on Adafruit seven segment display, all powered by a Raspberry Pi

License

Notifications You must be signed in to change notification settings

gadkarisid/rpi-clock

Repository files navigation

README for Raspberry Pi Clock
-----------------------------

This package displays the current time (via NTP) and current outside temperature (via Open Weather Map API) on an Adafruit 7 segment LED display. Since there is no real time clock involved, the time is only accurate while the Raspberry Pi is powered on and connected to the NTP server (private or public). It is most accurate when the NTP source has low drift. Time can be displayed in 12 or 24 hour format. Your local zip code can be configured for local temperature. Temperature info is displayed in Fahrenheit or Celsius, however the 7 segment display may not contain decimal characters so temperatures are rounded to the nearest integer. The clock script gets registered as a systemd service during installation. The service is called 'rpi-clock.service'

Requirements:
- Raspbery Pi (tested on RPi Model B, RPi 2, and RPi 3 using Raspbian, Raspbian Stretch, OSMC, and Volumio2)
- Assembled 7 Segment display w/I2C backpack from Adafruit (ex. https://www.adafruit.com/products/1270)
- Network connectivity on Raspberry Pi
- NTP servers configured on Raspberry Pi (/etc/ntp.conf)
- Local timezone configured on Raspberry Pi (use 'raspi-config')
- Python 2.7 installed on Raspberry Pi
- I2C enabled on Raspberry Pi (https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c)

Instructions:
1. Complete all the requirements above 
2. Update your Raspberry Pi ('sudo apt-get update' followed by 'sudo apt-get upgrade')
3. Install dependency packages ('sudo apt-get install build-essential python-dev python-smbus python-imaging') 
4. Run 'git clone https://github.com/gadkarisid/rpi-clock && cd rpi-clock && bash INSTALL'
5. Sign up for a free API key with Open Weather Map (https://openweathermap.org/price)
6. Modify the user preferences in '/usr/bin/rpi-clock/clock.py'
7. Shutdown and power off the Raspberry Pi
8. Connect necessary GPIO pins to 7 segment display
9. Boot the Raspberry Pi

NOT FOR COMMERCIAL USE

About

Python script to show current time and current outdoor temp (from Weather Underground's API) on Adafruit seven segment display, all powered by a Raspberry Pi

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages