Creating multiple time driven events

Hi All

I'm just hashing out a project for a spa controller, which for the most part is coming together having just been introduced to state machine programming, and I am just thinking through how to add multiple time based events via a menu.

The spa will have two modes, Economy Mode and Comfort Mode. Economy is when the spa is generally not used such as throughout the night but also during the middle of the day and we will let the temp drop to save power, this will be the default mode

Comfort mode is the time we want the spa to be at out desired temperature ready for use and I will use a menu to be able to add, delete or edit times.

My question is it is possible to add multiple "comfort" times via a menu (using a RTC) and add to a list that expands to hold more items.
Or do you simply create a number of variables ready to take the multiple times and guess how many you will need. ie
Comfort 1 (between time X and Time Y)
Comfort 2 (between time X and Time Y)
Comfort 3 (not programmed)
Comfort 4 (not programmed)
etc

and then just add the times into those awaiting slots, this seems the simplest solution to me but was just wondering if there is a more elegant way. For example, I know a lot of dinrail mounted time clocks will have a set number of slots you can program for on/off each day.

Cheers
Al

You create slots that you fill in with what you want. However, there is nothing to stop you creating, for example, 24 slots and only filling in the ones you want to use, leaving the others spare. You would have to include some kind of marker so the system knows to ignore the ones you are not using. Keep in mind how much memory you have and consider how you are going to save the data when the power is off.

For what it's worth my original heating controller design had 6 settings per day for each zone. I never used more than 4 for anything. My current heating controller has 4 per day per zone.

Have you considered that the power consumption equals the heat loss from the system, which is proportional to the temperature difference between the water and the air? Letting the water go cold and re-heating it when you need will have the lowest power consumption overall because the cooler the water the less heat it is losing to the air and so you put less energy back to get it up to or maintain the desired temperature.

Thanks for the reply

Yes I had "considered" how to ignore the blank slots. Haven't actually work out exactly how yet but that's the fun of a new project. I'm sure it will become clear.

In regards

Have you considered that the power consumption equals the heat loss from the system, which is proportional to the temperature difference between the water and the air? Letting the water go cold and re-heating it when you need will have the lowest power consumption overall because the cooler the water the less heat it is losing to the air and so you put less energy back to get it up to or maintain the desired temperature.

You sound like you have a background in thermodynamics of some sort :slight_smile: I haven't worked out any math on the project but was basing it on the theory you state above. I remember seeing another post of yours regarding the power of evaporation in cooling a body of water, I think it related to fish tanks (which I also have). I'll probably do it the hard way and use a datalogger and guesswork to find efficiency. I know you are cringing now :slight_smile: I also want to work out the efficiency of the heater itself. I know if I apply power it heats the element, I don't know exactly how hot but probably over 100 deg c, but the spa only needs to be 40 deg c so if I pulse the power (on for 30 secs off for 30 secs for example) will it increase deficiency of power consumption without too much loss of heating. These are the questions that keep me up at night :slight_smile:

I'm at the very first steps of this project so a bit of research to do yet.

Cheers
Al

You sound like you have a background in thermodynamics of some sort

No, I have an interest in physics from an unqualified, amateur point of view.

I remember seeing another post of yours regarding the power of evaporation in cooling a body of water, I think it related to fish tanks.

Are you sure that was me? Doesn't sound like me but I have a memory like a...sorry, who are you again? :confused:

I also want to work out the efficiency of the heater itself.

I assume it is an electric heating element, they are pretty much 100% efficient in terms of electricity in and heat energy out. This provides much joy to advertisers who make misleading claims as they advertise their electric heaters as 100% efficient, ignoring the tiny little detail that electricity costs many times more than fossil fuel for a less efficient heater.

I know if I apply power it heats the element, I don't know exactly how hot but probably over 100 deg c, but the spa only needs to be 40 deg c so if I pulse the power (on for 30 secs off for 30 secs for example) will it increase efficiency of power consumption without too much loss of heating. These are the questions that keep me up at night

Get some sleep. Pretty much all the electrical energy going into the element ends up as heat in the water. There might be reasons to pulse the power, but this is not one of them. You just need to consider how warm you want the water and supply enough heat to maintain the temperature.

Turning the heater off and on serves a different purpose; if you vary the off and on period you have very slow PWM. My heating controller does this with a cycle time of 720 seconds. Probably for an electric heater maybe a few seconds would do. Make sure you turn on at zero crossing and, ideally, use whole cycles so there is no net DC in the load.

The reason I know this is from a comment someone made in the staff canteen many years ago about the merits or of leaving the heating on Vs letting the house cool down and then re-heating it when needed. He thought keeping the house warm would use less energy than letting it cool and re-heating. I knew immediately he was wrong, but it took me a while to work out why.