RH/Temp Sensor Example Code


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Christopher,

    I haven't tested with this one for accuracy, but it's one of the easiest to use RH/temp sensors I've seen in a while.

    This one has an onboard processor that sends RH & temp out in standard ASCII format. No need for anything analog. It's real simple to use.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  2. #2
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default

    Bruce,

    I've ordered three temp sensors, two digital and one analog; they should be here tomorrow. I have some additional questions about your code.

    1. I am using the USART port on the PIC for something else so I am pretty sure I can use the temp sensor on another pin for serout/serin but does the code have to be manipulated a lot? Instead of writing:

    HSEROUT ["RH=",TEMP(1),TEMP(2),TEMP(3),TEMP(4),"% : "]

    Can I write

    Serout2 portb.1, 396, ["RH=",TEMP(1),TEMP(2),TEMP(3),TEMP(4),"% : "]

    2. The result will be something like 98.3 or 104.6 or 35.4 rather than just 35 or 45 or 198? Is this correct?

    Thanks,

    Chris

  3. #3
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default

    I forgot to mention, maybe I can buy a PIC with 2 USART ports and could solve the problem also.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Chris,

    You won't need a PIC with a hardware USART, and you can use any I/O-pin or
    serial command you prefer. I just used the USART since I had a board with a
    hardware serial connection for the test.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. Re-Writing IF-THEN-AND-ENDIF code?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th August 2006, 17:23

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