# Weather display project

**URL:** https://forums.pimoroni.com/t/weather-display-project/27108
**Category:** Projects
**Created:** [January 17, 2025, 3:44pm UTC](https://forums.pimoroni.com/t/weather-display-project/27108 "2025-01-17T15:44:46Z")
**Posts on this page:** 18
**Page:** 1

<div class="post-metadata">

### Author: ![wm-ch](https://avatars.discourse-cdn.com/v4/letter/w/9fc29f/32.png) [@wm-ch](https://forums.pimoroni.com/u/wm-ch)
#### Post date: [January 17, 2025, 3:44pm UTC](https://forums.pimoroni.com/t/weather-display-project/27108/1 "2025-01-17T15:44:46Z")

</div>

It looks like just another weather report, but this one is a bit different.

There is a raspberry pi running under the TV. It gets weather data from various APIs, including the local sensors inside and outside the house. Then it calibrates the weather forecast using a neural network model trained on historical data. It creates the weather report image every hour and makes it available via a Rest API.

The Inky Frame wakes up every hour, retrieves new images from the API on the RPI, and displays.

Next steps : program the buttons to show a snow report, or a dashboard of info taken from heating system or other devices in the house.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/8/82e95c0c869b7263446c6ae0274dfdbe3995533b.jpeg)

---

<div class="post-metadata">

### Author: ![bablokb](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bablokb](https://forums.pimoroni.com/u/bablokb)
#### Post date: [January 17, 2025, 4:25pm UTC](https://forums.pimoroni.com/t/weather-display-project/27108/2 "2025-01-17T16:25:42Z")

</div>

Very nice, thanks for sharing!

---

<div class="post-metadata">

### Author: ![Shoe](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Shoe](https://forums.pimoroni.com/u/Shoe)
#### Post date: [January 17, 2025, 9:02pm UTC](https://forums.pimoroni.com/t/weather-display-project/27108/3 "2025-01-17T21:02:43Z")

</div>

That’s some lovely weather data! Are you planning at any point to switch it to battery power?

---

<div class="post-metadata">

### Author: ![bablokb](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bablokb](https://forums.pimoroni.com/u/bablokb)
#### Post date: [January 18, 2025, 6:58am UTC](https://forums.pimoroni.com/t/weather-display-project/27108/4 "2025-01-18T06:58:18Z")

</div>

Do you have the Code up on Github or somewhere else?

---

<div class="post-metadata">

### Author: ![wm-ch](https://avatars.discourse-cdn.com/v4/letter/w/9fc29f/32.png) [@wm-ch](https://forums.pimoroni.com/u/wm-ch)
#### Post date: [January 18, 2025, 7:30am UTC](https://forums.pimoroni.com/t/weather-display-project/27108/5 "2025-01-18T07:30:45Z")

</div>

I had a problem with screen refresh on battery. After reading the forums, I modified the code like this:

> graphics.set\_blocking(False)  
> graphics.update()  
> while graphics.is\_busy():  
> print(“Waiting for graphics to update”)  
> time.sleep(2)

not sure if the set\_blocking() makes a difference. It started working after I inserted the while loop to wait for it to finish.

---

<div class="post-metadata">

### Author: ![wm-ch](https://avatars.discourse-cdn.com/v4/letter/w/9fc29f/32.png) [@wm-ch](https://forums.pimoroni.com/u/wm-ch)
#### Post date: [January 18, 2025, 7:35am UTC](https://forums.pimoroni.com/t/weather-display-project/27108/6 "2025-01-18T07:35:38Z")

</div>

Code is on Github but not public.  
Haven’t figured out how to hide the secrets.py on gh, as well as various credentials to access APIs. I suppose I just delete it and keep it separately.

---

<div class="post-metadata">

### Author: ![bablokb](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bablokb](https://forums.pimoroni.com/u/bablokb)
#### Post date: [January 18, 2025, 8:14am UTC](https://forums.pimoroni.com/t/weather-display-project/27108/7 "2025-01-18T08:14:05Z")

</div>

you should create a file called `.gitignore` in the root of your project and add all filenames there, that contain secrets or things not to publish. Git will then prevent the upload of these files.

I typically use something like this:

```work
*.pyc
TODO
boot_out.txt*
lib
*secrets.py
__pycache__
settings.py
.venv*

```

If you already have it on github, you must be careful, because users can go back in history and find deleted files. So maybe it is better to save your work, delete the complete repo, and recreate it. Of course you also loose your complete history this way.

An alternative is to create a second, public version of the project. But that is hard to maintain in parallel.

---

<div class="post-metadata">

### Author: ![wm-ch](https://avatars.discourse-cdn.com/v4/letter/w/9fc29f/32.png) [@wm-ch](https://forums.pimoroni.com/u/wm-ch)
#### Post date: [January 18, 2025, 1:50pm UTC](https://forums.pimoroni.com/t/weather-display-project/27108/8 "2025-01-18T13:50:55Z")

</div>

Done, it’s here

> **[GitHub - Dataphile-ch/meteo: Display weather and other info on e-paper display](https://github.com/Dataphile-ch/meteo)**
>
> Display weather and other info on e-paper display

Not really industrial strength code, but whatever.

---

<div class="post-metadata">

### Author: ![bablokb](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bablokb](https://forums.pimoroni.com/u/bablokb)
#### Post date: [January 18, 2025, 2:20pm UTC](https://forums.pimoroni.com/t/weather-display-project/27108/9 "2025-01-18T14:20:08Z")

</div>

Thanks! Does not have to be industrial strength unless you expose the service to the internet.

The matplotlib-stuff is nice. I have tried various similar things directly on the InkyFrame, but the Pico fails due to memory.

---

<div class="post-metadata">

### Author: ![wm-ch](https://avatars.discourse-cdn.com/v4/letter/w/9fc29f/32.png) [@wm-ch](https://forums.pimoroni.com/u/wm-ch)
#### Post date: [January 18, 2025, 2:57pm UTC](https://forums.pimoroni.com/t/weather-display-project/27108/10 "2025-01-18T14:57:17Z")

</div>

Matplotlib is infinitely powerful, but quite frustrating. There is a lot of hacking going on here.

Just for fun, the rendering back-end can be different on each platform, so I had to re-do all the font sizes and alignments when I ported it from Mac OS to RPI.

---

<div class="post-metadata">

### Author: ![Shoe](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Shoe](https://forums.pimoroni.com/u/Shoe)
#### Post date: [January 18, 2025, 3:34pm UTC](https://forums.pimoroni.com/t/weather-display-project/27108/11 "2025-01-18T15:34:46Z")

</div>

The blocking change is strange, I would have expected that you’d want the graphics update to block so that the board doesn’t try to go into sleep before the update is done.

I bought the HAT version of Inky Impression, and I’m now mulling over the practicalities of making a Pico adapter for it. It would be a learning experience, but that can be fun in itself, and having the whole thing run on batteries might just be nicer.

---

<div class="post-metadata">

### Author: ![bablokb](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bablokb](https://forums.pimoroni.com/u/bablokb)
#### Post date: [January 19, 2025, 6:00am UTC](https://forums.pimoroni.com/t/weather-display-project/27108/12 "2025-01-19T06:00:56Z")

</div>

I _am_ running the Impression with my own Pico adapters. See [GitHub - bablokb/pcb-pico-pi-base: An Interface PCB to use Pi-Hats with a Pi-Pico(w)](https://github.com/bablokb/pcb-pico-pi-base) and also [GitHub - bablokb/pcb-pico-power-switch: Suport PCB to switch battery power - designed for a Raspberry Pi Pico](https://github.com/bablokb/pcb-pico-power-switch)

Works great. And I can also use e.g. the Waveshare ESP32-S3-Pico, which is pin-compatible and has plenty of RAM.

---

<div class="post-metadata">

### Author: ![Shoe](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Shoe](https://forums.pimoroni.com/u/Shoe)
#### Post date: [January 19, 2025, 11:37am UTC](https://forums.pimoroni.com/t/weather-display-project/27108/13 "2025-01-19T11:37:27Z")

</div>

Ah, brilliant! I’ve done a bit of PCB design before, but I don’t have much experience with the nitty-gritty of MOSFETs, so I was nosing at the schematic for the Inky Frame and trying to work it out from there, but yours looks more simple. 0.35 microamps is fantastic. What kind of batteries are you running it off?

---

<div class="post-metadata">

### Author: ![wm-ch](https://avatars.discourse-cdn.com/v4/letter/w/9fc29f/32.png) [@wm-ch](https://forums.pimoroni.com/u/wm-ch)
#### Post date: [January 19, 2025, 1:22pm UTC](https://forums.pimoroni.com/t/weather-display-project/27108/14 "2025-01-19T13:22:42Z")

</div>

Those look nice. Much tidier than using a HAT connector with lots of wires.

---

<div class="post-metadata">

### Author: ![bablokb](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bablokb](https://forums.pimoroni.com/u/bablokb)
#### Post date: [January 20, 2025, 7:28am UTC](https://forums.pimoroni.com/t/weather-display-project/27108/15 "2025-01-20T07:28:06Z")

</div>

I am using an 18650 LiPo cell. But it should work with any LiPo. The reason for the 18650 is historic: I had this running with a Pi-Zero-W (also with some power-management electronics). Compared to the Pico, the Pi needs a lot more current during an update-cycle so the beefy battery was necessary. Since swapping in the Pico I can’t remember when I had to recharge the battery. Self-discharge is probably higher than what I actually use.

 ![photo_2025-01-20_16-27-18](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/5/59b77472a7a735e6561049d88fb4e3987a0eefce.jpeg)

---

<div class="post-metadata">

### Author: ![Shoe](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Shoe](https://forums.pimoroni.com/u/Shoe)
#### Post date: [January 27, 2025, 8:02am UTC](https://forums.pimoroni.com/t/weather-display-project/27108/16 "2025-01-27T08:02:51Z")

</div>

Ah interesting, thanks! I’m now working through figuring out how to get something similar going. I’ve run some preliminary numbers and wow, yeah, theoretically you get a _lot_ of refresh cycles if you control the power with an RTC/MOSFET pair!

---

<div class="post-metadata">

### Author: ![bablokb](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bablokb](https://forums.pimoroni.com/u/bablokb)
#### Post date: [January 27, 2025, 10:32am UTC](https://forums.pimoroni.com/t/weather-display-project/27108/17 "2025-01-27T10:32:48Z")

</div>

BTW: in the image you can see a predecessor: [GitHub - bablokb/pcb-pico-en-control: Suport PCB to control the enable pin of a Raspberry Pi Pico](https://github.com/bablokb/pcb-pico-en-control). This doesn’t even need a mosfet, since it directly controls the enable pin of the Pico. But the mosfet-solution which directly controls power is much better, because even with the enable-pin hard-wired to ground the Pico still draws 75µA.

---

<div class="post-metadata">

### Author: ![Shoe](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@Shoe](https://forums.pimoroni.com/u/Shoe)
#### Post date: [January 27, 2025, 8:22pm UTC](https://forums.pimoroni.com/t/weather-display-project/27108/18 "2025-01-27T20:22:40Z")

</div>

Yes, I’m a bit surprised at how poor the Pico is in terms of low power, it obviously wasn’t much of a priority for them. In fairness, a dedicated PCB without the LEDs and regulators etc. might be better, but when the MOSFET works so well I’m not sure if the effort is really worth it.

I’d also just like to get used to using MOSFETs as I’ve other projects in mind which will have sensors and things which would benefit from being turned off totally when not needed. I know the RTC could just control the enable pin of a regulator, but I think it is worth knowing anyway.
