|
|
View previous topic :: View next topic |
Author |
Message |
Nigel Guest
|
Bi-directional data line, acknowledge problem due to changin |
Posted: Wed Mar 12, 2003 9:40 am |
|
|
Hello,
I am using the PIC 16F877 to communicate with a humidity sensor SHT15. The sensor uses a bi-directional data line. First you send the sensor a set of code to start it and tell it to measure humidity when the sensor is ready to send the measurement back, it acknowledges being ready by pulling the data line low. The problem is to register this the PIC needs to be read the change as an I/P, to do this I have changed the port from an output to an input using the TRIS statement. But this changes the state on the port from a 1 to a 0, thus causing an error. Has anyone any ideas.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12567 |
|
|
Sherpa Doug Guest
|
Re: Bi-directional data line, acknowledge problem due to cha |
Posted: Wed Mar 12, 2003 10:13 am |
|
|
:=Hello,
:=I am using the PIC 16F877 to communicate with a humidity sensor SHT15. The sensor uses a bi-directional data line. First you send the sensor a set of code to start it and tell it to measure humidity when the sensor is ready to send the measurement back, it acknowledges being ready by pulling the data line low. The problem is to register this the PIC needs to be read the change as an I/P, to do this I have changed the port from an output to an input using the TRIS statement. But this changes the state on the port from a 1 to a 0, thus causing an error. Has anyone any ideas.
Does your sensor actively pull the line high when it is not ready, or does it expect a pull-up resistor? If it uses a resistor, the resistor should keep the line pulled up when the pin switches to an input. The only way the lins should go low is if the PIC or the sensor is pulling it low.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12570 |
|
|
Michael Grant Guest
|
Re: Bi-directional data line, acknowledge problem due to cha |
Posted: Thu Mar 13, 2003 5:28 am |
|
|
Have you got a pull-up resistor on the line? If the responding chip is an open collector, then where is the voltage to come from?
:=Hello,
:=I am using the PIC 16F877 to communicate with a humidity sensor SHT15. The sensor uses a bi-directional data line. First you send the sensor a set of code to start it and tell it to measure humidity when the sensor is ready to send the measurement back, it acknowledges being ready by pulling the data line low. The problem is to register this the PIC needs to be read the change as an I/P, to do this I have changed the port from an output to an input using the TRIS statement. But this changes the state on the port from a 1 to a 0, thus causing an error. Has anyone any ideas.
___________________________
This message was ported from CCS's old forum
Original Post ID: 12611 |
|
|
meiling Guest
|
sht 15 problem |
Posted: Wed May 02, 2007 4:38 am |
|
|
i have acquired several SHT15 sensors and i am using them to monitor temperature gradients inside a room. i am already able to retrieve data and convert them to actual values. the problem i have is i observe fluctuations of almost +/-6degC in the readings. is this normal even though i can not think of anything that might cause this sharp rise? i sample every 15seconds.
here's a sample of several datapoints i have:
counter, LM35, SHT15
...
12,22.070, 33.160
13,22.119, 33.200
14,22.119, 26.960
15,22.070, 25.720
16,22.070, 25.080
17,22.070, 31.000
18,22.070, 25.720
19,22.021, 24.840
20,22.021, 30.720
21,22.021, 31.760
thank you. |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Wed May 02, 2007 2:32 pm |
|
|
I've used this sensor quite a bit. It's response time is fairly quick and I haven't noticed it to drift, randomly, in any of my applications. You might want to test it in an area that does not have any air movement. It's possible that the room air is moving, quite a bit, causing the air to fluxuate.
Ronald |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Wed May 02, 2007 6:51 pm |
|
|
Quote: |
I sample every 15seconds.
|
IMO, 15 seconds is a short period to get such high readings discrepancies, we assume
-as Ronald said- that you are testing it in a close, no wind, no A/C room. I guess you
are acquiring some electrical noises embedded in the readings.
Try to average multiple readings. I suggest to use the SherpaDoug
"Olympics Scoring" algorithm:
Take a number of samples, often 10, and keep the maximun, the minimum,
and the sum. Then subtract out the max and the min and average the rest,
making a right shift >> 3 times.
Humberto |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
Re: sht 15 problem |
Posted: Thu May 03, 2007 5:37 am |
|
|
I use the Sensirion sensors extensively. Based on your results I would be looking for a hardware (missing pullup resistor?) or software driver problem.
Use the crc field to validate the record. If you are getting CRC errors then you have a hardware related problem. If the CRC is valid then your problem is in your driver. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
|
|
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
|