caramoan tour package

caramoan tour package

Author Topic: Temperature sensor (LEDs as display)  (Read 1116 times)

Offline your most RIDICULOUS man :)

  • Diesel Generator
  • *
  • Posts: 1839
  • Pogi/Ganda Points: 53
  • Gender: Male
Temperature sensor (LEDs as display)
« on: November 19, 2009, 10:26:44 AM »


Boss coolet, pahingi po ulet ng help  ;D ;D ;D.. pano po pag code sa MCU using LM35 as INPUT? aralin ko na lang po yung code. gamitin ko sana PIC16F84A or mas mura na PIC.. ginamit po kasi dito nung author is assembly lang. gusto ko sana imodify yung code using PROTON
God give us the grace to accept with serenity the things that cannot be changed, courage to change the things which should be changed and the wisdom to distinguish the one from the other [Reinhold Niebuhr]

Philippine Electronics Forum

Temperature sensor (LEDs as display)
« on: November 19, 2009, 10:26:44 AM »

insomartin

  • Guest
Re: Temperature sensor (LEDs as display)
« Reply #1 on: November 19, 2009, 12:58:42 PM »
it's better to start with the big 40-pin 16F877a

it only cost 100 peso higher than the 84a's

sis... walang ADC ang 84a's or 628a kaya hindi pwede ang lm7805 unless lalagyan mo nang comparator... para on/off or some other trick.

Philippine Electronics Forum

Re: Temperature sensor (LEDs as display)
« Reply #1 on: November 19, 2009, 12:58:42 PM »

Offline Mayalin22

  • Hydroelectric
  • ***
  • Posts: 3389
  • Pogi/Ganda Points: 400
  • Gender: Female
Re: Temperature sensor (LEDs as display)
« Reply #2 on: November 19, 2009, 01:01:29 PM »
^ Agree  :D :D :D

pwede yang 84 at 628 sa DS18s20
Simpler designs are usually better.

Philippine Electronics Forum

Re: Temperature sensor (LEDs as display)
« Reply #2 on: November 19, 2009, 01:01:29 PM »

insomartin

  • Guest
Re: Temperature sensor (LEDs as display)
« Reply #3 on: November 19, 2009, 01:03:53 PM »
gusto ko mag one wire... pero malamang bitbangged. meaning mano mano... ewan ko lang kung may may one wire library sa boost C....

Philippine Electronics Forum

Re: Temperature sensor (LEDs as display)
« Reply #3 on: November 19, 2009, 01:03:53 PM »

Offline your most RIDICULOUS man :)

  • Diesel Generator
  • *
  • Posts: 1839
  • Pogi/Ganda Points: 53
  • Gender: Male
Re: Temperature sensor (LEDs as display)
« Reply #4 on: November 19, 2009, 08:24:40 PM »
Patutor po kung pano nagkakaroon ng display sa lcd by just using a sensor,Tsaka ano po purpose nung ADC sa circuit.. pakipaliwanag po ng simple lang.. :-P :-D
God give us the grace to accept with serenity the things that cannot be changed, courage to change the things which should be changed and the wisdom to distinguish the one from the other [Reinhold Niebuhr]

Philippine Electronics Forum

Re: Temperature sensor (LEDs as display)
« Reply #4 on: November 19, 2009, 08:24:40 PM »

Offline Mayalin22

  • Hydroelectric
  • ***
  • Posts: 3389
  • Pogi/Ganda Points: 400
  • Gender: Female
Re: Temperature sensor (LEDs as display)
« Reply #5 on: November 19, 2009, 08:28:14 PM »
from wiki

An analog-to-digital converter (abbreviated ADC, A/D or A to D) is a device which converts continuous signals to discrete digital numbers. The reverse operation is performed by a digital-to-analog converter (DAC).

Typically, an ADC is an electronic device that converts an input analog voltage (or current) to a digital number proportional to the magnitude of the voltage or current. However, some non-electronic or only partially electronic devices, such as rotary encoders, can also be considered ADCs. The digital output may use different coding schemes, such as binary, Gray code or two's complement binary.

Simpler designs are usually better.

Offline your most RIDICULOUS man :)

  • Diesel Generator
  • *
  • Posts: 1839
  • Pogi/Ganda Points: 53
  • Gender: Male
Re: Temperature sensor (LEDs as display)
« Reply #6 on: November 19, 2009, 08:33:29 PM »
sir coolet.. :-P meron ka po bang projects sa PROTON using diff. sensors (temperature sensor,....etc.) to be displayed on an LCD? pahingi naman po pati schematics.. pag-aralan ko na lang.. isama niyo din po yung schematics :-P
God give us the grace to accept with serenity the things that cannot be changed, courage to change the things which should be changed and the wisdom to distinguish the one from the other [Reinhold Niebuhr]

Offline Mayalin22

  • Hydroelectric
  • ***
  • Posts: 3389
  • Pogi/Ganda Points: 400
  • Gender: Female
Re: Temperature sensor (LEDs as display)
« Reply #7 on: November 19, 2009, 08:44:42 PM »

Click Here
Simpler designs are usually better.

Offline your most RIDICULOUS man :)

  • Diesel Generator
  • *
  • Posts: 1839
  • Pogi/Ganda Points: 53
  • Gender: Male
Re: Temperature sensor (LEDs as display)
« Reply #8 on: November 19, 2009, 08:45:46 PM »
WOW.. TY PO! :-) ANG CUTE MO! :-p
God give us the grace to accept with serenity the things that cannot be changed, courage to change the things which should be changed and the wisdom to distinguish the one from the other [Reinhold Niebuhr]

Offline your most RIDICULOUS man :)

  • Diesel Generator
  • *
  • Posts: 1839
  • Pogi/Ganda Points: 53
  • Gender: Male
Re: Temperature sensor (LEDs as display)
« Reply #9 on: November 19, 2009, 09:08:33 PM »
ERROR sir yung code dun sa link na binigay mo:

Code: [Select]
Device 16F877
XTAL 4
 
Declare LCD_TYPE ALPHA              ' Type of LCD Used is Alpha
Declare LCD_DTPIN PORTB.4           ' The control bits B0,B1,B2,B3
Declare LCD_RSPIN PORTB.2           ' RS pin on B4
Declare LCD_ENPIN PORTB.3           ' E pin on B5
Declare LCD_LINES 2                 ' Amount of LCD lines
Declare LCD_INTERFACE 4             ' Interface method is 4 bit

PORTB_PULLUPS = true
ALL_DIGITAL = TRUE
 
Symbol DQ = PORTB.0                 'Place the DS1820 on bit 1 of PORTA
     
Dim Sign As Byte
Dim Cnt As Byte
Dim Count_Per_Deg As Byte
Dim Temp As Word
Dim Temp_Dec As Byte
 
DelayMS 150                         ' Let LCD warm up

Cls
 
' Send a command that creates the degree
Print $FE,$40,$06,$09,$09,$06,$00,$00,$00,$00 
'  symbol on the LCD, to print it, simply address
'  the character as 0, eg,
'  Print At 1, 1, Value, 0, "Degrees"

Again:
 
'Send calculate temperature command
OWrite DQ, 1,[$55,$10,$31,$C5,$C8,$00,$00,$00,$F4,$44]           
                 ' FF  I1  I2  I3  I4  I5  I6  CRC                 
                 '  FF - Family, Ix - Address bytes,
                 '  CRC - checksum
Repeat
     DelayMS 25                   ' Wait until conversion is complete
     ORead DQ,4,[Cnt]             ' Keep reading low pulses until
     Until Cnt  0                    '  the DS1820 is finished
     
'Send read scratchpad command
OWrite DQ,1,[$55,$10,$31,$C5,$C8,$00,$00,$00,$F4,$BE]           
                ' FF  I1  I2  I3  I4  I5  I6   CRC
                '  FF - Family, Ix - Address bytes,
                '  CRC - checksum checksum

ORead DQ,2,[Temp.LowByte,Temp.HighByte,Cnt,Cnt,Cnt,Cnt,Cnt,Count_Per_Deg]
 
' Each Cnt is 1/16 of a degree, therefore 100/16 = 6.25, and that's our decimal value
Temp_Dec = (6.25 * Cnt)     
 
' Bits 8-15 are 1 for a negative temperature and 0 for a positive
If Temp.8=1 Then
     ' If negative then drop the first bit, and invert the value     
     Temp=(Temp.LowByte ^ $FF) >> 1   
     ' If Cnt = 0 then increment Temp, as the 1820 does not do this
     If Cnt = 0 Then Temp = Temp + 1   
     ' Change the sign to a negative
     Sign = "-"                                                           
Else
     ' If positive then drop the first byte
     Temp=(Temp >> 1)   
     ' And change the sign value to positive               
     Sign = "+"       
 
     ' Invert the decimal value                                                   
     Temp_Dec = 100 - Temp_Dec                             
EndIf
 
' Display the data on the LCD
Print At 1,1, Sign, Dec Temp, ".", Dec Dig Temp_Dec, 1, 0,"C "
 
GoTo Again

Error [Line 42]: Value Expected! (Untitled.bas)
God give us the grace to accept with serenity the things that cannot be changed, courage to change the things which should be changed and the wisdom to distinguish the one from the other [Reinhold Niebuhr]

Offline Mayalin22

  • Hydroelectric
  • ***
  • Posts: 3389
  • Pogi/Ganda Points: 400
  • Gender: Female
Re: Temperature sensor (LEDs as display)
« Reply #10 on: November 19, 2009, 09:22:10 PM »
ok naman ah?  ???

Code: [Select]

Device 16F877
Xtal 4
 
Declare LCD_Type ALPHA              ' Type of LCD Used is Alpha
Declare LCD_DTPin PORTB.4           ' The control bits B0,B1,B2,B3
Declare LCD_RSPin PORTB.2           ' RS pin on B4
Declare LCD_ENPin PORTB.3           ' E pin on B5
Declare LCD_Lines 2                 ' Amount of LCD lines
Declare LCD_Interface 4             ' Interface method is 4 bit

PortB_Pullups = true
All_Digital = TRUE
 
Symbol DQ = PORTB.0                 'Place the DS1820 on bit 1 of PORTA
     
Dim Sign As Byte
Dim Cnt As Byte
Dim Count_Per_Deg As Byte
Dim Temp As Word
Dim Temp_Dec As Byte
 
DelayMS 150                         ' Let LCD warm up

Cls
 
' Send a command that creates the degree
Print $FE,$40,$06,$09,$09,$06,$00,$00,$00,$00 
'  symbol on the LCD, to print it, simply address
'  the character as 0, eg,
'  Print At 1, 1, Value, 0, "Degrees"

Again:
 
'Send calculate temperature command
OWrite DQ, 1,[$55,$10,$31,$C5,$C8,$00,$00,$00,$F4,$44]           
                 ' FF  I1  I2  I3  I4  I5  I6  CRC                 
                 '  FF - Family, Ix - Address bytes,
                 '  CRC - checksum
Repeat
     DelayMS 25                   ' Wait until conversion is complete
     ORead DQ,4,[Cnt]             ' Keep reading low pulses until
Until Cnt=0                    '  the DS1820 is finished
     
'Send read scratchpad command
OWrite DQ,1,[$55,$10,$31,$C5,$C8,$00,$00,$00,$F4,$BE]           
                ' FF  I1  I2  I3  I4  I5  I6   CRC
                '  FF - Family, Ix - Address bytes,
                '  CRC - checksum checksum

ORead DQ,2,[Temp.LowByte,Temp.HighByte,Cnt,Cnt,Cnt,Cnt,Cnt,Count_Per_Deg]
 
' Each Cnt is 1/16 of a degree, therefore 100/16 = 6.25, and that's our decimal value
Temp_Dec = (6.25 * Cnt)     
 
' Bits 8-15 are 1 for a negative temperature and 0 for a positive
If Temp.8=1 Then
     ' If negative then drop the first bit, and invert the value     
     Temp=(Temp.LowByte ^ $FF) >> 1   
     ' If Cnt = 0 then increment Temp, as the 1820 does not do this
     If Cnt = 0 Then Temp = Temp + 1   
     ' Change the sign to a negative
     Sign = "-"                                                           
Else
     ' If positive then drop the first byte
     Temp=(Temp >> 1)   
     ' And change the sign value to positive               
     Sign = "+"       
 
     ' Invert the decimal value                                                   
     Temp_Dec = 100 - Temp_Dec                             
EndIf
 
' Display the data on the LCD
Print At 1,1, Sign, Dec Temp, ".", Dec Dig Temp_Dec, 1, 0,"C "
 
 
GoTo Again
Simpler designs are usually better.

Offline your most RIDICULOUS man :)

  • Diesel Generator
  • *
  • Posts: 1839
  • Pogi/Ganda Points: 53
  • Gender: Male
Re: Temperature sensor (LEDs as display)
« Reply #11 on: November 20, 2009, 12:13:16 AM »
waaaaaaaaaaaaaahhhH! bat ganito ang proton ko.. kakarestart ko lang pc.. nacompile ko na yung code.. kanina hindi.. pag minsan naman hanap siya usb blah blah daw..
God give us the grace to accept with serenity the things that cannot be changed, courage to change the things which should be changed and the wisdom to distinguish the one from the other [Reinhold Niebuhr]

Philippine Electronics Forum

Re: Temperature sensor (LEDs as display)
« Reply #11 on: November 20, 2009, 12:13:16 AM »

 

Privacy Policy

Contact Us: elabph@yahoo.com