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 Acetronics View Post
    Hi, Malc

    You'll have to place your Button Key INSIDE the vivarium ( hé,hé ... WITH the snakes !!! ) if you want a true image of your temp.

    Alain
    Agreed,

    I've just taken a further reading with the probes 2" from the heater, so its sampling the air temperature. Here's the result (the button logger still on the shelf as shown)



    If you ignore the fluctuations in between 10pm and 3am when the snake was out and obviously laying on the sensor, and look at the period 4am to 4pm you'll see it a lot more stable and only has a 0.2C deviation.

    DT, could you elaborate on a PID loop.

    Alain, could you provide a link to that file... I'm frantically searching for a DS1820 so I can start developing this project, but as my PBP programming is so rusty (and basic) may need you guys to offer some assistance if I get stuck (or should that be when I get stuck )

  2. #2
    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

  3. #3
    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 !

  4. #4
    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 17: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.

  5. #5
    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.

  6. #6
    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  

  7. #7
    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?

  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, 22:55
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 22:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 9th December 2008, 00:40
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 09:26
  5. Re-Writing IF-THEN-AND-ENDIF code?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th August 2006, 18:23

Members who have read this thread : 2

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