In my test I measure :
- MINUS 15.20 ' C in the refrigerator
- PLUS 24.15 ' C in the room.
With one sensor and with two sensor too.
In my test I measure :
- MINUS 15.20 ' C in the refrigerator
- PLUS 24.15 ' C in the room.
With one sensor and with two sensor too.
Some ( wrong ! ) values have a typical meaning :When I tried for that and with one sensor, it shows -0.06 Celsius. and the sensor would not respond for variation
0.06 as a "measure " shows a connecting ( or sensor ) problem ... Check your DQ line ...
85 shows conversion not completed ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
I've been playing with this all day today and it's a great piece of code.
I used this as I have an easypic 6*
I have one problem/question that perhaps someone could answer please
When I program the pic, the sisplay shows * at the end of the 1st line even when no buttons are or have been pressed, I thought the * was only to show a button had been pressed?
Also if I cycle through the button presses, ie set temp and set hysteresis they both work fine
however when I press the button again to show the actual temp that also works. but it never seems to update UNLESS I hold the button in, then it updates continually
I've been trying to get it to update at a regular interval or any interval but it just wont, am I doing something wrong or does it never update the temp?
Hi,
That looks no pullups - or a Pulldown ! - on PORTA.0 input ... the " * " only appears when Porta.0 is tied to ground.
Everything fine here ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
I thought that might be the problem, but where would I put
high portA.0
If I put it before the mainloop it displays the temperature all the time,
if I put it at the end of mainloop then it still displays the * and stays on set temperature.
I can't figure out where to put it, must be easy but I just cant see it.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Sorry Alain, I wasn't too clear on what I meant.
The easypic board HAS pullup resistors on those ports.
When i run the program, the lcd sits there with just the * displaying even when no button has been pressed (portA.0 in this circuit/program)
it does nothing else.
When I press portA.0 the display cycles through set temp (which I can set properly with portA.1 and portA.2)
Next press brings it to the Hysteresis which again will set ptoperly
the 3rd press brings up the temperature display mode (mode 0 )
It displays the temperature at the moment the button is pressed but it never updates or checks again.
I have checked it works by holding down the button on portA.0 and if held down (LOW) then the display works properly, measuring the temperature continious, and if the temp changes it makes port C.0 or C.2 high depending on the set temp and hysteresis.
My problem is I cannot get it to continually measure temperatre without holding down portA.0
Also when I turn the power on first all I get is the LCD blank other than * being displayed.
Having read the code, * should only display after each button press, but it always displays.
Also I'd like it when power is turned on to measure and show the temperature continoiusly until the button (portA.0) is pressed.
Hope that made more sense, as I knew I couldn't put resistors inside the pic
Very informative thread and funny enough something that I was hoping to work on myself as I'm looking at replacing the simple on/off thermostats that control the heating in my reptiles vivariums.
Can someone (Alain?) post up a schematic for the project. (or settings for the EasyPIC5) - I'm looking at trying to develop this a bit further so the output is pulsed, with the mark / space ratio reducing as the set point is neared. I've used commercial on/off stats, and the temperatures are hard to control. The idea is to keep the hot spot fairly constant and below 35C max, as constant exposure to a surface above this temperature can cause a burn risk to snakes.
With the thermometer probe placed on the shelf near the logger (it wasn't actually touching the same spot), and with the thermostats sensor in the cool part of the shelf, the thermostat was set so the digital thermometer read a max of 34C. Here's are the results - the bit you are interested in is between 18:00 hrs onwards
Obviously the heat was conducting through the wood, which cooled slower than if the sensor was measuring air or the surface of the heater. But you can see that there is a large temperature swing between the min and max readings, and that the surface reached over 40C
To reduce this difference I placed the two probes next to the logger directly above the heater. Here is the results, which still show the same cycling, but with a lower differential (average 5 degree C), but is more stable
The pulse proportional stat reduces the cycling as it's not switching the heater on/off/on, it maintains a steady temperature by pulsing power to it thus the heater never cools.
I could purchase a couple of commercial PP stats for around £100 (possibly less via mail order) but then where's the fun in that Now I know there are a lot of you experience programmers that have dabbled with PWM, so wonder if you would like to add your comments here.
In the set up below I used a commercial data logger to record the surface temp of the shelf over a 24 hr period.
Although I had originally posted this in my post above, the forum software said I had more than 4 images ????
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Hi, Malc
Do you understand the "why" of the Parallax document, now ... ???
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.
The graphs you've shown can't be used to finely trim a regulator ... but are a good example.
Temp measurement and moreover probes placing is a real art ... to get a nice temp regulation.
But let's begin by the beginning :
ALL you have to do already is in ZE Book ... with relevant code.
We'll see details later ...
Till then, I'll implement the PID Regulator on my existing " 84 " Thermostat ( not the one shown here, but a nicer one which is pin for pin compatible !! )
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Alain
You were right as always. I hadn't the board configured properly.
I totally forgot about the row of jumpers to set the pins pull-up or pull-down, I had it set wrong.
Thank you
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 )
OK - google was my friend
http://en.wikipedia.org/wiki/PID_controller
Err.... yeah...
LOL - £34 for a commercial thermostat looks more promising !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
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
Fratello's code has definite mistakes, and need attention. With the mistakes How it was working for him is a wonder.The suspected line numbers, i shall be indicating for consideration / possible correction.
I suspect that the code posted by him at #35 is not what he might be using.
Regards,
Sarma
Hi, Sarma
What are you talking about ???
Fratello's code can of course bear some little improvements but WORKS FINE !!!
( I just translated it to a 16F877A aboard an Easy Pic 5 ... and it's nice.)
Alain
PS: do not tell me you are waiting for custom code or you do not have something personnal working since the 8th of April ... please ...
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
What ? That's as clear as mud! I thought they taught you that in primary school.Originally Posted by malc-c
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.
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.
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.
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?
The second sensor (and the third, forth, fifth, etc, etc.) simply goes in parallel with the first... see example below.but i need your advice according to the second sensor please.
could you please help me out to finish the schematic?
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.
hello,
thanks for the answer. i use the DS18B20, so i dont need to do any modification.
The problem is that i cannot see anything on the display. It looks like something is really wrong inside the code.
I think that i make the mistake on the code or the circuit above.
1) does this schematic corresponds to the code? (i need to put one more sensor)
2) do i need to do anything inside the code
for example in the following lines do i need to chose one of these?
;DS18B20_9bit CON %00011111 ; 93.75ms, 0.5°C
;DS18B20_10bit CON %00111111 ; 187.5ms, 0.25°C
;DS18B20_11bit CON %01011111 ; 375ms, 0.125°C
;DS18B20_12bit CON %01111111 ; 750ms, 0.0625°C (default)
DS18B20_1_12bit CON %01111111 ; 750ms, 0.0625°C
;DS18B20_2_12bit CON %01111111 ; 750ms, 0.0625°C
But still i dont see anything on my lcd.
To be more specific,
as i understand i need to find the unique ID from each sensor and then modify it on the code.
First i need to solve an other problem, what about i dont see anything on the display?
Shouldnt i see some 'no sensor' or like that at least?
Yes, it's right what you say in post #71 !
Put this in top of code :
REMOVE Xtal and caps (no need quartz precision) ; or keep it - but then replace "Intosc_osc_noclkout" with "XT_Osc".Code:@ DEVICE pic16F628A, intOSC_osc_noclkout, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_ON define osc 4
Now you MUST have something on display !
Last edited by fratello; - 25th September 2011 at 18:38.
i've tried it but nothing on the lcd again,
i think it has to do with the osc commands and there is the problem.
i put a 4mhz ceramic with two legs, i idid also tried the ceramic 4mhz with 3 legs. Nothing on the screen.
i'm sad that cannot complete it.
thanks a lot for your help! am i doing something wrong with the schematic? Do i need anything else?
The code from the elektor works, but i dont have the ds1820. And it is on the screen xxx.xx
But i dont understand why it does not work with your code.
First you need to prove the pic is running. There are no caps shown in above schematic at the xtal, do you have caps on it? Have you made a led blink? Did you try internal osc?
From the quick skim I did on this thread, it seems I have read several posts claiming the code works. Time to look at your hardware.
-Bert
The glass is not half full or half empty, Its twice as big as needed for the job!
http://foamcasualty.com/ - Warbird R/C scratch building with foam!
ok i will try later this afternoon to blink an led.
Do i need capacitors for the ceramic 4 mhz resonator? I have also used a ceramic with 2 legs resonator at 4 mhz.
In any case i will try to blink an led.
As i mentioned on my previous posts, i have tried also the code from elektor, and works. (i just dont have the right sensor DS1820 which is very old and i dont get the right results. but i have something in the screen at least.
With the code from Mr. Fratello, i dont have anything on the screen. That mean that there is something wrong, either with the hardware or software.
Thank a lot again for your help.
The software it's ok !!! Remove the X-tal (leave pins 15 & 16 free), re-compile the code with added from post #73, check the RV1, check the connection to LCD., check the voltage (5 volts).
Last edited by fratello; - 26th September 2011 at 06:09.
ok thanks a lot fratello,
please give me some time to do it in the afternoon.
I have done something else with a completed different thermostat.
please check for my from an other thermostat with an old ds1621, a friend of mine gave it me i can upload the code if you like. (really sorry for my Greeks at the video, i upload it for the AVCLUB.gr there is a sub forum for flashlights)
The reason i put the video is to see the menu for the thermostat configuration. It is nice to see the configured temp and the real time temp at the same time.
Please check the video at 2:12 for the configuration menu.
Last edited by astanapane; - 26th September 2011 at 07:42.
there is something on the display now.
thanks a lot. The problem now is that i dont have the right value for the temp.
It appears a minus value for both INT and EXT sensor.
also the values for the SET POINTs are only in minus values. I think the minus symbol appears on both 75 and -25. I will upload pictures later on.
The values now i have are
INT: -0.06
EXT: -0.06
Bookmarks