Connect with us

Sensor SHT 75 and Arduino Uno

Discussion in 'Sensors and Actuators' started by denis1990, Sep 26, 2015.

Scroll to continue with content
  1. denis1990

    denis1990

    2
    0
    Sep 26, 2015
    Hi I have some problems with the connection between arduino and the sensor SHT 75. I've used this code:

    #include <Sensirion.h>

    const uint8_t dataPin = 2; //Declaracion patillas arduino
    const uint8_t clockPin = 3;
    float temperature; //Declaracion variables
    float humidity;
    float dewpoint;
    Sensirion tempSensor = Sensirion(dataPin, clockPin); //Declaracion objeto sensor

    void setup()
    {
    Serial.begin(9600); //Declaracion puerto serie
    }

    void loop() {
    tempSensor.measure(&temperature, &humidity, &dewpoint); //Llamada sensor
    Serial.print("Temperature: "); //Escribe texto para acompañar al valor
    Serial.print(temperature); //Escribe valor en la misma linea
    Serial.print(" C, Humidity: "); //Escribe texto para acompañar al valor
    Serial.print(humidity); //Escribe valor en la misma linea
    Serial.print(" %, Dewpoint: "); //Escribe texto para acompañar al valor
    Serial.print(dewpoint); // Escribe valor en la misma linea
    Serial.println(" C");
    delay(5000); //Tiempo de espera para la siguiente ejecucion
    }

    But which is the problem? the problem is that when I go to the monitor serie in order to see the measures I just get this:

    temperature: 0.0 humidity: 0.0 % dewpoint: 0.0
    temperature: 0.0 humidity: 0.0 % dewpoint: 0.0
    temperature: 0.0 humidity: 0.0 % dewpoint: 0.0
    ...

    So I don't know what is the problem may be the connections, the code, it could be that I can't connect directly 5V from arduino with sensor SHT 75 because it needs just 3.5 V ??

    Some idea ? Any aid will be welcome.

    Thanks a lot.
     
  2. Old Steve

    Old Steve

    734
    169
    Jul 23, 2015
    The datasheet says 2.4V | 3.3V | 5.5V, so it shouldn't be the voltage causing the problem.
    Have you double-checked the pin connections - data on 2, clock on 3?

    I don't have a sensor to test the code, although it does compile fine with a couple of mods to the libary's *.cpp and *.h file to include "Arduino.h" rather than "WConstants.h", (which you must have done to compile without problems), but it is the example Sensirion supplied, so should work. It does for others.

    Have you tested the second example, "NonBlocking"? It does error-checking and might give you a clue to the problem.
    The "SimpleSensirion" example that you posted does no error-checking.

    Edit: To quote the comments at the top of the "NonBlocking" example:-
    * This example contains two versions of the code: one that checks library
    * function return codes for error indications and one that does not.
    * The version with error checking may be useful in debuging possible
    * connection issues with the sensor. A #define selects between versions.


    The possible error messages:-
    "Error: No response (ACK) received from sensor!"
    "Error: CRC mismatch!"
    "Error: Measurement timeout!"
    "Unknown error received!"


    If the connections are correct and trying "NonBlocking" doesn't help sort it out, it might be worth asking your question in the Arduino forums. You'll have a much better chance of a definitive answer.
     
    Last edited: Sep 26, 2015
  3. Arouse1973

    Arouse1973 Adam

    5,164
    1,080
    Dec 18, 2013
    Do you have a pull up resistor on your data line? Can you show us your circuit?
    Adam
     
    Old Steve likes this.
  4. Old Steve

    Old Steve

    734
    169
    Jul 23, 2015
    Good thinking, Adam. I overlooked that possibility. That might throw a CRC error.
     
    Arouse1973 likes this.
  5. denis1990

    denis1990

    2
    0
    Sep 26, 2015
    Thanks a lot ¡¡¡¡ I connected the SHT 75 directly (without pull-up resistor ) to 3.3v PIN and now I can acquire data without problems. The problem now is How can I acquire temperature and humidity with matlab and plot it.
    Some suggestions ??
    Thanks in advance.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-