yup i know 4-20mA.....so wat should i do it now.....need to change the sensor or jst adding the resistor.......wat valuse of the resistor i need to change it....
yup i know 4-20mA.....so wat should i do it now.....need to change the sensor or jst adding the resistor.......wat valuse of the resistor i need to change it....
now i using the voltage divider rule and the resister i will 18ohm and the test cricuit i will post at below and i got hear that D1820 that is digital temperature sensor...but i duno how to use it...i no use that before....and now how to make the sensor become stable.......
on the pict the blue colour is my temperature sensor....
and the resistor value is 18ohm
and the red colour wire i connet to ADC on port A.0
and the whole the circuit i also post at here ad...i hope u can help me....
if really want to change the sensor D1820 the circuit how it look like and where can get it and the programe need to write again or not need...!
Hi slimpeng,
Here! Already written, and links to where to get it. You will be here 2 years from now trying to accomplish your goal with that thermistor. Oh, and please do try to use Google, it really does work to bring you good things, like data sheets, vendors, etc. . .
http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2815/t/al
Code:@MyConfig = _HS_OSC & _WDT_ON & _PWRTE_ON & _LVP_OFF @MyConfig = MyConfig & _BODEN_OFF @ __config MyConfig ' One-wire temperature for LAB-X1 and DS1820 Define PIC16F877A @ errorlevel -230 temperature Var Word ' Temperature storage count_remain Var Byte ' Count remaining count_per_c Var Byte ' Count per degree C DQ Var PORTC.0 ' One-wire data pin define OSC 20 TrisA = %00000000 TrisB = %11111111 ' Define LCD registers and bits DEFINE LCD_DREG PORTA DEFINE LCD_DBIT 0 DEFINE LCD_RSREG PORTA DEFINE LCD_RSBIT 5 DEFINE LCD_EREG PORTA DEFINE LCD_EBIT 4 DEFINE LCD_BITS 4 DEFINE LCD_LINES 4 DEFINE LCD_COMMANDUS 2000 'Define delay time between sending LCD commands DEFINE LCD_DATAUS 50 'Define delay time between data sent. CMCON = 7 ADCON1 = 7 ' Set PORTA and PORTE to digital Low PORTE.2 ' LCD R/W line low (W) pause 500 LCDOUT 254,1,"initializing" mainloop: OWOut DQ, 1, [$CC, $44] ' Start temperature conversion waitloop: OWIn DQ, 4, [count_remain] ' Check for still busy converting If count_remain = 0 Then waitloop OWOut DQ, 1, [$CC, $BE] ' Read the temperature OWIn DQ, 0, [temperature.LOWBYTE, temperature.HIGHBYTE, Skip 4, count_remain, count_per_c] ' Calculate temperature in degrees C to 2 decimal places (not valid for negative temperature) temperature = (((temperature >> 1) * 100) - 25) + (((count_per_c - count_remain) * 100) / count_per_c) Lcdout $fe, 1, DEC (temperature / 100), ".", DEC2 temperature, " C" ' Calculate temperature in degrees F to 2 decimal places (not valid for negative temperature) temperature = (temperature */ 461) + 3200 Lcdout $fe, $c0, DEC (temperature / 100), ".", DEC2 temperature, " F" Pause 1000 ' Display about once a second Goto mainloop ' Do it forever
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Datasheets?if really want to change the sensor D1820 the circuit how it look like and where can get it and the programe need to write again or not need...!
Google?
Search the forum?
I'm done and out...Too much time used up already...not enough legwork at the other end.
The items referred to in Post #6 have run out.
last question....why the temperature going to high....oC and my LCD cant display any oC when going to low oC the LCD can display bck the value....why...! is my progrme problme...or what happen who can let me knw below is my new programe....!!!!
help to check it
'************************************************* ***************
'* Name : UNTITLED.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2008 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 1/23/2008 *
'* Version : 1.0 *
'* Notes : *
'* : *
'************************************************* ***************
Define LCD_DREG PORTB
Define LCD_DBIT 4
Define LCD_RSREG PORTB
Define LCD_RSBIT 0
Define LCD_EREG PORTB
Define LCD_EBIT 1
' Define ADCIN parameters '
Define ADC_BITS 8 ' Set number of bits in result
Define ADC_CLOCK 3 ' Set clock source (3=rc)
Define ADC_SAMPLEUS 50 ' Set sampling time in uS
include"modedefs.bas"
TRISB=%11111111
pause 2
LCDOUT 254,1,2,2,2,"WELCOME MY"
LCDOUT 254,192,2,"MONITOR SYSTEM"
pause 3
LCDOUT 254,1,"MY STARTING"
LCDOUT 254,192,2,2,2,2,2,"TEMPERATURE"
B0 var byte ' Create TEMPERATURE to store result
TRISC.6=0
TRISA = %11111111 ' Set PORTA to all input
ADCON1 =%00001010 ' Set PORTA analog
Low PORTB.2 ' LCD R/W line low (W)
Pause 1000
loop:
ADCIN 0,B0 ' Read channel 0 to adval
Lcdout $fe, 1 ' Clear LCD
Lcdout "Value: ",DEC B0,"'C" ' Display the decimal value
serout portc.6,n2400,[#b0]
Pause 5000 ' Wait .5 second
Goto loop ' Do it forever
End
Bookmarks