A small project to demonstrate how to set up a simple web server using the Pi Pico W (WiFi) board
The BME280 is an environmental sensor capable of measuring temperature, pressure and humidity. The sensor interface code is
based on a version originally developed by Adafruit Industries. See the copyright information in the BME280.py
file header for full details.
Attach the sensor to the Pi Pico as shown below
Pi Pico | Pin | BME280 |
---|---|---|
GP0 | 1 | SDA |
GP1 | 2 | SCL |
GND | 3 | GND |
3V3(OUT) | 4 | 2-6V |
The example presented here was developed using PyCharm from JetBrains using the MicroPython plugin.
The code is in a style to aid understanding rather than being production ready. For example:
- Lots of output to show what is happening
- Various delays between steps with LED flashing to demonstrate progress if running disconnected
- Minimalist error handling - if broken, restart !
If you deploy and run the program, opening a browser connection to the address shown in the
Web server is now listening on address: a.b.c.d
message, should give you a simple page with the sensor values
The BME280 sensor used
Bosch datasheet for the sensor
If you find this project useful, you may want to Buy me a Coffee! ☕ Thanks 👍