|
|
View previous topic :: View next topic |
Author |
Message |
aslan
Joined: 11 Jul 2011 Posts: 1
|
|
Posted: Mon Jul 11, 2011 4:21 am |
|
|
jecottrell wrote: | delene wrote: | My code also returns -4.6 and -39.9... :(
I have tried the suggestions above and still no joy
Any other suggestions??? |
I know this is an old topic, but I thought I'd post for future readers...
I had a similar problem after laying out a new board and accidentally swapping the data and clock lines. Got them squared away and it works fine.
So, double check your pin defines in the driver file. |
Use "port_x_pullups(TRUE);" at the beginning of the main function.
x is the port name you use for sht data-clock lines.
output_float effects.. for example:
Code: |
void main( ) // Main block
{
float restemp, truehumid;
setup_psp(PSP_DISABLED);
lcd_init();
sht_init();
port_b_pullups(TRUE); //here you add this line
//remove external pull-up
|
|
|
|
lazuribicci
Joined: 06 Feb 2010 Posts: 10
|
The exact solution about reading -40ºC |
Posted: Fri Jul 20, 2012 3:15 pm |
|
|
Hello friends,
I want to share my experiences about reading -40ºC.
Some sensors work well but the some doesn't work with same hardware and software. is the sensor broken? Actually it is not...
the problem is polymers inside the sensor. The polymers need re-hydration.
Some sensors that I used doesn't read temperature and humidity properly. In such cases, put the sensor into the water and let stand for one day. After that sensor works very well
Quote from datasheet.
Quote: |
IMPORTANT: After soldering the devices should be stored
at >75%RH for at least 12h to allow the polymer to rehydrate.
Otherwise the sensor may read an offset that
slowly disappears if exposed to ambient conditions.
Alternatively the re-hydration process may be performed at
ambient conditions (>40%RH) during more than 5 days.
|
|
|
|
lazuribicci
Joined: 06 Feb 2010 Posts: 10
|
|
Posted: Sun Jul 22, 2012 4:20 am |
|
|
Another solution:
bake the PCB card with sensored at 100ºC for a couple of hours
I have saved many sensors with these methods. |
|
|
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Fri Jun 21, 2013 7:44 am |
|
|
I tried this code and IT WORKS... straight out of the box.
However, I did have some problems with the output formating.
Code: | printf(lcd_putc, "Temp : %3.1f %cC ", restemp, 223);
printf(lcd_putc, "\nRH : %3.1f %% ", truehumid); |
After re-coding the Printf's to print to a PC terminal, via FTDI, it was all good.
Code: | printf("T: %3.1fC - RH: %3.1f%%\n\r", restemp, truehumid); |
I do not know if the reading were precise or not since i didnt have another temp/RH sensor around, but they seemed about right.
response time was good, humidity and temp changed accordingly when i exhaled on the sensor...
My setup:
PIC16F886 @ 20MHz
PCM 4.135 + MPLAB 8.85
5V
SHT15 - Scavenged from a HOBO datalogger.
FTDI for TX/RX
I noticed this code is from 2006, so i will be updating small things like:
Code: | for(i=0; i<9; i++)
{
output_bit(sht_clk_pin, 1); //toggle clk 9 times
delay_us(2);
output_bit(sht_clk_pin, 0);
delay_us(2);
} |
with simpler things like: output_toggle(sht_clk_pin)
... and will re-post with due credit to Hansolo
Thank you Hansolo for posting this.
G. _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
|
|
|
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
|