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.

how to make digital thermometer using 1820 sensor

Status
Not open for further replies.

harishwww

Member level 3
Joined
Aug 12, 2010
Messages
57
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,696
hi
i want to make digital thermometer using ds1820 sensor and 8051 micro i just need circuit diagram pls help me
 

Circuit diagram ???? It only has three pins!

One to ground, one to +5 and one to any digital I/O pin on the 8051.

Brian.
 

Hi,
Brian, you forgot to mention that the output of the DS18B20 that connects to the 8051 IO pin has to be pulled up. You could use a 4.7k resistor for pull-up. This isn't exactly with 8051, but you can easily get the idea from this circuit:
**broken link removed**

Hope this helps.
Tahmid.
 
Init_DS18B20(void)
{
unsigned char x=0;
DQ = 1;
delay (8);
DQ = 0;
delay (80);
DQ = 1;
delay(14);
x=DQ;

delay(20);
}

ReadTemperature(void)
{
unsigned char a=0;
unsigned char b=0;
unsigned char tt=0;
Init_DS18B20();
WriteOneChar(0xCC);
WriteOneChar(0x44);
Init_DS18B20();
WriteOneChar(0xCC);
WriteOneChar(0xBE);
a=ReadOneChar();
b=ReadOneChar();
a=a>>4;
tt=b<<4;
tt=tt|a;
return(tt);
}

void display_tempmain(unsigned char i)
{
……
}
void main(void)
{unsigned char temp;
led_run=0;
while(1)
{ temp=ReadTemperature();
display_tempmain(temp);

}
}

help me on writing this code is this correct
 

More importantly....where is WriteOneChar() ?
What does 'x' do? (I know, but does the original poster?)

Sorry about forgetting the pull-up resistor!

Brian.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top