A personal introduction to embedded programming and microcontrollers, the inspiration for which stemmed from a combination of Pi-hole's PADD (hence the naming) and this recreation.
It serves as a real-time display centred around daily prayer times in addition to collecting a variety of data.
Note
IP and MAC addresses have been masked in the image above for demonstration purposes.
- The following information is based on your city (click here to learn more):
- Ambient temperature, humidity and pressure readings.
- Connection configurations for your local network.
Note
Local weather, internal atmosphere and network meta is refreshed once every 5 minutes of each hour.
Components list:
- Raspberry Pi Pico W
- ILI9341 320x240 2.2" TFT SPI display
- BME280 sensor (Pimoroni's version was used, though it shouldn't matter)
The resulting circuit diagram is as follows:
GPIO pins 16, 17, 18 and 19 control the LCD via SPI (default) channel 0, whilst sensor communication is achieved over I2C (default) channel 0 by way of GPIO pins 4 and 5 as per the Pico's pinout.
Assuming your board hasn't been flashed yet, follow this video tutorial to install Thonny IDE along with the binary file necessary for configuring MicroPython.
All source code for the libraries used is found within the
lib
directory - no additional dependencies
are required.
Ensure that env.json
is present within the root directory of your Pico's filesystem prior to
running main.py
as it securely stores network credentials, city and country names. Its structure
is outlined below:
{
"SSID_NAME": "router_name",
"SSID_KEY": "router_password",
"CITY_NAME": "your_city",
"COUNTRY_CODE": "two_letter_country_code",
"APP_ID": "openweathermap_api_key"
}
Replace each placeholder with its corresponding case-sensitive value. APP_ID
defines an
OpenWeatherMap API key, which is generated upon registering an account
here if you don't already have one.
- MicroPython's implementation of the
urequests
library is outdated and struggles to support HTTPS requests, resulting in issues accessing a more accurate and comprehensive prayer times API. - On-board storage constraints meant functioning Python libraries (namely
requests
andbeautifulsoup4
) couldn't be installed locally with their dependencies to synchronously resolve the issue above through web scraping. - The character set for fonts provided by the display driver library used were restricted, reducing visual appeal due to the range of available symbols.