Page 1 of 9

Help with Pump Overrun Timer Please

Posted: Thu Jan 29, 2015 6:49 pm
by acestu
Hi,

I am looking to make a pump overrun timer so that when heating or hot water call stops, the boiling water is not left in the boiler causing kettling,ie I need to run the pump on for say 5 mins, I am not quite sure where to start really.

Thanks in advance
Acestu

Re: Help with Pump Overrun Timer Please

Posted: Thu Jan 29, 2015 7:50 pm
by medelec35
Hi Stu,
The way you can do this is with a timer interrupt (See an example here) and use an opto-coupler like you did with your previous project to control two pumps.

Make sure you know how the interrupt works.
I can then help you further.

Re: Help with Pump Overrun Timer Please

Posted: Fri Jan 30, 2015 10:16 pm
by medelec35
Hi Stu
Hi
acestu wrote:Ok thanks, as well as the timer side of things, I just can't think of how I would do this, as in how do you activate the timer, if you have an input from stat via optocoupler on a pin, you would have to find out when the pin goes low and activate the overrun
The way I would do it is:
When microcontroller i/p connected to opto-coupler output goes low then mains is present, set timer value to 5 mins (not timing yet), set output connected to the pump high .
When microcontroller i/p connected to opto-coupler output goes high start the timing, after five mins elapsed, set output connected to the pump low.

If you give that a try then post what you have done, I can take a look at it for you, and alter flowchart if required.

Re: Help with Pump Overrun Timer Please

Posted: Fri Jan 30, 2015 11:36 pm
by acestu
Hi Martin,

Here is the start of my chart, I haven't got very far.....sorry I'm stuck

Thanks
Stuart
overrun_1.fcfx
(8.77 KiB) Downloaded 409 times

Re: Help with Pump Overrun Timer Please

Posted: Sat Jan 31, 2015 2:11 am
by medelec35
Hi Stuart,
The first thing was your interrupt.
It looks like it was dragged without being altered.
If you select the properties, it was left as Transition on T0CKI pint.
Also the prescaler rate was left at 1:1.
What that means on hardware is every time the T0CKI pin when from high to low, the timer 0 register with increment by one.
When it goes from 255 to 0 i.e it rolls-over then interrupt macro is accessed.
That is not what you want.
I would recommend reading this thread again.

I have modified your flowchart so in theory it should work as a pump over-run.
It's a bit more complex than if just using an electrolytic across the mains output of the opto-coupler.
Reason being if live detected without the cap then there will be 100Hz pulsed waveform (5V peak) at output of the opto-coupler.
the flowchart has to take that in to account.
With the cap, the waveform will be 0V since cap/resistor CR time constant is much lager than mains frequency, so does not have time to charge.
You can greatly cut down components/pin count by using say a 12F1840 configured for internal oscillator.

Martin

Re: Help with Pump Overrun Timer Please

Posted: Sat Jan 31, 2015 3:00 am
by acestu
Hi Martin,

Thanks for the chart, I am just working out how it works now, I will let you know how I go on.

Thanks
Stuart

Re: Help with Pump Overrun Timer Please

Posted: Sun Feb 01, 2015 8:48 pm
by acestu
Hi Martin,

are you saying that it is not as simple as connecting the optocoupler to the mains, ie I need a cap and extra components on the output ?

Thanks
Stuart
opto.jpg
opto.jpg (28.39 KiB) Viewed 21693 times

Re: Help with Pump Overrun Timer Please

Posted: Sun Feb 01, 2015 9:20 pm
by medelec35
Hi Stuart,
acestu wrote:are you saying that it is not as simple as connecting the optocoupler to the mains, ie I need a cap and extra components on the output ?
No, saying the opposite as the Flowchart is a bit more complex, but removes the requirement for extra cap.
Just don't forget the 270k pull up resistor from collector O/P to +5V

For me that was more reliable than enabling weak pull-ups.
But I did not have the improved (untested )method I created in your flowchart.
I will test it myself when I get a chance.

Martin

Re: Help with Pump Overrun Timer Please

Posted: Sun Feb 01, 2015 9:48 pm
by acestu
Hi Martin,

As per this pic , resistor on the opto output to +5v ?

EDIT Where does the emitter connect to ?
opto2.jpg
opto2.jpg (45.93 KiB) Viewed 21686 times

Thanks
Stuart

Re: Help with Pump Overrun Timer Please

Posted: Sun Feb 01, 2015 10:36 pm
by medelec35
The emitter connects to GND of 5V supply.
how it works in a simplified version:
With no voltage on the i/p of opto-coupler then between the C & E acts like an o/c switch, allowing the i/p of microcontroller to rise to +5V
If a voltge diffence on the i/p high enough then C & E acts like a closed switch, pulling the i/p of microcontroller down,

Re: Help with Pump Overrun Timer Please

Posted: Sun Feb 01, 2015 10:48 pm
by acestu
Hi Martin,

Thanks I have got it now.

Stuart

Re: Help with Pump Overrun Timer Please

Posted: Tue Feb 03, 2015 12:21 am
by acestu
Hi Martin,

I was wondering if you know how to supply your 5 volts on board the pcb transformerless, ie big resistor and caps ?

Thanks
Acestu

Re: Help with Pump Overrun Timer Please

Posted: Tue Feb 03, 2015 9:27 pm
by Steve001
acestu wrote: I was wondering if you know how to supply your 5 volts on board the pcb transformerless, ie big resistor and caps ?
I would not recommend this route as there is a increased electric shock risk

A double wound transformer is the way to go , have a look at ( Or similar )

http://uk.farnell.com/myrra/44230/trans ... dp/1689080

Steve

Re: Help with Pump Overrun Timer Please

Posted: Tue Feb 03, 2015 10:48 pm
by acestu
Hi Steve,

Thanks for the info, I am aware of safe isolation with the tranny, I was just wondering if technology had moved on a bit and there was another way of doing it, because it is ages since I put a board together, oh well it looks like it's gonna be the old tranny.

cheers
Stuart


EDIT

Why the double wound Steve ?

Re: Help with Pump Overrun Timer Please

Posted: Wed Feb 04, 2015 9:44 pm
by Steve001
Stuart

Please see attached various transformer types and connection diagrams

Double wound means 2 windings I.E Primary and a Secondary winding

Where as a Auto type is a single winding

A transformer would be a safer solution and you would have a lot less losses in the circuit a resistor divider and a Linear regulator would dissipate around 23W in heat maybe more,

a small transformer like the example will have a low load loss and iron loss resulting in lower heat dissipation


Steve

Re: Help with Pump Overrun Timer Please

Posted: Thu Feb 05, 2015 12:30 pm
by medelec35
Hi guys,
I personally would use this:
http://uk.farnell.com/vigortronix/vtx-2 ... dp/2401030
(I have used the 12V version and its works really well and stays cooler than a transformer).
Its physically smaller than a transformer:
AC to DC converter.png
(71.16 KiB) Downloaded 15760 times
But it's so much better, and can supply 600mA.
All you do is supply mains in, then you get isolated 5V dc out.
No need for any caps, diodes, or voltage regulators.
Farnell are not the cheapest but at £4.99 for 1, considering you eliminate all the mentioned components including a transformer, I believe its good value for money.

Re: Help with Pump Overrun Timer Please

Posted: Thu Feb 05, 2015 7:50 pm
by Steve001
Cheers for that martin .

Works at 120 Vdc too :D :D :D

Steve

Re: Help with Pump Overrun Timer Please

Posted: Thu Feb 05, 2015 11:31 pm
by medelec35
Your welcome Steve.
Steve001 wrote:Works at 120 Vdc too
Indeed it does.
I guess the input is rectified then chopped, hence allowing: Input: 90 - 265VAC , 47 - 63Hz (100 - 370VDC)

Martin

Re: Help with Pump Overrun Timer Please

Posted: Mon Feb 09, 2015 7:15 pm
by acestu
Hi Martin, Steve,

Yes that's just the job, I had a feeling that there was something like this available, I think somebody told me about these a while back but I don't think I was paying too much attention :oops:




Thanks again
Stuart

Re: Help with Pump Overrun Timer Please

Posted: Mon Feb 09, 2015 7:21 pm
by acestu
Hi Steve,

I thought you were saying use a transformer with a 230v primary and 2 x 6volt secondaries , what I was wondering was why the 2 secondaries but I think I missunderstood you

cheers
Stuart

Re: Help with Pump Overrun Timer Please

Posted: Mon Feb 09, 2015 7:43 pm
by acestu
Hi,

I have just added an lcd which shows if the overrun is on or off, it works in simulation, do I need to add anything else ?

Thanks
Stuart
overrun_3.fcfx
(12.66 KiB) Downloaded 307 times

Re: Help with Pump Overrun Timer Please

Posted: Mon Feb 09, 2015 9:39 pm
by medelec35
Hi Stuart,
I have modified the flowchart to display a countdown timer only when pump overrun is active.
Timer does not count if pump is on because of A0 i/p being low.

Simulation is not as good as on real hardware, as I believe there should ideally be a few simulation speeds between 50Hz & normal.

Martin

Re: Help with Pump Overrun Timer Please

Posted: Mon Feb 09, 2015 11:12 pm
by acestu
Hi Martin,

That's great thanks, even better.....


cheers
Stuart

Re: Help with Pump Overrun Timer Please

Posted: Sun Feb 22, 2015 5:06 pm
by medelec35
Hi Stuart,
Sorry Missed this post.
acestu wrote:That's great thanks, even better...
You're welcome, glad it helps.
From pm:
acestu wrote:I assume that they are regulated etc (no other components needed),
You assume correct.
I used these with no other caps etc.
They are fully regulated.
acestu wrote:I was wondering if you know of any good Pic deals at the moment that would do for this and other projects....?..
Thanks
Stuart
I will keep my eye out, but not PIC's I have spotted this
I'm always wary when prices are that cheap, but since they accept paypal I have ordered some bits anyway.
I will post if they get delivered or not.

Martin

Re: Help with Pump Overrun Timer Please

Posted: Sun Feb 22, 2015 10:10 pm
by acestu
Hi Martin, I thought you might of known of a regularly available reasonably priced pic that would do for this project rather than the battleship sized 16f877a , which takes a lot of pcb room up.

cheers
Stuart