Automatic control and display of Room temperature


Closed Thread
Results 1 to 10 of 10
  1. #1
    afterdate's Avatar
    afterdate Guest

    Default Automatic control and display of Room temperature

    hello to all

    could any one help me . i have this circuit
    and i want to do the PIC read the signal form the sensor and do compare like if the signal is 20 turn ON the Fan , and if the signal up 20 turn OFF the Fan and all this i want to shown in LCD. i have a code but does't work i know know why? if any one know what's wrong plz tell me. thank you very much
    all the best

    and i have a code or the program does't work i do't know.

    thank you very much
    +++++++++++++ (1)

    Device =16F877
    XTAL 4
    Declare LCD_DTPIN PORTB.4
    Declare LCD_ENPIN PORTB.3
    Declare LCD_INTERFACE 4
    Declare LCD_RSPIN PORTB.2
    Declare ADIN_RES 10
    Declare ADIN_TAD frc
    Declare ADIN_STIME 50
    Input PORTA.0
    ADCON1 = %10000000
    Dim volt As Float
    main:
    volt=ADIn 0
    Print At 1,1,@volt
    If volt=127 Then
    PORTC.0=1
    Else
    EndIf
    GoTo main

    ++++++++++++++++ (2)

    Device 16F877
    XTAL 4
    Output PORTB
    Symbol led = PORTB
    Dim I As Byte
    Main:
    led = 255
    DelayMS 500
    For I=0 To 7
    PORTB=PORTB << 1
    PORTB=led
    DelayMS 500
    Next I
    GoTo Main

    +++++++++++++++++++++++ (3)
    Device =16F877
    XTAL 4
    Declare LCD_DTPIN PORTB.4
    Declare LCD_ENPIN PORTB.3
    Declare LCD_INTERFACE 4
    Declare LCD_RSPIN PORTB.2
    Declare ADIN_RES 10
    Declare ADIN_TAD frc
    Declare ADIN_STIME 50
    Input PORTA.0

    Output PORTB
    Output PORTC

    Dim var1 As Byte
    Dim volt As Byte
    main:
    var1=ADIn 1
    volt= var1
    GoSub compar
    GoTo main
    compar:
    If var1 <150 Then
    PORTB.2=1
    Else
    PORTB.2=0
    EndIf
    Return

    +++++++++++++++++++ (4)
    Device = 16F877
    XTAL 4
    Declare LCD_DTPIN PORTB.4
    Declare LCD_ENPIN PORTB.3
    Declare LCD_INTERFACE 4
    Declare LCD_RSPIN PORTB.2
    Dim x As Float
    Dim y As Float
    y=58.5
    x=665.25
    label:
    Print At 1,1,"hi man"
    DelayMS 1000
    Print At 2,1,Dec y
    GoTo label
    Attached Images Attached Images  

  2. #2
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Doesn't seem like a PBP code

    Hi,

    Although I do not use PROTON it seems that this is a "PROTON" code and will not compile in PBP.
    May be something of this sort may work.
    Code:
            DEFINE OSC 4
            
            DEFINE ADC_BITS 8 'Number of bits in ADCIN result
            DEFINE ADC_CLOCK 3 'ADC clock source (rc = 3)
            DEFINE ADC_SAMPLEUS 50 'ADC sampling time in microseconds 
           
            DEFINE LCD_DREG PORTB       ' Set LCD Data port
            DEFINE LCD_DBIT 4           ' Set starting Data bit (0 or 4) if 4-bit bus i.e, Portb.4-PORTb.7
            DEFINE LCD_RSREG PORTB      ' Set LCD Register Select port
            DEFINE LCD_RSBIT 2          ' Set LCD Register Select bit i.e, PORTC.5
            DEFINE LCD_EREG PORTB       ' Set LCD Enable port
            DEFINE LCD_EBIT 3           ' Set LCD Enable bit i.e, PORTB.3
            DEFINE LCD_BITS 4           ' Set LCD bus size ot 4 bit Upper Nibble (4 or 8 bits)
            DEFINE LCD_LINES 2          ' Set number of lines on LCD to 4 Lines
            DEFINE LCD_COMMANDUS 2000   ' Set command delay time in us
            DEFINE LCD_DATAUS 50        ' Set data delay time in us
            
            VOLT   VAR BYTE             ' VOLT AS A VARIABLE  
    
    TRISA.0 = 1 ' SETUP PORTA.1 AS AN INPUT
    TRISB   = 0 '
    
    
    Input PORTA.0 
    ADCON1 = %10000000 
    
    LCDOUT $FE,1 : PAUSE 100
    main: 
    ADCIN 0, VOLT
    LCDOUT $FE,$80, DEC VOLT , "   "
    goto main
    It compiles okay and "hex attached"
    Attached Files Attached Files
    Last edited by sougata; - 30th March 2006 at 06:34.
    Regards

    Sougata

  3. #3
    afterdate's Avatar
    afterdate Guest


    Did you find this post helpful? Yes | No

    Default

    hello,Dear Sir;
    sougata
    thank you very much.

    could u explan to me more what are u worte.

    i want PIC to take signal from the Sensor and do compare and turn ON if the temperatue LOW and turn OFF when the temperature HIGH.and show the temperature in LCD.

    and your answer for only anlogue to digital . could u tell me all. and u said i do't no PROTON no problem. do u know how to write the all code without PROTON. i mean same what to write to me.

    iam so sorry bec my language is not perfect.

    i hope to understand what i mean.

    many thanks

    all the best

  4. #4
    afterdate's Avatar
    afterdate Guest


    Did you find this post helpful? Yes | No

    Default

    [QUOTE=afterdate]hello,Dear Sir;
    sougata
    thank you very much.

    could u explan to me more what are u worte.

    i want PIC to take signal from the Sensor and do compare and turn ON the Fan if the temperatue LOW and turn OFF when the temperature HIGH.and show the operation in LCD.

    and your answer for only anlogue to digital or not, bec iam no't good in program also iam not good in PROTON and this code from my friend and if u have same code i mean same to write to me . could u tell me all. and u said i do't know PROTON .
    do u know how to write the all code without PROTON. i mean same what did u write to me.

    my language is not perfect iam so sorry about that.


    many thanks

    all the best
    Last edited by afterdate; - 31st March 2006 at 16:12.

  5. #5
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Did the code work for you ?

    Hi there,

    Are you new to programming or just trying to use a micro for the first time ? Let me know the compiler version you are using and I shall try to explain.However it is important if the code at all worked for you. That is if you at all got any display.
    Regards

    Sougata

  6. #6
    afterdate's Avatar
    afterdate Guest


    Did you find this post helpful? Yes | No

    Default

    hello Dear Sir;
    sougata

    yes this time first time to use PIC program. and i have project call Automatic control and display of Room temperature. and i thing to use PIC and i have my friend tell me use PIC Basic language it's easy. and he give me the code same i put in the first topic.and u give me a code similler my code. and what do u mean which compiler version u mean the program. i have PROTON IDE Lite.
    if also in the university MPLAB program.

    Excuse me Sir could i speck to u by Email. and my Email ; [email protected]

    thank you very much
    all the best
    Last edited by afterdate; - 1st April 2006 at 02:13.

  7. #7
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default This is not the right forum for you

    Hi,

    This forum is for PIC Basic Pro. This forum is located at www.picbasic.org/forum/ .Since I am not a Proton user it is not possible (practical) to comment on code examples. Regarding email, it is not necessary because this forum is full of pros. This forum has helped me a lot to understand the complexities of programming. I hope you would find somebody on the Proton forum to help you out.


    Best of Luck
    Regards

    Sougata

  8. #8
    afterdate's Avatar
    afterdate Guest


    Did you find this post helpful? Yes | No

    Default

    hello
    sougata

    which program this one , and do u know how i do my project by your code.

    DEFINE OSC 4

    DEFINE ADC_BITS 8 'Number of bits in ADCIN result
    DEFINE ADC_CLOCK 3 'ADC clock source (rc = 3)
    DEFINE ADC_SAMPLEUS 50 'ADC sampling time in microseconds

    DEFINE LCD_DREG PORTB ' Set LCD Data port
    DEFINE LCD_DBIT 4 ' Set starting Data bit (0 or 4) if 4-bit bus i.e, Portb.4-PORTb.7
    DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
    DEFINE LCD_RSBIT 2 ' Set LCD Register Select bit i.e, PORTC.5
    DEFINE LCD_EREG PORTB ' Set LCD Enable port
    DEFINE LCD_EBIT 3 ' Set LCD Enable bit i.e, PORTB.3
    DEFINE LCD_BITS 4 ' Set LCD bus size ot 4 bit Upper Nibble (4 or 8 bits)
    DEFINE LCD_LINES 2 ' Set number of lines on LCD to 4 Lines
    DEFINE LCD_COMMANDUS 2000 ' Set command delay time in us
    DEFINE LCD_DATAUS 50 ' Set data delay time in us

    VOLT VAR BYTE ' VOLT AS A VARIABLE

    TRISA.0 = 1 ' SETUP PORTA.1 AS AN INPUT
    TRISB = 0 '


    Input PORTA.0
    ADCON1 = %10000000

    LCDOUT $FE,1 : PAUSE 100
    main:
    ADCIN 0, VOLT
    LCDOUT $FE,$80, DEC VOLT , " "
    goto main


    thank you very much

    all the best

  9. #9
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default I converted the code into PBP

    Hi,

    The code example that you posted was in Proton PIC Basic and I converted it into PBP ( PicBasicPro).

    In this forum we share codes and problems but you have to walk your own way. You may find somebody to give you code examples to sort out problems but you should have the understanding of what you are doing. Otherwise it would be impossible for you to upgrade/maintain/troubleshoot your program. As I have been a hobbyyist I always have the intention to help hobbyist but with a micro you cannot simply expect to do a copy/paste sort of experiment.
    Send me what you want to do exactly, what features you want and what PIC you want to use. I will try to post some examples if possible.
    Regards

    Sougata

  10. #10
    afterdate's Avatar
    afterdate Guest


    Did you find this post helpful? Yes | No

    Default

    hello Dear SIR ;

    thank you very much Sougata

    all the best

Similar Threads

  1. Replies: 2
    Last Post: - 14th July 2008, 22:11
  2. Need idea hove to..?
    By phoenix_1 in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 14th May 2008, 18:41
  3. ISD4003 & 16F877 Interface
    By sayzer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th December 2006, 17:50
  4. Automatic control and display of Room temperature
    By afterdate in forum Off Topic
    Replies: 1
    Last Post: - 23rd March 2006, 15:24
  5. select case question
    By ronjodu in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th March 2006, 10:01

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts