Shop OBEX P1 Docs P2 Docs Learn Events
I need a quick way to read the sensirion temp humidity sensor — Parallax Forums

I need a quick way to read the sensirion temp humidity sensor

avionikerenavionikeren Posts: 64
edited 2008-02-06 18:32 in BASIC Stamp
Is there any quicker way to read the sensirion temp humidity sensor, I use the code that is·recommended in the example, but it use so much time... I have a lot of different sensors in my application and I need to send the readings to a computer minimum·five times each second, all the other sensors are no problem, just the sensirion... do I have to·buy another type of temperature sensor or can the code be more effective?

Comments

  • stephenwagnerstephenwagner Posts: 147
    edited 2008-02-06 15:19
    There are several location within the code provided by Parallax where you are in a loop waiting for a convertion to be performed by the sensor.

    You can go off GOSUB and do other things before that subroutine loop is called and then come back to see if the sensor conversion is done.

    In other words, let the sensor wait for you.

    I have done this with the compass sensor provided by Parallax and a servo in a control system demonstration.

    I hope this helps.

    SJW
  • Tracy AllenTracy Allen Posts: 6,666
    edited 2008-02-06 17:26
    I agree with SJW. Send the command to start a conversion, then continue in the loop to read the other sensors. Once each time around the loop, check the SHT dta line, which will be pulled low when the SHT has finished its conversion. At that point, read out the SHT data and update the value in a temperature or humidity buffer. Start a new conversion. Alternate between temperature and humidity. Data to the computer comes from the buffer location, not directly from the Sensirion, but given the relatively slow rate of change of temperature and humidity that shouldn't (?) be a problem.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • avionikerenavionikeren Posts: 64
    edited 2008-02-06 18:32
    Thanks a lot, this will be just perfect!!!
Sign In or Register to comment.