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 DarkSky using their API ( https://darksky.net/dev/ ). The maps are from Mapbox ( https://mapbox.com ) or Google Maps.

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

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/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 DarkSky using their API ( http://darksky.net/dev/ ).  The maps are from Google Maps API.  You must get API Keys from DarkSky and Google in order to make this work.  It is free for low usage such as this application.

The Weather data comes from OpenWeatherMap or Tomorrow.io.  The maps are from Google Maps API or Mapbox.  You must get API Keys from OpenWeatherMap or Tomorrow.io and Google or Mapbox 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

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 123 forks and 395 stars. Here on Hackaday.io, there are almost 273 skulls (likes) 158,000 views and over 2,000 followers. As well as 189 comments in the form of questions and answers.

I try to answer questions mostly on github, open new issues here: https://github.com/n0bel/PiClock/issues.

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

View all 10 components

View all 23 project logs

View all instructions

Enjoy this project?

Share

Discussions

Danny Martin wrote 06/28/2017 at 19:28 point

Hello Kevin:

I am trying to get the LED strip to work with the PIClock. I have tested my strip and all is well with that. I have installed the following:

apt-get install libboost-python1.49.0

I have searched all the discussions and don't seem to find any references to the LEDs, I did some research on NeoPixel Ambilight, but not sure this is what I want to do. Do you have some code or option to select that turns on the lights, or  should I just set up a python script to start  at boot and use that? Any  help would be appreciated, again thanks for the wonderful project.

Danny

  Are you sure? yes | no

Kevin Uhlir wrote 06/28/2017 at 21:51 point

The LEDs are run by the script and library in the Leds folder.   It is started along with everything else in startup.sh

  Are you sure? yes | no

Danny Martin wrote 06/29/2017 at 03:34 point

I am using the Raspberry Pi 7 inch display. Does this code look for an HDMI monitor? I cannot get the leds to come on. Do I need to select a special GPIO (currently using 18)?

  Are you sure? yes | no

Kevin Uhlir wrote 06/29/2017 at 03:52 point

PiClock doesn't care about your monitor.  It uses whatever desktop gui is running on.  

https://github.com/n0bel/PiClock/blob/master/startup.sh runs NeoAmbi.py from the Leds folder (around line 75).

https://github.com/n0bel/PiClock/blob/master/Documentation/Hardware.md shows how to hook up the NeoPixels.

  Are you sure? yes | no

Danny Martin wrote 06/30/2017 at 03:48 point

Kevin I have my neo pixel installed properly, I can make it function by using the script strandtest.py with my current connections. I have tried both the NeoPixel Ring - 24 x 5050 RGB LED with Integrated Drivers and Adafruit NeoPixel Digital RGB LED Strip - White 30 LED - WHITE. Both with the same results. Any more suggestions?

Thanks,

Danny

  Are you sure? yes | no

Kevin Uhlir wrote 06/30/2017 at 04:42 point

no idea... have you tried manually running 

cd Leds

sudo python NeoAmbi.py

If so does it get any errors?

  Are you sure? yes | no

Danny Martin wrote 06/30/2017 at 05:41 point

I have tried that and it just seems to run with no activity. When I hit Ctrl C it just aborts the program. Is there any changes that need to be made in the NeoAmbi.py in reference to the number of pixels that are being used?

Thanks,

Danny

  Are you sure? yes | no

Kevin Uhlir wrote 06/30/2017 at 05:45 point

in NeoAmbi.py line 32

  Are you sure? yes | no

Danny Martin wrote 06/30/2017 at 15:58 point

Kevin, I would like to run a test of Ambi.py on a standalone pi. Do I need to load any additional software or all of the libraries contained in Raspbian Jessie?

Thanks,

Danny

  Are you sure? yes | no

Danny Martin wrote 07/02/2017 at 21:37 point

Kevin I ran the test  with a clean install of Raspbian and  ran your Ambi.py with no results. What is the type and brand name of the strips you used in your project?

Thanks

  Are you sure? yes | no

Kevin Uhlir wrote 06/24/2017 at 17:55 point

NOAA weather radio streams have reappeared on the net. You can find it here: http://noaaweatherradio.org/
They don't put the .mp3 urls where they are easily accessable, so you
need to use your browser to "View Page Source" in order to find the
proper .mp3 url.

  Are you sure? yes | no

Rick wrote 06/14/2017 at 10:18 point

A co-worker and I have figured out how to make the PiClock rotate screens. It flips from the clock to the radar screen (Space Bar) 

Instructions:

apt install xdotool

We created a subfolder called scripts under PiClock as we will be adding more to this. You can put the file anywhere just adjust the crontab path.

create a sh file MAKE SURE TO chmod +x the file. You can call the file whatever you want just adjust the crontab job path.

chmod +x switchPiClockscreens.sh

Edit the file and add this:

#!/bin/bash
# Script to switch panels
export DISPLAY=":0"; xdotool key space

Add this line to crontrab -e MAKE SURE YOU'RE NOT LOGGED IN AS ROOT

*/5 * * * * sh /home/piclock/PiClock/scripts/switchPiClockscreens.sh

The 5 is minutes for rotation. You can set it to whatever you'd like.

  Are you sure? yes | no

Kevin Uhlir wrote 06/14/2017 at 16:16 point

Great work!..   You may run into a problem with the Weather Underground API limits.  

  Are you sure? yes | no

Rick wrote 06/14/2017 at 18:07 point

I thought about that. I might need to change it Does it hit the API key every time it switches from screen to screen? I figured rotation at 5 mins. That's 12 times an hour X 24 hrs = 288 API hits per 24 hrs. The limit on the free API is 500 hits a day. Not sure if that's how it works.

  Are you sure? yes | no

peter wrote 06/08/2017 at 23:57 point

All is good. A couple of things I would request from the developer; move icons around, and more config. ability around text formatting. I found the "Chance of thunderstorms" does not fit on the screen by default.

  Are you sure? yes | no

Wilson wrote 05/15/2017 at 04:44 point

Hi and thanks for this great project..

Everything working in default..

Was wondering, is it possible to get Traffic on the google maps API?  

I would like to have at least one of the maps have current traffic if possible. 

If so, how?

Also, have a slide show routine that I easily run, but trying to figure out how to rotate them after X amount of time. 

Thanks.

  Are you sure? yes | no

eric2693 wrote 04/22/2017 at 15:24 point

So I have the PiClock running but when I change something like the clock or background, I go into the nano file to edit it and I have to retype the changes and NOA and lat/lon. Am I doing something wrong to have to keep putting this information in again after I go through trying to edit one thing? This is my first ever project on the Pi so I'm not too familiar with this stuff.

  Are you sure? yes | no

Annabellesolman wrote 04/03/2017 at 20:13 point

IR Receiver: do we need it to run the project?

  Are you sure? yes | no

Kevin Uhlir wrote 04/12/2017 at 00:48 point

No, it is one of the optional items.

  Are you sure? yes | no

Dillon Bradshaw wrote 03/24/2017 at 02:35 point

Hey guys! So i got everything running smoothly for my dorm, except the noaa stream, but that seems to be common. My one question is how do i go about changing the font of the clock? I have the font i want installed, just dont know how to implement it. And only for the clock, none of the other text! Thanks!

  Are you sure? yes | no

fred.hancock wrote 03/11/2017 at 19:03 point

Still trying to change weather latlong in python - any good beginner's guide? ApiKeys.py also seems to fail to be found - I just open a blank file - is this right? Thanks

  Are you sure? yes | no

Kevin Uhlir wrote 04/12/2017 at 00:55 point

Part of the Install.MD file:

Now that you have your api keys...

cd PiClock
cd Clock
cp ApiKeys-example.py ApiKeys.py
nano ApiKeys.py

Put your api keys in the file as indicated

#change this to your API keys
# Weather Underground API key
wuapi = 'YOUR WEATHER UNDERGROUND API KEY'
# Google Maps API key
googleapi = '' #Empty string, the key is optional -- if you pull a small volume, you'll be ok

  Are you sure? yes | no

danjhofer wrote 03/05/2017 at 16:11 point

Like others have asked, is the function for the audio feeds not working for everyone or are some of us doing something wrong?

  Are you sure? yes | no

Kevin Uhlir wrote 04/12/2017 at 00:52 point

At this point it looks like the NOAA weather streams are down.   I have no further information.

  Are you sure? yes | no

Danny Martin wrote 06/24/2017 at 15:45 point

The have been removed.

  Are you sure? yes | no

Brian wrote 02/12/2017 at 13:53 point

This is a great beginner project, got it up and running and learned a lot in the process. I tried changing the NOAA audio feed to a radio station URL without much luck. Does anyone have any thoughts?

Thanks!

  Are you sure? yes | no

Kevin Uhlir wrote 04/12/2017 at 00:53 point

At this point it looks like the NOAA weather streams are down.   I have no further information.

  Are you sure? yes | no

Cold wrote 01/11/2017 at 02:15 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

Kevin Uhlir wrote 04/12/2017 at 00:53 point

As the PiClock gets reorganized into its second incarnation, an alarm may be a plugin to be added.   Check out the project on github where you'll see many issues discussed.

  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

Ryan Gaeddert wrote 04/11/2017 at 16:02 point

Thank you for the input. I don't know why I didn't think of that sooner. But that helped me find the problem; a simple missed single quote in the code. 

  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

Similar Projects

Does this project spark your interest?

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