KalbeAbbasPragmaticPhil
Published © GPL3+

Weather Station with XinaBox xChips, Mu and CircuitPython

Learn how to make a simple weather station with XinaBox xChips then code it using the Mu editor and CircuitPython.

BeginnerProtip15 minutes371
Weather Station with XinaBox xChips, Mu and CircuitPython

Things used in this project

Hardware components

CC03
XinaBox CC03
×1
IP03
XinaBox IP03
×1
SW01
XinaBox SW01
×1
XC10
XinaBox XC10
×1
XS02
XinaBox XS02
×1

Software apps and online services

Mu editor
circuitpython-Feather-M0-Basic firmware

Story

Read more

Code

code.py

Python
import time
import board
import busio
import adafruit_bme280
 
# Create library object using Bus I2C port
i2c = busio.I2C(board.SCL, board.SDA)
 
#initialize SW01 sensor
bme280 = adafruit_bme280.Adafruit_BME280_I2C(i2c)
 
 
# change this to match the location's pressure (hPa) at sea level
bme280.sea_level_pressure = 1013.25
 
while True:
    
    #Plot weather values on Mu Plotter
    print((bme280.temperature,bme280.humidity,bme280.pressure))
    
    #Print on Serial console
    print("\nTemperature(C): "+str(bme280.temperature))
    print("Humidity(%): "+str(bme280.humidity))
    print("Pressure(hPa): "+str(bme280.pressure))
    time.sleep(1)

Credits

KalbeAbbas

KalbeAbbas

25 projects • 12 followers
An enthusiastic and dedicated Electronic engineer graduated from SSUET Karachi, Pakistan. Loves to discover Embedded electronics projects.
PragmaticPhil

PragmaticPhil

11 projects • 12 followers
Hobbyist: some of this I write from scratch, some I work with developers and test / edit. Java + micro:bit are my thing. Work at XinaBox.cc.

Comments