Close
0%
0%

PiClock - A Raspberry Pi Clock & Weather Display

This project is a fancy Clock and weather display built around a monitor and a Raspberry Pi.

Similar projects worth following
The PiClock is a clock (duh), weather forcast, and radar map display based on the Raspberry Pi and a display monitor. The display monitor is assumed to be an HDMI monitor, but it will probably (possibly) work with the composite output as well, but this is not a design goal. The main program (Clock/PyQtPiClock.py) will also run on Windows, Mac, and Linux, as long as python 2.7+ and PyQt4 is installed.

The Weather data comes from Weather Underground using their API (http://www.wunderground.com/weather/api/ ). The maps are from Google Maps API. You must get an API Key from weather underground in order to make this work. It is free for low usage such as this application.

The PiClock can be customized with several supported additional things:

RGB LED strips (NeoPixel) to create an ambilight effect
gpio buttons for changing the view
IR Remote Control for changing the view
Streaming the NOAA weather radio strea

Introduction

The PiClock is a clock (duh), weather forcast, and radar map display based on the Raspberry Pi and a display monitor. The display monitor is assumed to be an HDMI monitor, but it will probably (possibly) work with the composite output as well, but this is not a design goal. The main program (Clock/http://PyQtPiClock.py) will also run on Windows, Mac, and Linux, as long as python 2.7+ and PyQt4 is installed.

The Weather data comes from Weather Underground using their API ( http://www.wunderground.com/weather/api/ ). The maps are from Google Maps API. You must get an API Key from weather underground in order to make this work. It is free for low usage such as this application.

The PiClock can be customized with several supported additional things:

  • RGB LED strips (NeoPixel) to create an ambilight effect
  • gpio buttons for changing the view
  • IR Remote Control for changing the view
  • Streaming the NOAA weather radio stream for your area

The power usage I've measured is about 35watts with a 19" HDMI Monitor, 27 LEDs and the Pi. The LEDs contributed 3 or so watts, and I think the Pi is about 2-3 Watts normally.

This is the basic PiClock, with some options added. PiClock Picture

I chose to remove the plastic frame from my monitor and mount the Pi directly on it, as well as tap power from the display's power supply. PiClock Pi Mounting

I've made it work on multiple platforms and form factors. PiClock Pi Mounting

And I've made some for friends and family with different customizations. PiClock Pi Mounting

Overview on GitHub

There's an overview, install guide and hardware guide along with the source on GitHub. https://github.com/n0bel/PiClock/blob/master/Documentation/Overview.md

There is also an instruction guide here on Hackaday.io. https://hackaday.io/project/6184-piclock-a-raspberry-pi-clock-weather-display#menu-instructions

PiClocks have been successfully built and proudly displayed around the world by many people. Some examples can be seen on closed github issues, as well as my public facebook page. I can't tell how many PiClocks are out there. The github page shows 47 forks and 242 stars. Here on Hackaday.io, there are almost 100 skulls (likes) 40,000 views and over 1,000 followers. As well as 90 comments in the form of questions and answers.

I try to answer questions either here or on github, or facebook or reddit.

I've made several PiClocks for friends and family. A few friends have made their own as well.

Maybe you'd like to give it a try.

Here are some successful PiClock build pictures.

Craig Moench



blboyd


Micheal Jacques


  • 1 × A Raspberry Pi (revision 2) Model B, or B+ or Pi 2 Model B or Pi 3 or Pi Zero
  • 1 × A Display Monitor & Cable
  • 1 × 5V Power Supply (for Pi) Power Supply (or if you're ambitious tap your display power supply, you'll probably need a switching down regulator to 5v) Remember the Pi likes something that can source up to 2A.
  • 1 × A USB Keyboard and Mouse for setup (if you want something small and semi-permanent, I've had good luck with this: https://www.google.com/search?q=iPazzPort+2.4G+Mini+Wireless+Keyboard I like the one with the mousepad on the side)
  • 1 × USB Wifi or Internet Connection
  • 1 × (optional) One or more DS18B20s for showing the inside temperature
  • 1 × (optional) A string of WS2818 based RGB LEDs for the AmbiLight effect. At 40ma per LED, and 30 or so LEDs you're quickly up to needing an extra 1.2A from the power supply. Size it appropriately. One option is https://learn.adafruit.com/adafruit-neopixel-uberguide/overview)
  • 1 × (optional) TSOP4838 Opto and Fiber Optic Semiconductors and ICs / Other Optoelectronic ICs
  • 1 × (optional) An IR Remote control ( I use this little guy: https://www.google.com/search?q=Mini+Universal+Infrared+IR+TV+Set+Remote+Control+Keychain )
  • 1 × (optional) Push Switch or Switches connected to some GPIO pins (and a ground pin) for flipping pages like the IR remote

View all 16 project logs

  • 1

    Choosing your Options

    The PiClock in its basic configuration is a Raspberry Pi, and an HDMI Monitor (and power and SD card of course, and possibly a WiFI dongle). This project has a number of optional items.

    • NeoPixel Ambilight
    • DS18B20 Temperature sensors
    • IR Receiver
    • Push Button controls

    You could proceed through these instructions without any of these hardware extras, and then add them later.

    All of the optional hardware wiring and instructions are documented here: https://github.com/n0bel/PiClock/blob/master/Documentation/Hardware.md

    I'd suggest you read through that first if you're considering adding these options.

  • 2

    Hook things up

    Begin by setting up your HDMI Monitor, Raspberry Pi, and power supply. Some kind of keyboard and mouse will also be handy, connected via USB. I'm assuming most everyone can get this far on their own. If you're going to do those hardware extras, mentioned in the prior instruction, put them together as well.

  • 3

    Download Raspbian Jessie and put it on an SD Card

    PiClock and this install guide are based on Raspian Jessie released on https://www.raspberrypi.org/downloads/ It will work with many raspbian versions, but you may have to add more packages, etc. That exercise is left for the reader.

    What follows is a step by step guide. If you start with a new clean raspbian image, it should just work. I'm assuming that you already know how to hook up your Raspi, monitor, and keyboard/mouse. If not, please do a web search regarding setting up the basic hardware for your Raspi.

    The image and instructions for doing this are on the following page: https://www.raspberrypi.org/downloads/

View all 22 instructions

Enjoy this project?

Share      

Discussions

Cold wrote 7 days ago point

Thank you!

I have your clock software successfully configured.  What is the chances of a alarm feature being added to the base build?  Do you have any suggestions for the setup of an touch screen alarm function?

  Are you sure? yes | no

david.kingsleyjr wrote 12/25/2016 at 06:45 point

Hello Kevin. the radar isn't showing up properly on my screen. all there is, is reflectivity and a grey background. i am unsure as to why this is. 

Also, is there a way that i can move the data above the radar to the center of the screen? it wouls be nice to move that information to occupy the center of the screen and the date/time to the top of the screen. perhaps even making the radar just a bit bigger would be nice as well.

I'm running an RPI3 wirelessly with a fresh raspbian jessie image.

  Are you sure? yes | no

Kevin Uhlir wrote 01/07/2017 at 17:37 point

Generally speaking the grey map background is caused by using a google maps api key that hasn't been activated.   However its best *not* to use a google maps api key at all.   Just leave that option as ''  (empty string).

googleapi = '' #Empty string, the key is optional -- if you pull a small volume, you'll be ok

  Are you sure? yes | no

david.kingsleyjr wrote 01/07/2017 at 17:44 point

Ok,  I will give this a try. Using the provided instructions led me to believe I needed the Google API key to see my town on a map. What's odd though,  is that my Google API key IS activated.

  Are you sure? yes | no

miles.d.oliver wrote 12/24/2016 at 19:30 point

I'm using this with my Raspberry Pi  2 and 7" Pi touchscreen beside my bed with 2 other packages.  'alarmpi' https://github.com/skiwithpete/alarmpi  .  and HuePI http://www.floodgap.com/software/huepl/  with a bash script to give a sunrise simulation of the lights to come on gradually and to give the latest news and weather audibly as well as a morning song.   For the last few months its been a good alarm clock that wakes me up via cron jobs and my mp3 library.   I'm no coder but am investigating how I can place a 'snooze box' on the screen so I could just kill the alarmpi job with a simple touch of the screen. For now I run the alarmpi job twice at 00 and 05 past the hour and this is enough to get me up.  Combining all 3 projects has been the best overall alarm clock I've ever had. 

  Are you sure? yes | no

Kevin Uhlir wrote 01/07/2017 at 17:36 point

Great work!  YAY!  Glad you're digging into the code too.  Great to see!

  Are you sure? yes | no

Quancard wrote 12/19/2016 at 09:12 point

Helo Kevin,

I love you project :) I have already run it on my Pi! It works great. It is quite clever to dim the screen for the night but I got other question about it. How could I turn background color into White for the day and leave black, dimmed for the night? Thanks for help! :)

  Are you sure? yes | no

Quancard wrote 12/19/2016 at 10:39 point

Uuu... now I see that there is a tool for changing clock faces... I think my question is obsolete! I will play with changing look of the clock by myself :)

  Are you sure? yes | no

Wilson wrote 12/30/2016 at 19:59 point

Where is this tool? Would like to change clock face.

  Are you sure? yes | no

Kevin Uhlir wrote 01/07/2017 at 17:35 point

The tool he speaks of is the switcher.sh script which is talked about in the next comment.   Check the instructions @ github  https://github.com/n0bel/PiClock/blob/master/Documentation/Install.md#switching-skins-at-certain-times-of-the-day   Its not so much a tool, but a way to switch configs at certain times.   The config itself controls the background and all other aspects of the display

  Are you sure? yes | no

Ryan Gaeddert wrote 12/16/2016 at 21:21 point

Hello - I have the clock up and running no problem. I've decided to add in the switcher script to have the display dim at night. I used the Config-Example-Bedside.py file and mirrored my Config.py file but named it Config-Night.py. I then set my crontab as follows:

@reboot sh /home/pi/PiClock/startup.sh


0 6 * * * sh /home/pi/PiClock/switcher.sh Config
0 20 * * * sh /home/pi/PiClock/switcher.sh Config-Night

The clock auto starts on boot, and the switcher script kills the Config.py but the Config-Night.py script doesn't run. At 8pm, the clock exits and all I get is my desktop.

What am I doing wrong here? Thank you!

  Are you sure? yes | no

Kevin Uhlir wrote 01/07/2017 at 17:32 point

I can't really tell whats wrong from just that.  It looks correct.   You might want to check the log files in Piclock/Clock

  Are you sure? yes | no

vic_bkk wrote 11/21/2016 at 21:06 point

Hi great project.
How do I set temperature to be centigrade?

73 de HS0ZKM

  Are you sure? yes | no

Kevin Uhlir wrote 11/22/2016 at 06:28 point

In your Config.py 

```

metric = 0 # 0 = English, 1 = Metric

```

  Are you sure? yes | no

Larry Stewart wrote 11/18/2016 at 17:46 point

Hi Kevin, I just installed the PIClock on the Raspberry PI3. The clock comes up fine. The radar maps seems to work. I will not know until I get some rain or snow. No forecast on the right. I examined the logs and it says there is an error at all  PYQtPiClock .logs fail at  line 174 PYQtPiClock.py Error is KeyError Current_observation. Also weather radio is for the wrong area. I live in NW NJ. How do I get code to change that? Please advise.

  Are you sure? yes | no

Kevin Uhlir wrote 11/22/2016 at 06:38 point

I'd recheck your config, some mistake in it.   If you don't see anything wrong, look for the http://api.wunderground.com/ap....... line in the log and copy it into a browser.  It may give you the actual error.  You also may see something wrong with the url.

As pointed out in the install instructions, Get your NOAA feed url from  http://www.wunderground.com/wxradio/, and change the line in your Config.py 

noaastream = 'http://audioplayer.wunderground.com:80/tim273/edina'

  Are you sure? yes | no

Larry Stewart wrote 11/22/2016 at 19:46 point

I recreated the API key and it works. the weather radio does not work for this area because no one streaming in this area. I will have to wait someone provides one again. Thanks for you help.

  Are you sure? yes | no

RedaSama wrote 11/16/2016 at 14:10 point

Hello, please, someone can help me ? 

If I want to use a touch screen 5' for Raspberry Pi, how I can confirgure the size of the widgets/clock and infos ?

  Are you sure? yes | no

Kevin Uhlir wrote 11/22/2016 at 06:39 point

It will take a bit of work...   The various widgets are controlled by .setGeomoetry() calls.

  Are you sure? yes | no

Ryan Gaeddert wrote 11/15/2016 at 19:10 point

Had fun setting this up on my laptop and running from Task Scheduler as a screen saver sort of speak. Now I'm going to set up on a Pi Zero on a 10 inch screen for my brother's new home. I see where the background images are being pulled from, but how do I go about having my own background image loaded? Any help would be great.

  Are you sure? yes | no

marathonpc wrote 11/16/2016 at 13:44 point

Place you background image(s) in the Images folder.  Edit config.py (I use notepad+) , the line you edit is the one called background=   (pretty obvious once you see it)

  Are you sure? yes | no

Ryan Gaeddert wrote 11/16/2016 at 16:54 point

Please excuse my noobishness, but is this a folder within the Pi? I only have experience on the Pi 3; is the images folder the same as the Pictures folder on the 3?

  Are you sure? yes | no

marathonpc wrote 11/16/2016 at 17:30 point

The folder that gets created on the install, windows or Pi, is the Images folder under the PiClock folder.  PiClock/Clock/Images  .  Technically you can place the images anywhere and just point the config file to it.  Have a poke around in the folders under PiClock to get orientated

  Are you sure? yes | no

Ryan Gaeddert wrote 11/16/2016 at 17:39 point

HA! Ok, now I feel dumb. That makes perfect sense. Thanks for pointing me in the right direction.

  Are you sure? yes | no

marathonpc wrote 11/14/2016 at 19:13 point

Recently, on 2 separate installs of pi clock, the weather icon in the top left has disappeared, no changes have been made on either install.. thoughts?

  Are you sure? yes | no

Kevin Uhlir wrote 11/22/2016 at 06:41 point

It is possible they changed the condition icon name.  Is this in the usa?

  Are you sure? yes | no

marathonpc wrote 11/22/2016 at 11:52 point

Thanks for the info, is there a way to see what icon is being called for the current weather?

  Are you sure? yes | no

marathonpc wrote 11/22/2016 at 12:31 point

I made a small change to the Lat and Long and this corrected the issue.

  Are you sure? yes | no

zipidy66 wrote 11/13/2016 at 05:31 point

Great work on the PiClock, I have just got it all up and running and looks great. I am putting it into my vehicle and was wondering hard hard it would be to have the location updated automatically from a NMEA GPS signal on the Pi's serial port.

  Are you sure? yes | no

Kevin Uhlir wrote 11/22/2016 at 06:43 point

Someone with experience with serial ports on the pi, and python, would probably find it easy.  Others may find it difficult.

  Are you sure? yes | no

mike wrote 11/02/2016 at 00:11 point

Is there a reference to the font specification for the digital clock output? I have a zombie themed piclock and a zombie font I would like to use only for the clock portion. 

I have added a somafm.com channel instead of noaa since there doesnt seem to be a noaa channel close to me....more enjoyable to listen to:)

  Are you sure? yes | no

Kevin Uhlir wrote 11/02/2016 at 16:05 point

Pretty much every setStyleSheet on all the widgets use "font-family:sans-serif;"   Thats what you'd change.    clockface.setStyleSheet near line 893.  I've not tried to add fonts to the Pi, so I can't give you direct instructions how to do it.  But once you've accomplished adding fonts, then you'd reference it with font-family in the style sheet.

  Are you sure? yes | no

mike wrote 11/01/2016 at 21:35 point

Had fun with this project

  Are you sure? yes | no

yasha.sinitski wrote 09/28/2016 at 13:28 point

Followed your instructions and it ended up perfect. Many thanks Kevin! I now have a wall mounted information display right to my bed :)

  Are you sure? yes | no

Kevin Uhlir wrote 09/03/2016 at 06:29 point

A PiClock of a different flavor?


I subscribe to http://www.hackerboxes.com Every month they send me a box of "stuff". My main reason for doing this is because I'm exposed to some random parts, some of which I've not seen before, and may find useful. 


This month's Hackerbox included an Orange Pi Lite. They included instructions and parts for
an lcd display and a push button thingy, and other things to get you started.


Well of course I didn't bother with that, and simply went straight to my PiClock. After burning an SD card (with armbian), a few minutes fussing and searching how to connect to my WiFI, and then a few more minutes of apt-get's the PiClock main program was up and running.

Question? Should I target the Orange Pi series of boards as an alternative PiClock platform? Orange Pi Lite (Wifi): $12USD+shipping from AliExpress ($20USD Amazon). Orange Pi One (Ethernet) $10USD+shipping from AliExpress ($17USD Amazon).

  Are you sure? yes | no

Chris Muncy wrote 08/29/2016 at 19:46 point

lol I thought you were talking about a file name. Sorry.

  Are you sure? yes | no

Chris Muncy wrote 08/29/2016 at 19:39 point

Kevin,

Maybe my old eyes are failing me but where is qtstart?

  Are you sure? yes | no

Kevin Uhlir wrote 08/29/2016 at 19:43 point

Doesn't your editor have a search function?

Just before class Radar()

Line 294

  Are you sure? yes | no

Chris Muncy wrote 08/29/2016 at 17:29 point

Wakeup Kevin!

Where can I change the code so the side by side radar images show first?

  Are you sure? yes | no

Kevin Uhlir wrote 08/29/2016 at 18:35 point

At the bottom of qtstart:

    nextframe(1)

diff --git a/Clock/PyQtPiClock.py b/Clock/PyQtPiClock.py

index 7e88ed0..beeeff5 100644
--- a/Clock/PyQtPiClock.py
+++ b/Clock/PyQtPiClock.py
@@ -292,6 +292,7 @@
     temptimer.timeout.connect(gettemp)
     temptimer.start(1000*10*60+random.uniform(1000,10000))
     
+    nextframe(1)
 
 class Radar(QtGui.QLabel):

  Are you sure? yes | no

mbrocher303 wrote 08/07/2016 at 08:05 point

Awesome, that was just the ticket. Appreciate the help!

  Are you sure? yes | no

theballisback wrote 08/06/2016 at 22:35 point

hi there! Came across this project on Lifehacker and couldn't wait to try it. Ive run into an odd problem though. Whenever I input my latitude / longitude, and API keys, everything works fine. But none of that info is being saved. When I go back into the Configs, all the info has been reset. I re-input the localization info for the maps and such, load the clock and it's just like it should be. But if I reboot, all the info once again resets and I have to do it all over again.

  Are you sure? yes | no

Kevin Uhlir wrote 08/07/2016 at 05:41 point

I've never ran into that at all.  Perhaps the SD card is bad or write protected?  Does the config file disappear, or is it the one you copied?   Are you doing reboot with sudo reboot, and not just pulling the power?

  Are you sure? yes | no

theballisback wrote 08/27/2016 at 07:19 point

It turned out that the SD card went bad. Replaced it and got it running! For NOAA, do I just copy the the mp3 URL? The "stock" address works just fine, but when I enter a different address, nothing plays.

  Are you sure? yes | no

Kevin Uhlir wrote 08/27/2016 at 15:27 point

Yes you just replace the mp3 url.   Check that your new url woks in a browser or an internet audio player first.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates