CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

one question about SHT71

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
tieungu13



Joined: 03 Mar 2010
Posts: 6

View user's profile Send private message AIM Address ICQ Number

one question about SHT71
PostPosted: Thu Jul 08, 2010 11:26 am     Reply with quote

I used Sht71. Driver of sht71 I got on this website, and example I get on this website too. But I get value of Temp = -39.9 and hump = -4.6% all the time. Pin of sht71 PIN_1 (PC0 - clock), 2 (VCC pull 10K), 3 (Ground), 4 (Data and pull 10k -PIN C1). Like on datasheet of SHT7X. I see on the topic about SHT71 this website someone had a problem like me, but they haven't solved this problem. Help me. I'm from VietNam.
Code:

//////////////////////////////////////main C /////////////////////////
#include "C:\Users\Thanh Hai\Desktop\test71\main.h"
#fuses HS,NOWDT,PUT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#include <SHT71.c>
#include <lcd_lib_4bit.c>

void main()
{   

float restemp, truehumid;
set_tris_c(0xff);
 
 lcd_init();
 sht_init();
  output_low(PIN_C0);///
 output_high(PIN_C1);

 while(1)
 {

 restart_wdt();
sht_rd (restemp, truehumid);
 LCD_SetPosition(0);
 printf(LCD_putchar, "Temp : %3.1f C   ",restemp);
 LCD_SetPosition(40);
 printf(LCD_putchar, "\nRH   : %3.1f %%   ", truehumid);
 delay_ms(50);  //delay 500 ms between reading to prevent self heating of sensor

     
     

           
    }

}


Code:

//////////////////////////////SHT71////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
//                                                                           //
// Driver file for SHT75 Temperature & Humidity Sensor                       //
//                                                                           //
// ***** To initialise SHT75 sensor upon power up *****                      //
//                                                                           //
// Function : sht_init()                                                     //
// Return   : none                                                           //
//                                                                           //
//                                                                           //
// ***** To measure and caluculate SHT75 temp & real RH *****                //
//                                                                           //
// Function : sht_rd (temp, truehumid)                                       //
// Return   : temperature & true humidity in float values                    //
//                                                                           //
///////////////////////////////////////////////////////////////////////////////

#define sht_data_pin   PIN_C1
#define sht_clk_pin    PIN_C0

SHT71 Driver:
http://www.ccsinfo.com/forum/viewtopic.php?t=28564
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Mon Jul 12, 2010 1:09 am     Reply with quote

Sounds like you may have connected it up wrongly and then killed it. Been there, done that.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group