Please help with code for DS18B20


Closed Thread
Results 1 to 40 of 110

Hybrid View

  1. #1
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by malc-c View Post
    DT, could you elaborate on a PID loop.

    OK - google was my friend

    http://en.wikipedia.org/wiki/PID_controller

  2. #2
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default



    Err.... yeah...

    previous_error = 0
    integral = 0
    start:
    error = setpoint - actual_position
    integral = integral + (error*dt)
    derivative = (error - previous_error)/dt
    output = (Kp*error) + (Ki*integral) + (Kd*derivative)
    previous_error = error
    wait(dt)
    goto start
    LOL - £34 for a commercial thermostat looks more promising !

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by malc-c


    Err.... yeah...



    LOL - £34 for a commercial thermostat looks more promising !
    What ? That's as clear as mud! I thought they taught you that in primary school.
    34 pounds for a thermostat? Must be the VAT ! Damn Globalists, want to federalize the world !
    http://www.prothermostats.com/produc...product=100934
    $40 US 24.42 GBP
    Last edited by Archangel; - 16th December 2009 at 16:56.
    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.

  4. #4
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Please help with code for DS18B20

    hi all,

    i would like to make the circuit for the thermostat. could you please upload the circuit schematic? thanks a lot for your help.

  5. #5
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Please help with code for DS18B20

    Dear all,

    sorry for asking you for the schematic, i did it from the code but i need your advice according to the second sensor please.

    could you please help me out to finish the schematic?

    thanks.
    Attached Images Attached Images  

  6. #6
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Please help with code for DS18B20

    i have been trying to simulate the circuit on the proteus and also trying to make it work on the test board.

    On the simulation i have some result but on the test board i dont get anything on the lcd.

    Unfortunately with the code from Elektor i get some results on the lcd on the test board. But very wrong result like 234 oC.

    Could someone upload the hex file from Mr. Fratello's #35? Could anyone made it work?

  7. #7
    Join Date
    Oct 2009
    Location
    Utah, USA
    Posts
    427


    Did you find this post helpful? Yes | No

    Default Re: Please help with code for DS18B20

    but i need your advice according to the second sensor please.
    could you please help me out to finish the schematic?
    The second sensor (and the third, forth, fifth, etc, etc.) simply goes in parallel with the first... see example below.

    Name:  2011-09-25_074625.jpg
Views: 4766
Size:  39.5 KB

    The PIC's job is to address each individual sensor to read its value. That is how the One-Wire bus works. Each sensor has an address and will only respond to it's address.
    Dwight
    These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.

  8. #8
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    You've got better friends than that.
    HenrikOlsson for instance ...

    PID-filter routine (2nd try).
    http://www.picbasic.co.uk/forum/showthread.php?t=5874

    I've used it. It works great.
    It's a little tricky to find the correct constants. But trial and error usually works.
    Although there is a purposeful method to tune the loop.
    <br>
    DT

  9. #9
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    You've got better friends than that.
    HenrikOlsson for instance ...

    PID-filter routine (2nd try).
    http://www.picbasic.co.uk/forum/showthread.php?t=5874

    I've used it. It works great.
    It's a little tricky to find the correct constants. But trial and error usually works.
    Although there is a purposeful method to tune the loop.
    <br>
    Sorry Darrel.... it's been a long day......!

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 : 3

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