Sensirion SCD30 CO2 sensor con ESP32
Alimentazione 3.3-5 V
Bus I2C
Indirizzo I2C
0x61
Misura CO2, temperatura, umidità
Pin e collegamento all’ESP32
| Pin | Ruolo | Pin ESP32 | Note |
|---|---|---|---|
| VDD | Alimentazione | 3V3 | Pin 1 |
| GND | Massa | GND | Pin 2 |
| SCL | Clock I2C (SCL) | D22 | Pin 3 (TX/SCL). The sensor stretches the clock: use 50 kHz or less |
| SDA | Dati I2C (SDA) | D21 | Pin 4 (RX/SDA) |
| RDY | Interrupt | D35 | Pin 5. HIGH when a new reading is ready, optional |
| PWM | Uscita (la pilota il componente) | D25 | Pin 6. PWM CO2 output, optional |
| SEL | Non collegato all’ESP32 | — | Pin 7. Leave open or LOW for I2C; HIGH selects Modbus |
Collegamento consigliato per l’ESP32 DevKit a 30 pin, evitando i pin della flash, di sola lettura e di strapping. BoardPilot lo controlla mentre colleghi.
Codice di partenza (Arduino)
#include <Wire.h>
void setup() {
Serial.begin(115200);
Wire.begin(21, 22); // SDA = GPIO 21, SCL = GPIO 22
Wire.beginTransmission(0x61);
bool found = Wire.endTransmission() == 0;
Serial.println(found ? "Sensirion SCD30 CO2 sensor found at 0x61" : "Not found: check power, GND and SDA/SCL");
}
void loop() {}
Fonti
- Sensirion SCD30 datasheet, Pin 1 VDD, 2 GND, 3 TX/SCL, 4 RX/SDA, 5 RDY, 6 PWM, 7 SEL; supply 3.3 to 5.5 V
- Sensirion SCD30 interface description, I2C address 0x61, max 100 kHz, clock stretching up to 150 ms
Provalo in 3D in BoardPilot
Componenti simili
ADS1015 12-bit ADCADS1115 16-bit ADCADXL375 high-g accelerometer (±200 g)AHT10 temperature + humidityAHT20 + BMP280 combo moduleAHT20 temperature + humidity
Dati dei componenti: CC BY 4.0, riutilizzabili citando BoardPilot.