Raspberry Pi Pico W: Wireless Weather Station

Raspberry Pi Pico W: Wireless Weather Station

????

Raspberry Pi Pico W microcontroller review, plus tutorial connecting the board to a BME280 sensor module to create a wireless weather station that transmits temperature, pressure and humidity readings to a web browser. On this web page you can find the wiring diagram and a link to the final code: https://www.explainingcomputers.com/pi_pico_w_weather.html The excellent Pi Pico W "getting started" instructions from the Raspberry Pi Foundation are here: https://projects.raspberrypi.org/en/projects/get-started-pico-w The page with links to download the MicroPython UF2 file is here: https://www.raspberrypi.com/documentation/microcontrollers/micropython.html The Pimoroni BME280 sensor I used in the video is available directly from Pimoroni, or on Amazon.co.uk here: https://amzn.to/3cBT4rM A compatible board is available on Amazon.com here: https://amzn.to/3PXnF1q Note that these are affiliate links, and that as an Amazon Associate I earn a commission from any qualifying purchases you may make. If you like this video, you may also be interested in my other Pi Pico videos, including: Raspberry Pi Pico: Inputs & Servos: https://www.youtube.com/watch?v=TDj2kcSA-68 PicoMite: Running BASIC on a Raspberry Pi Pico: https://www.youtube.com/watch?v=Cxmjy1nz6MM IN CASE OF DIFFICULTIES: If during your experimentation you end up with a Pi Pico W that executes a program that you cannot interrupt by pressing Ctrl-C or Ctrl-F2 in Thonny, you can return the board to its factory state by holding down the boot select switch, connecting to a PC, and copying over a special UF2 file to reset the flash. You can find a link to this UF2 file at the bottom of this page: https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html Note that after execution you will have to reinstall MicroPython and any required libraries, such as the one for the BME280. All programs will also be erased! Hence, during program development, it is wise to save a copy to both the Pico W and to the PC you are working on. For additional ExplainingComputers videos and other content, you can become a channel member here: https://www.youtube.com/channel/UCbiGcwDWZjz05njNPrJU7jA/join More videos on computing and related topics can be found at http://www.youtube.com/explainingcomputers You may also like my ExplainingTheFuture channel at: http://www.youtube.com/explainingthefuture Chapters: 00:44 Pico + Wireless 02:37 MicroPython & Thonny 06:23 BME280 (Sensor) 08:13 Reading the Sensor 11:26 Final Code 15:13 Remote Test 16:23 Wrap #RaspberryPicoW #PicoW #BME280 #ExplainingComputers

Advertisement

LEAVE YOUR COMMENT

LATEST COMMENTS

@antoniopiconrodriguez554 Says:
Hi!! Congrats!! It would be possible to develop a weather station in a Raspberry 4B where It IS running Open Media Vault? Maybe as a docker compose? Anda it must be wireless. Thanks!!
@seasonedtoker Says:
It is totally silly that every project I get into wit pico or rpi, Christopher has already done it, and to make matters more interesting, he actually gets his project to a point of same complexity that I am interested in, like sensor data shown on oled display, etc. Thank you for your videos, Christopher
@przemeko Says:
GreatScott !
@kerbalette156 Says:
Dunno why but I always get BBC tomorrow’s world vibes when I watch you
@allstar7778 Says:
do we really need to use that white board on which you soldered the pi pcb ? can't the sensor directly connect on pi board without using any white board ?
@rongeernaert1208 Says:
Thanks for BME280 info, and I go to put a selfmade tipping bucket for rain messure !🤠
@arniep740 Says:
Thank you for this video. I enjoy all of your videos. I did get this one to work. However, I was wondering if there is a simple way of displaying each datum on a separate line on the webpage? I am pretty ignorant about how to format data on a webpage. Thank you and I hope to hear from you about this! Cheers!
@micgent Says:
I feel like im back in the classroom, only this time I want to learn. Thank you for the great content. Now im off to integrate this into my Home Assistant.
@damienduddy3096 Says:
I started building my own just before this video came out. I had been meaning to update it as it was a prototype. It was a Pi Zero W connected to a 12v 7ah lead-acid battery and using OpenPyXL to record the values. I have finally finished the project by changing it to running on a Pico W, using Powerboost 1000c from Adafruit and a 4000mAh LiPo connected to 2 6-volt solar panels. I might upgrade it again once I acquire a Pico 2, as it draws less power. However, I want to finish the backlog of other projects before buying anything new. Thank you so much for this video, Chris! Yours is one my absolute favourites on Youtube! Looking forward to seeing a video on Pico 2!
@davids9139 Says:
I was just curious how these little boards work...watched this video....now I'm like "shut up and take my money!" Thank You for this video!
@GenesCustoms. Says:
That is cool! I am not a code type guy, but I am interested in building a DIY Raspberry Pi5 weather station. along with my SkyCam I set up. Wish me luck.
@teobenedict1733 Says:
Easy to understand and a great introduction to the raspberry pi pico w! Will be great if you can show us how to activate a fan when a certain temperature has been reach.
@TraceHadfield Says:
I like your channel thanks! I tried the pico w weatherstation, but got an error trying to install the bme280 package. While trying to search, it gave the Error code: Any suggestions? Thanks.
@patrickrobinson317 Says:
When the Pico was connected directly to your computer the IP was 192.168.1.109. It was easy to see the IP Number on the screen at that point. 😊 After you took it outside it changed to 192.168.1.106. So, how did you determine what the new IP number was without having a screen attached to the Pico ? 😊 Thanks in advance for your reply !!!
@JeremyDWilliamsOfficial Says:
I have watched MANY tech videos. You are EXTREMELY good at making these kinds of videos. They are to the point, clear, cover the important parts without going down rabbit holes - and best of all, provide quality resources that actually help. Please keep it up! And if you arent already covering this topic and are very brave, consider ROS2 tutorials (without using containers). Thanks again. Subbed. (I’ve seen your work before but have no clue why I wasn’t subbed already. I just assumed I was already as you’re that good!)
@jwaddin Says:
Amazing job! Thanks for sharing! ❤
@diodeskies9087 Says:
Fantastic thank you
@danandnancystone5530 Says:
I have imported the module micropython_bme280. When I run the code, I get this error: Traceback (most recent call last): File "", line 4, in ImportError: no module named 'bme280' How can I fix this?
@davetelling Says:
micropython-bme280 will not install in Thonny. I keep getting an error saying that it does not appear to be a python project. "bme280" (with the micropython-) installs OK, but obviously is not the one to use. I'm totally new at this, and am not sure what to do at this point.
@shipbl1 Says:
Could this project be possible on a pi3 a+, as I already have one laying around? Cheers
@davetelling Says:
This is so freakin' cool! I'm going to have to try it!
@graxxor Says:
Your channel reminds me of those old BBC coding programmes that they used to show when I was a kid... Filling our heads with fancy ideas, sparking our imaginations and above all showing us that this arcane magic was within our very grasps if we just pushed our envelopes a bit and tried something new. I honestly feel that the Pico W is now where the original RPi intended to be... with the added benefit of wifi!
@daverich3352 Says:
You have the same presentation style they used on Tomorrow's world in the 1980s.
@jamiroquaiordie Says:
thank you Carlos Balá for all your knowledge
@DiegoSandoval-cs5oo Says:
What kind of solder do you recommend for a beginner? Leaded or Lead-free? What's more safe?
@adrift4days Says:
Extremely grateful for your work - so glad that I stumbled upon your channel, exactly what I was looking for.
@Johan7188 Says:
I've followed the video, connected the devised and copied the code. When trying to run the code I get the following error "AttributionError: 'module' object has no attribute 'BME280'". How do I resolve this error? Thank you.
@thespacecowboy420 Says:
Wow you actually used a BME280... because this is Rpi and not garb-o arduino... so you can't easily use garb-o sensors. Nice.
@juleshorne8580 Says:
Great video! Super clear and encouraging
@Yakroo108 Says:
👍👍👍
@peters6601 Says:
After much head scratching have managed to get this interesting project working late 2023! Since this video was made the Pi OS has become 'Bookworm', the only way I could get it to work for me was to use all software that is pre May '23. Was not straightforward, which is good as I learnt something.😁
@larrybud Says:
Any idea of the range of the wifi?
@tubenutzer0007 Says:
In terms of content, I am looking for a way to store the access data for the WLAN securely, i.e. not in a separate file as plain text. As the RP2040 does not have a CryptoChip, the integration of an external chip such as the ATECC608A would be a possibility. But to be honest, that's a bit too much for me without help...
@sokoloft3 Says:
Its working. However once its on the pico. I cant edit the code. Thonny keeps screaming at me about some issue in its backend and not having permission or the pico doesn't understand something.
@mihailvormittag6211 Says:
👍
@jacobframe8769 Says:
Most excellent video! Thank you for sharing!
@jameslinderman6825 Says:
I am having the toughest time with this! it keeps giving me an error on the line that has: bme = bme280.BME280(i2c=i2c) and also: File "/lib/bme280.py", line 75, in __init__ I am pulling my hair out! Any suggestions?
@macdaddykwm1 Says:
I am planning to do this project with my grandson with a solar panel to kee p it running. Do you have any data on power consumption?
@MorrWorm8 Says:
when I go to tools and manage packages the micropython bme280 is gone. there doesn't seem to be a new version or alt usable version. I don't know why. I tried running the code anyway and im getting a MPY: soft reboot Traceback (most recent call last): File "", line 54 SyntaxError: invalid syntax im def at my wits end. lol I will keep plugging away though because im pretty stubborn. thank you for a great video as usual. I love all your content.
@charlierumsfeld6626 Says:
Hi, just found this video. Are there weatherproof sensors to use this to read outdoor values?
@peterwest1158 Says:
Hi Chris, I am looking at measuring sunshine as well as temp etc. Any ideas?
@girishbaliga961 Says:
nice
@itsskyballs Says:
In 14:27 You must add a UI so to make it fresh watch experience then make it LIVE without refreshing the website Wait...does it work on VS code?
@BruceWeber-x6n Says:
Just saw this great video - thanks. However, the bme280 library you select and use in your code is not found now in Thonny's Manage Packages. Those that are found are shown to be incompatible with Micropython. Suggestions?
@adpesk Says:
Really awesome explanation.... thanks a lot!
@devnull256 Says:
It's very nice, informative and concise, thank you! Would add something into a code for getting right IP address as it can change from boot to boot. E.g. can it e-mail you (or may be some other means) its current IP once it booted with some "id" of the board? e.g. if one has several of these in different locations and want to collect data from several boards (but then it is probably worth of making them all dump the data (e.g. over ssh) to some cloud server with known URL)
@qisenwang-h6o Says:
Hi, how to set up the wifi if i am using school wifi, it will use another user name and password, but the wifi name is not the user name? And i am using BME680 but didn't find the micropython library. thank you.
@ncaa79 Says:
I have been trying to get this project to work. I can get the simple " hello world to work". I even coppied the code. The problem I have is the BME280 library will not install. Using Thonny, trying to duplicate everything your doing. I just cannot get the library to load. Message, "ImportError: no module named 'bme280'". Any thoughts. I bought another BME280, however just trying to install the library, the component should notr make a difference. tim
@raisagorbachov Says:
I like it. Now I can see how to change the values on a webpage. I still need to learn how to do the data entry via a webpage.
@warronfrench8163 Says:
I loved this video! Is it possible to build something like this and somehow send the date to a time-series database such as RRD? Then perhaps you could check the present weather, check the average {temperature, pressure, humidity, wind direction, and speed} or the highest of those in the past 5 years If you build an RRD appropriately? I noticed that the bm280 didn't include a sensor for wind tracking at all. Is there another module or product that can do all of them, obviously with extra gear? My father was a US Air Force meteorologist and I want to build something like that.

More Programing Videos