Can I pick someon's brains please?


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    May 2008
    Posts
    33

    Default Can I pick someon's brains please?

    Hi guys, I've been reading here for a long time now and know about checking data sheets and searching on google and so on.
    However I'm pretty new to Pic programming and I'd like some pointers please (if you dont mind me asking)
    I'm trying to make a double thermostat i.e. measure the temperature indoors and outdoors, and if the temperature falls inbetween a certain range then my lcd would do nothing but display both temperatures.
    However I'd like 2 switching outputs, so if the temperature was below a certain figure a heater would come on, if it was above a certain figure then a cooler would activate.
    Hope I'm making sense so far, and apologies for making this long winded but I figure it best you know as much as possible to give the best answer.

    I've decided to use DS18B20's as the sensors.
    What i'd like is some pointers on how to get the pic (probably a 16f877 as thats what I have here at the moment) to read the temperatures display both on the lcd and monitor the range of both sensors so it switches only between 2 ranges
    for example if the temp is above 20șC and 25șC only the temp is displayed on the LCD, but if it goes above 25șC then an output goes high activating the cooler, similary is the temp goes below 20șC then another pin goes high activating a cooler.

    I'm not asking for finished code, as although it would be totally handy I like experimenting.
    What Id like if possible is some help, maybe some kind of flow chart showing the steps I need to take bujt mainly how to get the pic measuring the range of both temp sensors continually and acting on it,
    FORGOT to say above, each sensor is in a different room so they both need to be monitored and acted upon independentaly of each other,
    hope that all made sense. (using PBP 2.5)
    Lew

  2. #2
    Join Date
    Oct 2004
    Posts
    19


    Did you find this post helpful? Yes | No

    Default

    Perhaps you can start here.
    http://www.rentron.com/PICX4.htm

    Victor

  3. #3
    Join Date
    May 2008
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by victorf57 View Post
    Perhaps you can start here.
    http://www.rentron.com/PICX4.htm

    Victor
    Thanks, thats a great help although I had actually seen it when I was doing some research for this, what I dont get is how you use it as a thermostat though, monitoring a certain range of temperatures.
    I'm using the 16f877 and the DS18B20 because thats what I have handy at the moment.

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    May 2008
    Posts
    33


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    I was actually just reading that at the same time you typed that.
    it looks extremely promising, although not having used the serout command or serial at all yet it "seems" a bit complex but I'm assuming I can just change the serout commands to lcdout and pick the line i want it displayed.
    It's late at the moment and I'll look again tomorrow when I'm fresher, but at a glance I cant see past of that code that compares the range of temperatures and acts on it,(thermostat range) although as I said its late and Im tired so I'm probably missing it.
    Thanks for the help so far guys, it's nice being able to pick people's brains and sorry if I seem to be making mistakes and missing things at the moment.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lew247 View Post
    Thanks, thats a great help although I had actually seen it when I was doing some research for this, what I dont get is how you use it as a thermostat though, monitoring a certain range of temperatures.
    I'm using the 16f877 and the DS18B20 because thats what I have handy at the moment.
    Are you asking how to use the information gathered from the DS18B20 ?
    something like:
    Code:
    loop:
    IF MYVAR1 >=  75 THEN
     PortB.1 = 1
    IF MYVAR2 <=  65 THEN
     PortB.0 = 1
    else
    portb.1 = 0
    portB.0 = 0
    serout PortB.6,N9600,[254,128,"Inside temp is,"#myvar1]
    serout PortB.6,N9600,[254,192,"Outside temp is,"#myvar2]
    endif
    endif
    goto loop
    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.

Similar Threads

  1. pic 2 pic pic'n my brains out!
    By earltyso in forum Serial
    Replies: 6
    Last Post: - 10th April 2008, 22:33
  2. Which book to pick?
    By bartman in forum General
    Replies: 9
    Last Post: - 18th November 2005, 16:07

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