Personal info station

Wifi connected station to display what I'm most interested in not just in the morning

Used tools, methods and technologies:

  • OLED display, Raspbery Pico W
  • MicroPython, Thonny IDE
  • API keys and online services

     This small project was a way to try different IDE than typical VS Code for Micropython projects of mine. But to be fair, I used Thonny IDE before for some robotic bricks. But that just a side-quest, lets dive tho the project.

Hardware and prep

Project Image

     Hardware is very thin part of this project, beside the MCU (Raspberry Pico W) and display (OLED 128x64 I2C) I used just some wires and a breadboard. The display is connected to the Pico W via I2C, so only 4 wires are needed (VCC, GND, SDA, SCL). Check the wiring diagram. Then you have to boot the Pico W in bootloader mode (hold the BOOTSEL button while plugging it to USB) and copy the MicroPython UF2 file from the Raspberry Pi website. Then connect to it by replugging it into the computer, this time without BOOTSEL and establish connection by clicking on it in bottom/right corner of Thonny. For controling the OLED display after that, i can recommand this tutorial. It shows how to download needed library ssd1306 which makes display control easy.

API keys and software

Project Image

     For this project, I needed API keys to open online services with the data to feed my info station. API (application programming interface) is a unique identifiter in a form of a code used to authenticate and authorize user access to online data. I used OpenWeather for weather data and Alpha Vantage for stock prices. All of these services are free for basic use, but you have to register and get your own API key.

     For getting the data from servers in python, I without shame recommand Claude AI chat to write that code. Finding it in documentation is painful. Formating the text is then an easy but long job. I connected all the data into two strings, weather one and financial one, to display. The displaying itself is simple and elegant scrolling text, similar to those famous Wall Street big stock tables. I am quite proud of that one and if anyone comes with an even simpler solution, I will buy them a beer!

     The program has to be named main.py for the Pico to run it on startup. Just reminding, that you need to have also the ssd1306 lib dowloaded to your Pico, resource mentioned above and you can just download mine down there. I tried to be pedantic with comments in the code because its one of the longer ones I upload here. For a new user all you have to do is fill your local network credentials, API keys and maybe different set of stocks. For weather you need to change the weather adress to your city.

Main.py (personal info station) ssd1306.py (OLED display library)

Results

Image 2

Setup is simple, code not quite

     The result is a fully functional info station displaying real-time weather and financial data on a small OLED screen. There is only one catch I wasn't able to fix and that is when you turn the program off and fast on again, it has problems to fetch the financial data and have to wait for an update. The scrolling text is smooth and user can define its speed, making it easy to read the information at a glance. I will put this little gadget on my desk to have a quick morning overview and report on how handy it will be.