Git Product home page Git Product logo

Comments (8)

psachs avatar psachs commented on June 12, 2024

Hi

I am not very familiar with the SAM21 microcontroller. The I2C interfaces ususally require a pull-up resistor to work. Most higher end platforms like Raspberry PI and Arduino have built-in pull up resistors for the dedicated I2C interfaces.

Unfortunately the "not enough data received" error is not always conclusive. The I2c interfacing might not work at all, the signals have too much noise (e.g. pull-up resistor is not designed right for the sensor) or any other error leading to failures in data transmission.

What implementation are you exactly using? (e.g. sample implementation of this driver) And do you have by any chance the link to the exact board you are using?

from embedded-i2c-sgp41.

JavaldeUB avatar JavaldeUB commented on June 12, 2024

from embedded-i2c-sgp41.

psachs avatar psachs commented on June 12, 2024

Hi Javier

Thanks for the info. According to the Seed Studio, the SAMD21 operates at 3.3V I2C levels. SGP41 operates between 1.7V and 3.6V. Therefore you don't need any level shifter.
Source: https://wiki.seeedstudio.com/Seeeduino-XIAO-by-Nanase#i2c

The 4k7 pull-ups you use should be fine. We recommend 10k pull-ups (depending on the frequency and operating voltage). If it is easy for you to test that out you can try it. If you happen to have access to a scope or logic analyzer you can also check the signal directly.

Without access to hardware I can not further help with debugging. The "not enough data received" error is most likely due to errors in signal detection, but it's just a blind guess from me.
I will order a Seedstudio SAMD21 for testing but this will take a couple of days to arrive.

from embedded-i2c-sgp41.

JavaldeUB avatar JavaldeUB commented on June 12, 2024

from embedded-i2c-sgp41.

psachs avatar psachs commented on June 12, 2024

Raw values around the max value of 65536 indicates that the hotplate is not running. Did you connect VDD and VDDH to the same source as instructed in the datasheet? Also make sure that peak current is supported.

You can also run the self test to see if all hotplates and MOx material are working correctly (command: 0x28 0x0E)

from embedded-i2c-sgp41.

JavaldeUB avatar JavaldeUB commented on June 12, 2024

from embedded-i2c-sgp41.

psachs avatar psachs commented on June 12, 2024

I don't think the 4.7Ohm resistor should be a Problem. However, for full disclosure: I am a software engineer and no expert in hardware circuits when it comes to details.

From the datasheet:
"The VDD pin must be decoupled with an RC element. The required decoupling for VDDH depends on the power supply network connected to the sensor, a capacitor of 1 uF is recommended."

For SGP41 you usually don't need an external power supply. Most development boards should be able to handle the requirements.

Are you still running the example we provide? And the self-test passes? This would be an indication that the sensor is working and gets enough power.

from embedded-i2c-sgp41.

psachs avatar psachs commented on June 12, 2024

I could finally test the driver with a Seeed XIAO SAMD21 board using the a MicroE Envronment 2 click board which comes with all the necessary electronics installed.
The default example runs without any issue with such a setup.

from embedded-i2c-sgp41.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.