- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am supposed to interface a SGP40 VOC Sensor Waveshare 20168 SGP40 VOC Sensor, 17,90 € - Welectron with a CY8PROTO-062-4343W board via I2C. Since I have no experience with this, I copied the code snippets from here PSoC 6 Peripheral Driver Library: I2C (SCB) (infineon.github.io) into Eclipse IDE (attached). The output when running the code is only 0s. I don’t know how to modify the code to make it work or if this is even possible without writing a whole new library for the sensor?
Thanks for any advice!
Solved! Go to Solution.
- Tags:
- i2c
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @as234 ,
You must implement the code according to the below Transaction mentioned in the Communication protocol section in the SGP40 sensor datasheet. You can see the description of each API and implement it according to the below.
Thanks and regards,
Sidramesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @as234 ,
Please elaborate on your concern in detail. So, are you facing difficulties in initiating communication with the sensor? You mentioned the output of the code is 0s only, so do you mean the I2C lines pulled low?
Did you receive an ACK upon address match?
also please share the datasheet of the SGP40 Sensor.
Thanks and regards,
Sidramesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Sidramesh_S ,
https://www.waveshare.com/wiki/SGP40_VOC_Sensor
I am trying to show the data from the sensor on an UART terminal. It shows only 0s.
I have no idea how to find out wether I received an ACK. That‘s basically the problem: I‘m new to programming and have never worked with I2C before, so I don‘t really know what I need to do.
Thanks,
as234
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @as234 ,
You must implement the code according to the below Transaction mentioned in the Communication protocol section in the SGP40 sensor datasheet. You can see the description of each API and implement it according to the below.
Thanks and regards,
Sidramesh