Tested on:BeagleBone black
Prerequisites:Raspberry Pi with Raspbian Jessie and internet connection (see steps 1-7 in the Introduction)
Hardware:SCD30 with pins and jumper cables

Reading the CO2 sensor SCD30 over I2C with Smbus

The sensor SCD30 by Sensirion is a precision sensor for measuring CO2 concentration, temperature and humidity and can be read by a Raspberry Pi or BeagleBone. Sensor access is based on the I2C protocol.

Since this was a remote project for a client, i need to refer to the data sheet for assembly.

Activate I2C with raspi-config and install the script with

Execute it by entering

Code explained
I2C communication is based on hexadecimal control commands. The command 0x0300 enables reading the data; in case of the sensor SCD30, 18 bytes are required.

Finally, the data needs to be decoded from Big Endian into floating point numbers:

Since i do not own this sensor, i can’t give support for this tutorial.
Special thanks to Roberto for allowing to share this code!

Full script
Click on Full Script to show all of the code.

data sheet SCD30: https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/0_Datasheets/CO2/Sensirion_CO2_Sensors_SCD30_Datasheet.pdf

Knight of Pi

Johannes Bergs aka Knight of Pi. Diploma in Bioinformatics, some Webdesign and Python coding then. Living in the beautiful city of Vienna.


  1. generically it’s ok but in practice it doesn’t work, I’ll try, then I say anything

  2. Hello, I was just wondering what circuit you used to connect your sensor to the pi?

    • Sadly, no, i don’t own the sensor so i can’t test it. But the data sheets i referenced should help with that.

  3. Is it possible to provide a wiring diagram for the SCD30 and pi connection?


Time limit is exhausted. Please reload CAPTCHA.