Generic2
Carbon dioxide is a critical indicator of indoor air quality that can affect human cognitive
abilities and well-being. The SCD40/SCD41 are Sensirion's next-generation miniaturized CO2 sensors, offering high precision and cost-effectiveness. These modules feature a 2.54mm pitch pin header interface for power supply and communication connections. On-chip temperature and humidity compensation is achieved through built-in sensors for humidity and temperature measurement. The SCD40/SCD41 can intelligently regulate indoor ventilation systems based on C02 concentration levels, thereby maintaining a healthy and efficient environment with low C02 levels over time. This makes the SCD40/SCD41 ideal for applications focused on improving indoor air quality.
Features
- 2.4-5.5V
- Detects CO2 Carbon Dioxide 400-5000ppm
- Detects Temperature
- Detects Humidity
- I2C Communication
Specifications
- Reference Accuracy and Range: SCD40: 400-5000 ppm
- Supply Voltage Range: 2.4-5.5 V
- High Accuracy: ±(40 ppm + 5%)
- Digital Interface: 12C
- Integrated Temperature and Humidity Sensor
- Low Power Consumption
- Typical Accuracy 50ppm +-5% reading
- Pin Definitions
GND: Ground input terminal
VDD: Positive power supply input terminal
SCL: 12C clock terminal
SDA: 12C data terminal
What's in the box?
1 x SCD41 sensor
Resources
The SCD40 and SCD41 are high-performance "True" CO2 sensors. Unlike cheaper VOC sensors that estimate CO2 levels, these use photoacoustic technology to measure the actual concentration of CO2 in the air.
The setup for the Raspberry Pi 5 (and older models) involves the I2C interface.
1. Hardware Connections (I2C)
The module communicates via I2C, which only requires four wires. Note that while these sensors can handle 5V power, the Raspberry Pi's logic pins are 3.3V. Ensure your module's I2C lines are compatible (most breakout boards from Adafruit/PiShop have 3.3V regulators/shifters built-in).
| Sensor Pin | Raspberry Pi Pin | Physical Pin # |
| VIN / VCC | 3.3V (or 5V if supported) | Pin 1 (3.3V) or Pin 2 (5V) |
| GND | Ground | Pin 6 |
| SCL | I2C Clock (GPIO 3) | Pin 5 |
| SDA | I2C Data (GPIO 2) | Pin 3 |
2. Enable I2C on the Raspberry Pi
Before you can read the data, you must enable the I2C port:
Run
sudo raspi-configin the terminal.Navigate to Interface Options > I2C.
Select Yes to enable it.
Reboot your Pi.
(Optional) Check if the sensor is detected by running
i2cdetect -y 1. The SCD4x should appear at address 0x62.
3. Install the Python Library
The easiest way to interact with the SCD4x in 2026 is via the Adafruit CircuitPython library, which is fully compatible with standard Raspberry Pi OS.
# It is recommended to use a virtual environment on the Pi 5mkdir co2_project && cd co2_projectpython3 -m venv .venvsource .venv/bin/activate# Install the librarypip3 install adafruit-circuitpython-scd4x
4. Python Example CodeThis script initializes the sensor and prints the CO2, Temperature, and Humidity readings every two seconds.
import timeimport boardimport adafruit_scd4x# Initialize I2C bus and sensori2c = board.I2C()scd4x = adafruit_scd4x.SCD4X(i2c)print("Serial number:", [hex(i) for i in scd4x.serial_number])# Start the sensor's internal measurement cyclescd4x.start_periodic_measurement()print("Waiting for first measurement (takes ~5 seconds)...")try: while True: if scd4x.data_ready: print(f"CO2: {scd4x.CO2} ppm") print(f"Temperature: {scd4x.temperature:.1f} °C") print(f"Humidity: {scd4x.relative_humidity:.1f} %") print("-" * 20) time.sleep(2)except KeyboardInterrupt: # Important: Stop measurements to save power/sensor life scd4x.stop_periodic_measurement() print("Measurements stopped.")
Key Differences for SCD41 UsersIf you specifically have the SCD41, you have a few extra features:
- Single Shot Mode: The SCD41 can take a single measurement and go back to sleep, which is better for battery-powered projects. The SCD40 must remain in "periodic" mode.
- Extended Range: The SCD41 reads up to 5,000 ppm (and even up to 40,000 ppm in "extended" mode), whereas the SCD40 is optimized for indoor air quality up to 2,000 ppm.
Pro Tips
If you are using this sensor for a commercial project in South Africa (like a school ventilation monitor), look into Automatic Self-Calibration (ASC). By default, these sensors calibrate themselves based on the lowest CO2 reading they see every week. If your room is never fully ventilated (never hits 400ppm), the sensor's readings will "drift." You can disable ASC in the code if you prefer to do a manual calibration outdoors.
1.3-inch 4-pin I2C OLED Display Module (SH1306, 128x64 Pixels)
The 1.3-inch OLED display is a high-contrast, compact screen ideal for adding user interfaces, data readouts, or graphical feedback to your microcontroller projects. Featuring the SH1306 driver, this module offers a resolution of 128x64 pixels and produces bright, crisp visuals with deep blacks, as each pixel is self-illuminating and requires no backlight.
This specific model comes pre-soldered, allowing for immediate integration into your projects without the need for manual header installation. Its I2C (IIC) interface ensures simple, space-saving communication, requiring only four pins to operate.
Key Features
- Display Quality: 128x64 high-resolution display with a wide viewing angle and high contrast ratio.
- Driver IC: Uses the reliable SH1306 controller, widely supported by popular libraries.
- Compact & Low Power: Small 1.3-inch form factor that consumes very little power, perfect for battery-operated devices.
- Simple Interface: Uses the I2C protocol, keeping your wiring clean with only four connections (VCC, GND, SCL, SDA).
- Pre-Soldered: Equipped with a pre-soldered header for immediate use on breadboards or custom PCBs.
- Versatile Compatibility: Compatible with Arduino, Raspberry Pi, ESP32, ESP8266, and other popular development boards.
Technical Specifications
| Parameter | Detail |
| Screen Size | 1.3 inches |
| Resolution | 128 x 64 pixels |
| Driver IC | SH1306 |
| Interface | I2C / IIC |
| Supply Voltage | 3.3V – 5V DC |
| Viewing Angle | > 160° |
| Display Color | Usually Blue or White (depending on model) |
Typical Applications
- Smart Wearables: Creating readable interfaces for custom fitness trackers or watches.
- Project Monitoring: Displaying real-time sensor data from temperature, pressure, or air quality sensors.
- Menu Systems: Building navigation menus for hand-held control devices.
- Portable Instruments: Compact, high-visibility readouts for custom testing equipment.
What's in the box?
1 x 1.3inch OLED display
Resources
Using the 1.3-inch SH1306 OLED with a Raspberry Pi is a great way to provide a visual interface for your projects. Since it uses the I2C interface, the wiring is simple and identical to the sensor module we discussed earlier.
Wiring Guide
Ensure your Raspberry Pi is powered off before making these connections.
| OLED Pin | Raspberry Pi Pin (GPIO) |
| VCC | 3.3V (Pin 1) |
| GND | GND (Pin 6 or 9) |
| SCL | SCL (Pin 5) |
| SDA | SDA (Pin 3) |
Step-by-Step Setup
1. Enable I2C:
- If you haven't already, run
sudo raspi-config. - Navigate to Interface Options > I2C and enable it.
- Reboot the Pi.
2. Verify Detection:
- Run
i2cdetect -y 1. - You should see a hex address appear in the grid (typically
0x3c). This confirms the Pi is communicating with the display.
3. Install Python Libraries:
- The Luma.OLED library is the industry standard for driving these displays on Raspberry Pi.
- Install the dependencies:
sudo apt-get install python3-pip python3-dev libfreetype6-dev libjpeg-dev build-essential- Install the library:
sudo pip3 install luma.oled
4. Running a Demo:
- Luma includes a set of examples. You can navigate to their GitHub repository or run a simple test script to verify your display.
Important Tips
- Driver Configuration: Many tutorials online default to
ssd1306. If your display shows distorted images or shifted columns, you are likely using the wrong driver. Always double-check that your code initializes the device as ansh1306. - Power: While most of these modules are 5V tolerant, it is safer to use 3.3V to match the logic levels of the Raspberry Pi's GPIO pins.
- Refresh Rate: If you are planning to show animations, keep in mind that I2C is slower than SPI. For standard text and simple graphics, I2C will be perfectly responsive.
Build Your DIY Powered Models, Solar Display and Solar Toys. This 12V solar panel is lightweight, and durable, making it perfect for any small on the go project.
Specifications
- Power: 1W
- Voltage: 5V
- Material: Polisilicon
- Size: 136mm x 110mm
What's in the box?
1 x 12V Solar panel
Ideal for intricate circuit prototyping and point-to-point modifications, this ultra-thin 30AWG red wire is the finest gauge in our inventory. Supplied on a generous spool of approximately 10 meters per colour, this tin-plated copper wire offers exceptional solderability and holds its shape reliably when routed around tight spaces. Also known as wire-wrapping wire, it is a staple for any regular electronics workbench. We highly recommend pair-using it with dedicated 30AWG wire strippers to prevent damaging the core.
Specifications
Colour: Red, Blue, Green, Yellow, Black, White
Gauge: 30AWG (0.255mm diameter / 0.05 mm² cross-section)
Length: 10m per spool
Conductor: Tin-Plated Copper (Oxidation Resistant)
Insulation: Silicon (Rated up to 200°C)
What's in the box?