Page 1 of 3
24 Hour Heating Timer for RTC MIAC
Posted: Fri Nov 16, 2012 4:04 pm
by acestu
Hi everybody,
following the MIAC and RTC project that I have just completed with Enamul, I would like to utilise this by turning it into a 24 hour heating timer for my central heating at home. I would like to make it as tamper proof and easy to use as possible as it would be used by my mother lol.
To make the Timer code easier we could leave the time set periods editable in the code rather than have menu and buttons on the MIAC
Basically I would like to have 3 on off periods in a 24 hour period similar to commercially available timers:
Timer period 1
6.00 - 9.00
Timer Period 2
12.00 - 1.00
Timer period 3
16.00 - 23.00
But if you did not want the say lunch time on period you could change it to 12.00 - 12.00
Also 1 button that allows Winter/Summertime 1 hour time correction.
I look forward to hearing your thoughts on this idea...
Thanks in advance
Acestu

Re: 24 Hour Heating Timer for RTC MIAC
Posted: Fri Nov 16, 2012 6:03 pm
by Enamul
Ok. Fine. I will suggest you have a look at the following article and the forums posts..
http://www.matrixmultimedia.com/mmforum ... 244#p21244
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Fri Nov 16, 2012 6:08 pm
by acestu
Hi Enamul,
I have already seen this article unfortunately it does not have the RTC backup which we have just done, do you think it would be easier to incorporate
it into this code ?
thanks
Acestu
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Fri Nov 16, 2012 6:12 pm
by Enamul
Yes, of course. we will incorporate that in the code. Can you please just have a look in the code except TMR part for timing which we will do by RTC slave? It will help you think some other feature for the intended system.
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Fri Nov 16, 2012 6:59 pm
by acestu
Hi Enamul,
What I am trying to do is keep things simple so it is easier for myself and others to learn, Bens Tmer is specifically built for underfloor heating which has several inputs and outputs and up to 40 programmable events and controls boiler,pump,motorised valves on a manifold etc.
Bens Programmer

- Bens-UFHP.jpg (53.8 KiB) Viewed 33707 times
My heating system just needs 1 switchable output which is far less complicated, don,t get me wrong I would love to progress to something like Bens design, I just want to start with something smaller if that is ok
Thanks
Stuart
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Fri Nov 16, 2012 9:14 pm
by Enamul
Hi Stuart,
It's ok..I just want to know your complete plan then. Is that only switch on the heater 3 times daily at the mentioned time nothing else. You will know look at the temperature or anything!
In that case it's just a timer program which is very easy code to write.
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Fri Nov 16, 2012 9:29 pm
by acestu
Hi Enamul,
No I am not bothered about the temp because it is taken care of by a room stat connected to the boiler,
as long as you can change the 3 on - off times in the code easily ie variables, and have the Summer/Winter 1hr button for the Time that is all I need really and I think it will be a good start for beginners on here as it is not to complex and it will give us something to build on if thats ok.
Thanks
Acestu
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Fri Nov 16, 2012 9:58 pm
by Enamul
It's not an issue at all. I will post code asap.
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Fri Nov 16, 2012 10:21 pm
by Enamul
The switch you are planning will be connected to slave not in MIAC. MIAC will only control your heater. You might share with us how you are planning to control heater..I will put one output control in MIAC Q1. That's can be used for switching heater on and off.
The switch need to on/off switch not push switch. It need to be high state in summer time and low state in winter time
Example:
From 29th October to 24th March winter clock normal........SW low state (OFF)
and from 25th March to 28th October summer clock 1 hour forward.....SW high state (ON)
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Fri Nov 16, 2012 10:59 pm
by Enamul
After thinking the issue of daylight saving, I have decided to do that automatically...don't need any switch. Time will change automatically.
BST begins at 1:00 AM GMT on the last Sunday of March and ends at 1:00 AM GMT on the last Sunday of October. In 2012, this period was from 25 March to 28 October. In 2013 it will begin on 31 March and end on 27 October.
I will implement that in code.
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Fri Nov 16, 2012 11:22 pm
by acestu
Thanks Enamul
That would be even better
thanks
Acestu
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Sat Nov 17, 2012 1:14 am
by Enamul
Hi,
Can you please test the program for slave with RTC module? Here daylight saving feature is enabled..
So if you enter date & time in FIRST_TIME likewise..
Code: Select all
//1=SUNDAY,2=MONDAY,3=TUESDAY,4=WEDNESDAY,
//5=THURSDAY,6=FRIDAY,7=SATURDAY
HOUR = 0x3F AND 0x00
MIN = 0x50
SEC = 0x59
DAY = 0x01
DATE = 0x28
MONTH = 0x10
YEAR = 0x12
so that in display Time:00:50:59 and Date:28/10/2012 SUN
At Time:01:00:01 the clock should return to Time:00:00:01
again if you try following
Code: Select all
//1=SUNDAY,2=MONDAY,3=TUESDAY,4=WEDNESDAY,
//5=THURSDAY,6=FRIDAY,7=SATURDAY
HOUR = 0x3F AND 0x00
MIN = 0x50
SEC = 0x59
DAY = 0x01
DATE = 0x25
MONTH = 0x03
YEAR = 0x12
so that in display Time:00:50:59 and Date:25/03/2012 SUN
At Time:01:00:01 the clock should forward to Time:02:00:01
Edit: Stuart send me two link for video of the time change where I have seen the date is changed in time change but it shouldn't be..I think it is because of BCD issue of DS1307 as I am writing decimal value but should write BCD in DS1307..this is fixed now.
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Sat Nov 17, 2012 9:29 am
by acestu
That's Fantastic Enamul,
I will be returning home on Sunday afternoon and will try it as soon as I get in...
Thank you
Acestu
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Sat Nov 17, 2012 9:50 am
by acestu
Hi Enamul,
I have just had a look at the code RTC_MIAC_Final but it will not compile, it cannot find LCD(0) and I am not sure how to or what to change it too.

- DST_error.jpg (85.93 KiB) Viewed 33672 times
Thanks
Acestu
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Sat Nov 17, 2012 11:51 am
by Enamul
Actually I have copied day part from slave where LCD component is normal component but in MIAC I have to use MIAC LCD component..it is sorted now.
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Sat Nov 17, 2012 5:12 pm
by acestu
Thanks Enamul
I will try when I get home
thanks
Acestu
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Sun Nov 18, 2012 5:54 pm
by acestu
Hi Enamul,
I have programmed the Slave and that works fine, before I program the MIAC do I have to set the 3 on - off times somewhere ?
thanks
Acestu
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Sun Nov 18, 2012 5:58 pm
by Enamul
Hi
I haven't add that heater control in MIAC yet. I have just program auto Daylight saving feature in slave and day display in slave and MIAC. Can you test that please and let me know whether DLS works fine or not?
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Sun Nov 18, 2012 7:41 pm
by acestu
Hi Enamul,
I have just finished testing the DST with the 2 different codes and they do what you said they would do, I have video of both test but I don't think I can upload video on here...
Thanks
Acestu
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Sun Nov 18, 2012 7:42 pm
by Enamul
You can upload in youtube..can send link to me.
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Sun Nov 18, 2012 11:13 pm
by Enamul
Hi Stuart,
I have corrected the slave module in the earlier post..Can you please test that and give me some feedback? Video will be great

Here it is stuart...
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Mon Nov 19, 2012 1:07 am
by Enamul
Here is the heater program for your mom. Q1 relay output is used to control heater. You can test for whole day and if you feel that it works ok..then can move to drive original heater.
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Mon Nov 19, 2012 1:45 am
by acestu
Thanks Enamul,
I will test it out tomorrow when I get in from work...
Thanks
Acestu
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Mon Nov 19, 2012 6:25 pm
by Enamul
No problem. Just let me know how it's working.
Re: 24 Hour Heating Timer for RTC MIAC
Posted: Mon Nov 19, 2012 9:49 pm
by acestu
Hi Enamul,
I am just going to test the timer but first I have to change the 16.00 - 23.00 time period to something like 16.00 - 22.00 so that I can test times tonight, is it quite easy to do ?
thanks
Acestu
EDIT Is it something to do with this decision ?
And could you put minutes in ie for eg 22.15 ?