Skip to content
This repository was archived by the owner on Jun 14, 2024. It is now read-only.

Commit 7d79ab3

Browse files
author
Andrew Menagarishvili
committed
BME280 example doc
1 parent 44bae93 commit 7d79ab3

File tree

1 file changed

+43
-0
lines changed
  • Examples/Microsoft.PowerShell.IoT.BME280

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Example module Microsoft.PowerShell.IoT.BME280
2+
3+
This PowerShell module is for interacting with [BME280 environmental sensor](https://www.bosch-sensortec.com/bst/products/all_products/bme280) for reading temperature, pressure and humidity.
4+
5+
## Hardware setup
6+
7+
Several vendors have breakout boards with BME280 sensor. In this example we'll use [BME280 breakout board from Adafruit](https://www.adafruit.com/product/2652).
8+
BME280 sensor supports both I2C and SPI interfaces; in this example we'll use I2C.
9+
Later, in the software section, we'll need to use I2C address of the BME280 sensor.
10+
The default I2C address is 0x77. It can be changed to 0x76 by connecting SDO to GND.
11+
Wiring diagram with Raspberry Pi 3 is like this:
12+
13+
## Software setup
14+
15+
### Install PowerShell Core on Raspberry Pi
16+
17+
Installation instructions can be found [here](https://github.com/PowerShell/PowerShell/tree/master/docs/installation/linux.md#raspbian).
18+
19+
### Enable I2C interface on Raspberry Pi
20+
21+
1. sudo raspi-config
22+
2. 5 Interfacing options
23+
3. P5 I2C
24+
4. Would you like ARM I2C interface to be enabled -> Yes
25+
26+
### Start Powershell and install modules
27+
28+
```powershell
29+
sudo pwsh
30+
Install-Module -Name Microsoft.PowerShell.IoT
31+
git clone https://github.com/PowerShell/PowerShell-IoT.git
32+
Import-Module ./PowerShell-IoT/Examples/Microsoft.PowerShell.IoT.BME280
33+
```
34+
35+
### Collect Data
36+
```powershell
37+
PS /home/pi> $d = Get-BME280Device -Id 0x77 # I2C address of the sensor
38+
PS /home/pi> Get-BME280Data -Device $d
39+
40+
Temperature Pressure Humidity
41+
----------- -------- --------
42+
26.08 1009.41 29.21
43+
```

0 commit comments

Comments
 (0)