Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Temprature measurement with SHT11 sensor

Status
Not open for further replies.

HN

Member level 1
Joined
Jun 15, 2002
Messages
38
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,288
Activity points
276
sht11 avr

8) SHT11 ILE SICAKLIK+NEM OLCUMU

51.jpg


Circuit:
51_2.gif


Site:
http://www.turkengineers.com/metin.php?metin=51&PHPSESSID=a118786eec4c411fec316c49e5372798#

HN
 

sht11 bascom

8) STH11 Datasheet

Here!
 
  • Like
Reactions: grrmfi

    grrmfi

    Points: 2
    Helpful Answer Positive Rating
sht11 code

For those whose preferred choice of MCU is MCS51,

Here is (K*E*I*L) c-code for interfacing the SHT11 temp-humid sensor to the MCS51 (in this case the 89C51RD2 + 11.0592 MHz (Speed x2)). The detail how to connect the SHT11 to the 89C51RD2 is explained in the source code.
 
sht11 picbasic

This is great thanks!
Do you think you could share the PIC code with us?
I would like to build one my self, and add more functions !!

thanks and regards

asena
 

sht11 asm

After some web surfing,

Here is a link describing how to interface a SHT11 sensor to an AVR mcu. The source code is written in Basic (BASCOM-AVR). I cann't find the PIC code (sorry asena :roll: ).

https://www.mcselec.com/an_116.htm

You may add more features and functions to this source code... :)
 

sht11 c code

Thanks anyway!
I'll write the code myself, and then i'll post it here!

Lets wait for HN, he may have the PIC source!

regards

asena
 

sht11 atmega

hi ...

can you tell me about availability of this sensor. I am using dallas 1820 and no problems so far .. whats the benefit of this solution ??

regards

cancel
 

sht11 i2c

cancel said:
I am using dallas 1820 and no problems so far .. whats the benefit of this solution ??

regards

cancel

Temperature and humidity sensing in one part.
 

pic sht11

cancel,

go to the manufacturer website, and ask for a sample.
They'll send it to you.

www.sensirion.com

regards

asena 8)
 

sht11 pic code

Has any body written Picbasic code they can share for this sensor yet?


I dont know what communications protocall to use with this sensor.
I2C doesnt work.
If you can help me please send on to me .

rgds
challenger
 

sht11 sensor

challenger said:
Has any body written Picbasic code they can share for this sensor yet?

I dont know what communications protocall to use with this sensor.
I2C doesnt work.
r

here is some picbasic code for the sht11
only to read humidity (temp doesnt interest me for now...) the protocol is NOT I2C, but something like. you have to emulate yourself this pseudo i2c- see the picbasic code below

mysda var PORTC.6
myscl var PORTC.7
hread con %00000101 ' lecture humiditÈ sur sht11
humid var word
humidchk var byte
h1 var word
h2 var word
h3 var word

sht11_init: ' initialisation du sht11
Output mysda
Output myscl
High mysda
Low myscl
For i=1 to 10
High myscl
Pause 1
Low myscl
Pause 1
Next i
Call sht11_ts
return

sht11_ts: ' transmission start
High myscl
Pause 1
Low mysda
Pause 1
Low myscl
Pause 1
High myscl
Pause 1
High mysda
Pause 1
Low myscl
return

sht11_readhumid: ' lecture humiditÈ sur sht11
Call sht11_ts
Shiftout mysda,myscl,1,[hread\8] ' sortie commande lire humiditÈ
Input mysda ' attente ack
Low myscl
While mysda=1
Wend
Pulsout myscl,10 ' envoi ack
While mysda=0
Wend
While mysda=1 ' attente de la fin de la mesure
Wend
Low myscl
ShiftIn mysda,myscl,0,[humid.highbyte\8]
Low mysda
Pulsout myscl,10 ' envoi ack
ShiftIn mysda,myscl,0,[humid.lowbyte\8]
Low mysda
Pulsout myscl,10 ' envoi ack
ShiftIn mysda,myscl,0,[humidchk\8]
High mysda
Pulsout myscl,10 ' envoi ack
Input mysda
Input myscl ' retour en haute impÈdance
return
 

sht11 microchip

Here's code for AVR (FASTAVR)


'//////////////////////////////////////////////////////////////
'/// FastAVR Basic Compiler for AVR by MICRODESIGN ///
'/// SHT11/15 Temperature and Humidity measurement ///
'/// 14/12 bit ///
'//////////////////////////////////////////////////////////////
$Device= 8515
$Stack = 32 ' stack size
$Clock = 7.3728
$Baud=115200
$ShiftOut Data=PORTD.2, Clk=PORTD.3, 1
$LeadChar=" ", Format(2,3)

$Def dDta=DDRD.2
$Def inDta=PIND.2
$Def Dta=PORTD.2
$Def Sck=PORTD.3

Declare Sub Init()
Declare Sub StartTX()
Declare Sub CommReset()
Declare Function WriteByte(db As Byte) As Byte
Declare Function ReadByte(ack As Byte) As Byte
Declare Function Measure(what As Byte) As Word

Dim tmp As Integer, ftmp As Float
Dim n As Byte
Dim Cta As Byte, Ctb As Integer

Const True=1, False=0
Const ACK=1, NAK=0

Const TmpSHT=&h03
Const HumSHT=&h05
Const ResSHT=&h1e
Const Rstat =&h07
Const Wstat =&h06

Const c1=-4, c2=0.0405, c3=-2.8E-06

Init()

Do
tmp=Measure(TmpSHT) ' measure Temperature
ftmp=tmp/100-40
Print "Temp:"; ftmp

tmp=Measure(HumSHT) ' measure Humidity
ftmp=c1+tmp*c2+Sqr(tmp)*c3
Print "Humy:"; ftmp
Print
Wait 1
Loop

'//////////////////////////////////////////////////////////////
Sub Init()
WaitMs 20
CommReset()
WriteByte(Wstat) ' write to Status
Set dDta
WriteByte(0) ' 14bit for T, 12 bit for RH
End Sub

'//////////////////////////////////////////////////////////////
Function Measure(what As Byte) As Word
Local tmp As Word

CommReset()
If WriteByte(what)=0 Then ' isue Cmd
BitWait inDta, 0 ' wait for data ready
tmp=ReadByte(ACK) ' read first byte
Shift(Left, 8, tmp) ' make it MSB
tmp=tmp Or ReadByte(NAK) ' read second byte and combine
'n=ReadByte(NAK) ' no CRC for now
Else
Print "No sensor!"
tmp=0
End If
Return tmp
End Function

'//////////////////////////////////////////////////////////////
Sub StartTX()
Set dDta
Set Sck
Reset Dta
Reset Sck
Set Sck
Set Dta
Reset Sck
End Sub

'//////////////////////////////////////////////////////////////
Sub CommReset()
Local i As Byte

Set Dta
For i=0 To 8
Set Sck: Reset Sck
Next
StartTX()
End Sub

'//////////////////////////////////////////////////////////////
Function WriteByte(db As Byte) As Byte
Local mask As Byte

ShiftOut db ' send data
Reset dDta ' back to input
Set Sck:Reset Sck ' clock ACK
Return inDta ' return ACK (0=SHT present)
End Function

'//////////////////////////////////////////////////////////////
Function ReadByte(ack As Byte) As Byte
Local i As Byte, db As Byte

db=ShiftIn
Set dDta
Dta=Not ack
Set Sck
Reset Sck
Reset dDta
Return db
End Function
 

sht11 pic

I have done it now for ccs compiler for both temp and humidity.

if anybody wants it please msg me and I will post it.
 
sht11 gcc

And i have it for Microchips C18.
It works very well with the 18F series.

asena
 

sht11 avr code

Hi,

Does anywone have the asm source code for the 2x16LCD-PIC16F84-SHT11 configuration?
I found the hex file on TURKengineers last week and it works fine (except for the integrated website-add and a strange offset on the temperature) but they are unfortunately not responding to requests for the source code :(
 

sht11 ccs

I've already tried that circuit but did not have any luck getting it to work.
 

sht11 + avr

Hi..
Does anyone have seen some SHT11 sample code for 8051 Assembler?
or the LST file from C code?

Thanks
Ronnie
 

sht11 avr gcc

Check SENSIRION website.

**broken link removed**

Thats C code for 8051.


asena
 

ssb_sensor.h

hello

anyone can help me with a schematic for connecting sht11 with an AVR Atmega8 and seding results to a PC using USB. I would appreciate some links or advices. I have to do a project with this subject and I can't find anything with usb,atmel and sht11 together.

Thank you in advance
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top