Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading 0.00 #3

Open
vercruysse opened this issue Feb 8, 2018 · 24 comments
Open

Reading 0.00 #3

vercruysse opened this issue Feb 8, 2018 · 24 comments

Comments

@vercruysse
Copy link

Hi, thanks for the library
I think I hooked up everyting ok..
Also the reading looks good..
Somethimes it reads :Pressure Differential (Pa): -10000000.00
but most of the time it just reads (Pa): 0.00
I don't get it.. i tried blowing (from far) to the sensor, but it did'nt do anything.
Could you point me in the right direction?
thanks

@vercruysse
Copy link
Author

maybe some additional info, the sensor is a SDP610-125Pa and I use it with a nodemcu

@EngineerTony
Copy link
Owner

Hi,
The Arduino returns -1000000 when it failed to read from the sensor.
First:
Could you check your connections again please? Often I2C errors come from incorrect connections or the incorrect voltage at the sensor. There is a suggested connection diagram on the Readme page, make sure the SDP610 is connected to 3.3v and ground and that the SDA and SCL connections are connected to a 3.3V supply (use pull up resistors (see Readme page) each somewhere between 2.5k and 10kohm).
Second:
I haven't used a NodeMCU dev board before but reading online it appears the I2C pins will vary depending on the type of ESP you have on your NodeMCU development board and libraries you are using. It appears that you need to setup which pins you are using for the SDA and SCL connections. In the .ino sketch update the following line with the number of the pin you are using for the SDA and SCL.
was Wire.begin(); , change to Wire.begin(intSDA, intSCL); where you replace intSDA and intSCL with the GPIO pin number you have connected to.
Lastly:
To check if the I2C is working correctly you can try running an I2C scanner to check if a device is connected correctly to your setup I2C pins. The address should report back 0x40 for a SDP610 sensor.

I hope that helps. Let me know how you get on.
Thanks, EngineerTony

@vercruysse
Copy link
Author

vercruysse commented Feb 9, 2018

Hi Tony,
thanks for the quick reply. I did indeed use the code
//Wire.begin(); Wire.begin(D2, D1); // sda, scl Serial.begin(115200); difPressure = 0.1;

The scanner does return 0x40.
But I have to say i'm new to l2c and have doubt if everything is ok. It did't look to stable when i used it with loose wires. So i made an pcb.. The sda trace is dubble in lenght as the clk trace.. I don't know if it influences the bus.
I don't have the experience to know what should happen on the bus, and also don't have an osciloscope to verify it.
The fact it returns 0.00 says it saw the sensor and read someting of it i think?
I also tried with and without 10k pull up resistor. Was not needed I think, because the nodemcu has internal pullup resistors.
strange strange :)
Thanks :)

@EngineerTony
Copy link
Owner

Hi Vercruysse,
Mmm that is strange. It sounds like the I2C bus is setup correctly and the board can find the sensor at 0x40. ESPs have been known to dip in voltage as they transmit via WiFi, if it possible to try turning off the WiFi module and testing again?
If you have an oscilloscope you could check the raw signal of the I2C against the Sensirion documentation, like they did in this post
Another option is to try debugging the code with serial outputs.
Try adding these lines
Serial.print(":readSensor-data: "); Serial.print((float)data[0]); Serial.print("\n"); Serial.print((float)data[1]);
just after the 'checksum = Wire.read();' line in the SDP6x.cpp file. Hopefully this might show if there is non-zero raw data coming from the sensor.
Good luck. Let me know how you get on

@vercruysse
Copy link
Author

vercruysse commented Feb 9, 2018

Hi Tony,

I get:
`Pressure Differential (Pa): :readSensor-data: 0.00 0.00-10000000.00

Pressure Differential (Pa): :readSensor-data: 0.00 0.00-10000000.00

Pressure Differential (Pa): :readSensor-data: 0.00 0.000.00

Pressure Differential (Pa): :readSensor-data: 0.00 0.000.00

Pressure Differential (Pa): :readSensor-data: 0.00 0.00-10000000.00

Pressure Differential (Pa): :readSensor-data: 0.00 0.000.00`

As far as I know, wifi is in 'sleep' by default and i'm not using it. I'll try to find a way to disable it.
The oscilloscope will be difficult to find :)
Could it be a sensor fault? I bought 2 of them.. both have the same behavior
thanks
Pieter

@vercruysse
Copy link
Author

Also, an other i2c sensor (sht31, address 0x44)) gives me the the values that i want.
To rule out a faulty nodemcu

@vercruysse
Copy link
Author

vercruysse commented Feb 11, 2018

Hi
I've added Wire.setClockStretchLimit(40000) and was able to read out both slaves on the bus:
`void setup()
{
delay(1000);

Serial.begin(115200);

Wire.begin(D2, D1); // sda, scl

Wire.setClockStretchLimit(40000);

}`

Pieter

@EngineerTony
Copy link
Owner

Hi Pieter,
Great, that's good it's working now. I haven't come across the clock stretching of i2c before, just read about it. Sounds like it definitely affects software implemented I2C.
Thank you for letting me know. I'll have a go at trying to implement it in the library.
I hope you have a great rest of the day.

@vercruysse
Copy link
Author

Hi Tony,
I don't really know what the clock stretching does. As far as i've read, it's only needed on nodemcu boards.
Maybe it's best to test the code on another board (arduino?) and look how it behaves.
Like you said, it could be because of the software implented i2c.
I'm happy to test some things on the nodemcu/Sensirion_SDP6x platform
Just let me know :)
thanks

@Egyras
Copy link

Egyras commented Mar 17, 2018

Hi all,
I have SDP6xx-500Pa and min/max readings only -136Pa/136Pa with scale factor 60. Was checking on NodeMCU ESP8266 board. Any ideas what can be wrong ?

@EngineerTony
Copy link
Owner

Hi Egyras,
Thanks for the message. @vercruysse has more experience than me with ESP8266 boards and might be able to help more.
Have you checked the sensor is correctly attached with an i2cscanner (see the second message of this channel)? You should have address 0x40 detected.
Have you tried the fix, three messages above yours, that talked about using Wire.setClockStretchLimit when using a sensirion SPD with nodemcu?
Good luck. Let us know how you get along

@Egyras
Copy link

Egyras commented Mar 20, 2018

I have included ClockStrechLimit, all fine here as I get readings. I2C scanner gets device without issues.
I was testing SDP6000-500Pa, but min/max Pa I get is only -136Pa and 136Pa.....

@EngineerTony
Copy link
Owner

Ok cool. Sounds like I might have copied the scale factor from the sensirion manual incorrectly.
Are you able to find your sdp on the sensirion website and check the datasheet for the I2C scale factors they recommend? How are you testing the maximum values?

@Egyras
Copy link

Egyras commented Mar 20, 2018

I have checked scale factor, also changed in SDP6x.cpp to 60.0 which is corect for SDP600-500 according Sensirion documentation. I was just blowing air to one sensor port ;)

@vercruysse
Copy link
Author

:)
hard to test with only one mouth ;)

@Egyras
Copy link

Egyras commented Mar 20, 2018

Its possible to test :)
@vercruysse you get correct readings?

@vercruysse
Copy link
Author

:-)
I think so..
I have verified it once, and it looked good. But it was already late and had much time ;).
This week i plan to install it and verify it with a calibrated tool. I'll let you know!

@Egyras
Copy link

Egyras commented Mar 26, 2018

@vercruysse maybe had a chance to verify ? you have 125Pa version ?

@vercruysse
Copy link
Author

Hi,
i have the 125 version. It's been running for 3 days now but I don't have any feedback yet.
I let you know if I have some feedback by myself

@vercruysse
Copy link
Author

@Egyras readings seamed to be ok

@Egyras
Copy link

Egyras commented Apr 6, 2018

I will buy 125 version because 500 is too big for me and problem will be solved, thanks for feedback.

@Egyras
Copy link

Egyras commented Oct 18, 2018

@vercruysse maybe you already tested 125Pa version with calibrated tool ? Any feedback ? :)

@erice1984
Copy link

Clock stretching explicitly tells the NodeMCU/ESP8266 to slow down because the sensor is slow. FYI my esp12e has a clock frequency of 80MHz, the SDP611 sensor is normally operating on 100kHz, 400kHz max. I appreciate the tip on stretchlimit adjusting. I was having same issue.

@Franz4596
Copy link

Hi, thanks for your code, it helps me.
I did well connect a new SDP610-025Pa to an ESP8266 and there are readings according to a small pressure change.
Pressure Differential (Pa): -123.45 ...0.00 ... 123.45
If i give a constant pressure at (+p) or (-p) there is a good diplay value but instead of keeping the number, the displayed number goes to zero. After disconnect the pressure a negative value occurs shortly and go to zero too.
grafik
It looks there is a small bypass between (+p) and (-P).

  • What do you think ?
  • Could you give me a hint?
    thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants