controlling a sensor at a peak reading

fisherman

New Member
;) I have my temp differential program running nicely for my solar water collector and would like to control some fans for the rock storage system. I can turn the fans off or on easily but would like to also run the fans to the peak temp of the rock storage and then shut off and reset to a beginning temp rather than keep running and drop the storage temp.

I have seen programs that keep adding but not sure just how to go about it.

I think you would add each sensor reading and if the last reading was > than the last couple of readings then you shut the fans off and reset to basic temp setting.

Funny how talking it through helps form a solution.
 

Dippy

Moderator
Yes, quite often just writing it down in your favourite language sorts the query.

Then just translate into BASIC.
 

fisherman

New Member
need some direction

I seem to be going in circles and would appreciate some direction to control a fan up to a peak temp and then shut off.
 

hippy

Ex-Staff (retired)
You may have to explain in basic terms exactly what it is you have and how what you want is expected to work to avoid misunderstandings. My interpretation is ...

You have some fans on and some 'rocks' are heating up, when their temperature reaches a peak you want to turn the fans off.

Peak heat will be the highest temperature you've read, so ...

ReadTemp pin, currentTemperature
If currentTemperature > peakTemperatureSoFar Then
peakTemperatureSoFar = currentTemperature
End If

As I see it you have two ways to detect when peak temperature has been reached; either peak stays the same for a certain period of time, or it begins to drop again. The later is easiest ...

If currentTemperature < peakTemperatureSoFar Then
Gosub TurnFansOff
End If

Hope that helps a bit.
 

BeanieBots

Moderator
I too struggled to be certain of exactly what you wanted.
Maybe give an example including some example numbers to avoid any doubt.
 

fisherman

New Member
blank page!

I guess i was trying to keep the message short, as can get pretty long winded. Guess you can't read my mind, or as my friend says, " you can't read a blank page"
Yes that is what I am trying to do. I have 4000 cu ft of rock storage under the house and 2000 gallons of water storage in a connected greenhouse. The solar water collectors (outside) heat a couple hundred gallon of water uo to 100f and that in turn heats the water barrels in the greenhouse and the fans draw the heated air from the greenhouse and heat the rock storage and radiate to the rest of the house. I can heat the rock storage to about 78 to 80F but the green house temp falls below that at night and thus the fans have to be shut off at peak temp.
Thanks for the direction as I into ifs and count and getting
nowhere.
will check out the suggestions

Tx again
 

manuka

Senior Member
A very interesting project-how does it perform overall? Any pictures? Stan. (in the balmy Sth. Seas)
 

boriz

Senior Member
Maybe...

Rather than checking for a peak, perhaps it would be better to compare the temperature of the incoming air with the temperature of the rock, so that when the air is hotter than the rock, the fans blow, but shut off when the air is cooler than the rock?
 

fisherman

New Member
I was not able to get the " sofarthan" part though the simulator, maybe spacing thing. but it was enough to get me to get the program running. Tx
I looked at the "if commands" and never saw anything like "sofarthan" anywhere.
I got the program working and thats the main thing but am I missing something??

The wife says that I have logged a lot of laptop time but my programs work so now I have to download them to a chip and see if the sensors work in the real world.
I posted a private message to manuka and see that it gets filed. How does that work.
Guess i need to review how the board works rather than going by hit and miss.

Again tx for the patience and help
 

BeanieBots

Moderator
I think Boriz makes a valid point.
What is the actual object of the excersise?
Is it to get the maximum amount of heat in one hit or to get the maximum of heat transfer over a ceratin period. (eg, what happens if there are several 'peeks' in one period between resets of your peek detector).
Presumably you 'reset' the peek each 24hrs?
 

fisherman

New Member
maximum heat

Yes the object is to get maximum heat transfer each day.
Boris's comment about the hottest aid temp gave me pause as to the best method. As there is only about a 6 hour window of heat from the collectors and considering the amount of thermal mass I don't think that there would be more than one peak temp as the mass starts to radiate the heat to the house.
I seem to lose 3-4f overnight.
My only thought was to prevent the fan runninng after the peak temp was reached and to prevent unnecessary cooling.
I may find different results but then again these little things can be reprogrammed again and again.tx
 

boriz

Senior Member
Can’t help wondering if you would get a more efficient transfer if you do without the fans and just pump the hot water through the rocks and back into the solar heater.

The heat in the returning water will mean a higher starting point for the next heating cycle through the solar collector. So the water coming out of the collector will be even hotter.

Can’t you redesign to eliminate the fans? It would save power :)

Also, you never know for sure what the weather will be like. Clouds could mean several temperature peaks in 6 hours. Comparing the rock temperature and water temperature will allow a perfect ‘heat always flowing in the right direction at the right time’ system.
 

fisherman

New Member
committed to fans

The system is what it is as it was built years ago.
There is another part of the system that senses the hot water in the collector
(outside) and the storage tank (inside) to control the circulating pump.
This program was just downloaded to the 08m chip. Once I am sure it runs ok then I can combine the rock storage sensor program to the 08m. I can easily use the water tank temp sensor as part of the rock storage program as I plan to combine the two programs on the same 08m chip.
I know it seems an awkward way but prefer get one section running and then add the second part.
Right now getting the temp comparator running so that the pump runs on heat sensing rather than the timer that I am currently using.
Once things are going then plan to add the data recording feature of the eprom but have to learn more yet. Sure not board.
Phil
 

boriz

Senior Member
It occurs to me that if you use a comparison method, you don’t need to decode the sensor data into temperature units. IE: Using two thermistors. Simply start the fans when one reads higher than the other. Or, you can do it using only one ADC channel: Arrange the thermistors as a divider. When the ADC reads above 50%, then the top thermistor is warmer. When below 50%, the bottom thermistor is warmer.

Using this method, you wouldn’t even need a Picaxe. Any old op-amp would do.
 

premelec

Senior Member
Differential controller thermistors

Yes Boriz, I built a number of units like that - However I also observed a failure in several cases where the outside sense wires broke [usually from wind flex] making the outside temperature "seem" very cold and thus preclude turning on circulation.... so my added advice is - place your outside thermistors well and tie their wires securely :) Or put in provision for detecting 'thermistor present' like broken thermocouple detection which is common. But - PICAXE's are such fun and indeed can easily be used with 2 thermistors in series with the common point to one ADC input - interpreting the values appropriately etc...

Whatever works! so many ways to do it :)
 
Top