cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with I2C communication between NUCLEO-F042k6 and CO2 Sensor SCD30

MPote.1
Associate II

I spend whole day traying establish communication between NUCLEO-F)42k6 and CO2 Sensor SCD30 https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/9.5_CO2/Sensirion_CO2_Sensors_SCD30_Interface_Description.pdf

I have connected SDA line from Sensor to D2(PA12) on Nucleo and SCL from Sensor to D8(PF1).

GND from sensor connected to GND on Nucleo and VCC from sensor conected to 3.3 on Nucleo.

I'm using STM32 Workspace and in STM32CubeMX perspective I have configured GPIO pins like described above. Additionally I set No pull up and No pull down for SCL and SDA as it look like its done on sensor board by manufacurer. GPIO Mode Alternate Function Open Drain.

I'm receiving in putty terminal following output:

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒-Buffer

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒-Buffer

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒-Buffer

▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒-Buffer

I will be appriciate for help with getting CO2, Huminidity and Temperature readings from this sensor. This is my beggining with STM32 and after whole day I haven't idea how to proceed with that. My code which require correction is below.

20 REPLIES 20

Hi, can you give us an example of a code that reads CO2 measurment fron SCD30. Thanks

Hi, did you fine a solution ?

Hi ,

I have been trying to use the SCD30 for STM32F103C6T6..but not getting any I2c data ..

also tried the same with Disco board ST25R3911B..let me know if you have any suggestion on this ...will really help..

OZera.1
Associate II

Hi, this code worked for me, maybe you can try it and send me back

https://github.com/Ons-zerai/Sending-SCD30-sensor-data-to-a-network-server-via-LoRaWAN-protocol-

Best regards

Ons

Hi,

Thanks for your reply...I am using CubeMx to generate the .c code..looks like there is some I2C communication issue..have been trying to do even bitbang code..but not finding any solution.

I have attached the code..have a look and let me know anything needs to be changed.

regards

Ravi

I am also using SCD30 interface for the same....even the address all looks fine..let me know any change in code is required..more to do with what lower level I2C interface gives as output...

RShiv.1
Senior

I think you have not used STM32 controller where it does I2C communication to achieve this..

Let me know if you get any pointers.

RShiv.1
Senior

Hi Ozera,

It looks like you also have SCD30 connected to STM32...can I know which cubeMx version you used to generate the I2C HAL..because we have tried almost all but none is working..

Kindly let me know.

Thanks

Ravi

S.Ma
Principal

I used SGP30-2.5k sensor without issue with bitbang. Some other sensord from the vendor are not true I2C slaves and special pseudo I2C bit bang sourcs to fill is provided...

RShiv.1
Senior

Hi,

even with STM32F103C8 also we are facing the same issue as C6...built the project using STMcubeMx..

is there really a problem in cubeMx...waiting for response from any one..

regards

Ravi