Web programmable 7-day timeswitch

matherp

Senior Member
This is another program using the tlg13ua06 (tln13ua06) wifi-uart. I have to confess I'm pretty pleased with this one :)

This is a 7-day digital timeswitch which uses one of the very accurate DS3231 battery backed clock modules.

The only local control is an override switch which when the unit is in auto mode will toggle the output status.

The circuit uses one of the Vigortronix modular 240V to 5V DC power supplies (available for about £5.00 from rapidonline).
This is used to power a ALE1PB05 16A 240VAC rated relay switched by a 2N2222. A TC1262 then steps the 5V down to 3.3V to power the picaxe 20X2, clock, and the wifiuart.

The PCB is designed to be very flexible and supports both pic and picaxe, DC or AC power, configurable I/O with optional pull-ups, series resistors or single pole filters etc. A circuit diagram and gerbers are included in the next post together with the basic code.

For the next few days you can play with the prototype on http://matherp.dyndns.org:50000. The code is 123456

The top panel allows you to change the day and time (seconds are zeroed) and switch between on/off and auto modes. Switching mode only does not update the time. Make sure the security code is set to 123456, and click the "update" checkbox to make the change

The main panel allows up to 3 sets of on/off times to be programmed. For each day the radio button can select one of the times to be changed or left on "skip" to make no change on that day. Then when the time is input and the "set" checkbox ticked the selected times will be updated. All times are stored in eeprom. So to change the first "on" time for every day to 08:00 select the first radio button in each row, set 08:00 in the bottom time entry field, make sure the security code is set to 123456, and click the "set" checkbox. The "OK " column confirms consistency of the times (start1 <=end1 <=start2 <=end2 <=start3<= end3). Operation of the timeswitch is inconsistent if the data is incorrect.

Changing the on/off times or the clock will not change the output until the next on/off time is reached. However, the output can be set to the desired state by using the local override button or the on/off mode before setting the mode back to auto.

Chrome will show up/down scrolls for the time (HTML5 feature), IE will not, I haven't tried firefox.

The code doesn't seem very big but uses nearly all the program space in the 20X2. Serout commands seem to use huge amounts of program space.

The wifiuart is programmed as a TCP server with 38400 baud communication. The box is custom 3D printed - I forgot the holes for the LED and switch in the lid but a quick edit and reprint will soon solve that:)

All questions or comments appreciated
 

Attachments

Last edited:

lbenson

Senior Member
Nice project. Everything looks very snug in that box.

Is this a heater that is being switched?
 

matherp

Senior Member
The first use is for the filtration for a swimming pool at a friend's holiday home. As the pool and air temperature increases it is important to increase the amount of filtration to avoid green water. This application allows the filtration times to be controlled remotely.
 
Top