filmov
tv
Intro to Raspberry Pi Pico and RP2040 - MicroPython Part 2: I2C Sensor | Digi-Key Electronics
Показать описание
Previously, we saw how to run a simple MicroPython program on the Raspberry Pi Pico using Thonny. We printed “Hello, World!” to the console and blinked an LED. In this tutorial, we will use the I2C module to read from a Bosch BME280 temperature, pressure, and humidity sensor.
I2C is a popular communication protocol used by various chipmakers and is commonly supported by many sensors. It uses 2 lines--data and clock--and supports multiple devices on a single bus.
The RP2040 has 2 I2C buses (not counting the PIO, which we will cover next). We will connect the BME280 sensor to bus 0 and use a simple program to scan the bus. This scan program looks for any devices connected to the bus and returns their addresses. The BME280 sensor can have 2 addresses: 0x76 and 0x77. If the SDO line on the breakout board is connected to 3.3V (default), the address will be 0x77. If it is connected to GND, the address will be 0x76.
We recommend referring to the following documentation when working with MicroPython on the Raspberry Pi Pico:
Product Links:
Related Videos:
Related Project Links:
Related Articles:
Learn more:
I2C is a popular communication protocol used by various chipmakers and is commonly supported by many sensors. It uses 2 lines--data and clock--and supports multiple devices on a single bus.
The RP2040 has 2 I2C buses (not counting the PIO, which we will cover next). We will connect the BME280 sensor to bus 0 and use a simple program to scan the bus. This scan program looks for any devices connected to the bus and returns their addresses. The BME280 sensor can have 2 addresses: 0x76 and 0x77. If the SDO line on the breakout board is connected to 3.3V (default), the address will be 0x77. If it is connected to GND, the address will be 0x76.
We recommend referring to the following documentation when working with MicroPython on the Raspberry Pi Pico:
Product Links:
Related Videos:
Related Project Links:
Related Articles:
Learn more:
Комментарии