4 Channel Thermostat using PID loops


Results 1 to 37 of 37

Threaded View

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

    Default 4 Channel Thermostat using PID loops

    Guys,

    Over the past few months I've been working with DT on a project which I will now share with the PBP community. Darrel put together 99% of the code and routines (some of which have already been published on his website and here on the forum). My contribution was constructing the test equipment and running the real life trials and then tweaking the values to get the best accuracy for the equipment used.

    Background

    I keep reptiles, well snakes to be exact. These need to be maintained in a controlled environment, with a steady heat source at one end of their enclosure, which needs to be thermostatically controlled.



    Whilst there are already commercially available pulse proportional thermostats on the market, these are single units. I really wanted to use one unit that had 4 separate pulse proportional thermostats which would cut down on lots of wiring etc.

    The original idea was to have 4 pots to set the target temperature for each vivarium with the temperature displayed on an LCD, however for ease of testing we opted for using hyper terminal and a simple RS232 connection.

    Development

    I have an EasyPIC5 development board, and to make life simple purchased a few of their add on modules such as the 1307 based real time clock, pot board, and several connection boards to connect the solderless breadboard to.



    To test the code and develop the project as we went along I constructed a box from 18mm melamine board, approx 400mm x 400mm x 200mm (LWH) and installed a 50w powerplate (a flat panel ceramic heater) to the roof inside the box. A 240v 4amp solid state relay was used as the means to turn the heater on and off, especially as the opto isolation could be driven directly from the PIC.

    DS18B20's were used for the sensors, and one was connected via lengths of wire to the EasyPIC5 board. The sensor was placed inside the box which was placed on a flat surface. The SSR connected to the mains and it's input connected to the EasyPIC board too.

    Darrel produced the 1st version of the PID code to drive just one channel. I then compiled and ran it to see how it performed. Over the course of several evenings I managed to get the values tweaked enough to maintain a stable temperature that would drift no more than 0.5 a degree in the course of the evening.

    Armed with the feedback, DT then went on to work on multiple channel PID loops, and after a few weeks of frantic PM's between him and Henrik came back with some further code for me to test and try. The result was that after some further tweaking at my end, we managed to have 4 independent channels all running at the same time and in the test rig, maintaining a constant temperature.

    Future Development

    The plan was to now develop the fancy options such as using the clock module to program a night time drop in temperature if required, menu buttons, and possibly a means of monitoring / setting via software on a computer, even to storing temperature data in an eprom for use with the PC software. However this meant porting the code to a different chip and so Darrel suggested the 18F4550.

    We got as far as having testing out the USB coms, and getting the PID loops running, however due to personal reasons we've had to halt development of this side of the project, at least for the present time.

    I'm now going to concentrate on developing a prototype PCB based on the 16F877A code, which has achieved the main goal, which was 4 independent pulse proportional thermostats. I'll use this prototype in the two vivs that house my two Royal pythons, which was my original intentions. However if anyone would like to contribute and take this project further, possibly to its full potential then please feel free to drop me an e-mail or PM. I've attached the code and all the includes for use in MCS (PBP 2.60 is required).

    In the meantime I would like thank Darrel for all his hard work and contribution to the project. It's guys like him that make this forum a pleasure to visit. Whilst I may not entirely understand the complicated maths that goes on in a project such as this, I've learned a lot by way of his examples. - Darrel, Thank you !
    Attached Images Attached Images   
    Attached Files Attached Files
    Last edited by malc-c; - 20th February 2010 at 13:26.

Similar Threads

  1. Simple 4 channel DMX controller
    By eggman in forum Code Examples
    Replies: 19
    Last Post: - 18th July 2012, 01:40
  2. Timer + rc5
    By naga in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th November 2009, 07:56
  3. 4 pin 4 x 4 keypad interface using pic basic pro
    By dunlao_john in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th January 2009, 05:21
  4. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  5. Real Time Clock & Eeprom
    By smart_storm in forum General
    Replies: 8
    Last Post: - 17th February 2006, 19:03

Members who have read this thread : 0

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