Help with Pump Overrun Timer Please
Moderator: Benj
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Help with Pump Overrun Timer Please
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
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
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Help with Pump Overrun Timer Please
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.
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.
Martin
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Help with Pump Overrun Timer Please
Hi Stu
Hi
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.
Hi
The way I would do it is: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
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.
Martin
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Help with Pump Overrun Timer Please
Hi Martin,
Here is the start of my chart, I haven't got very far.....sorry I'm stuck
Thanks
Stuart
Here is the start of my chart, I haven't got very far.....sorry I'm stuck
Thanks
Stuart
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Help with Pump Overrun Timer Please
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
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
- Attachments
-
- overrun_2.fcfx
- (10.77 KiB) Downloaded 385 times
Martin
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Help with Pump Overrun Timer Please
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
Thanks for the chart, I am just working out how it works now, I will let you know how I go on.
Thanks
Stuart
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Help with Pump Overrun Timer Please
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
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
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Help with Pump Overrun Timer Please
Hi Stuart,
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
No, saying the opposite as the Flowchart is a bit more complex, but removes the requirement for extra cap.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 ?
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
Martin
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Help with Pump Overrun Timer Please
Hi Martin,
As per this pic , resistor on the opto output to +5v ?
EDIT Where does the emitter connect to ?
Thanks
Stuart
As per this pic , resistor on the opto output to +5v ?
EDIT Where does the emitter connect to ?
Thanks
Stuart
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Help with Pump Overrun Timer Please
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,
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,
Martin
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Help with Pump Overrun Timer Please
Hi Martin,
Thanks I have got it now.
Stuart
Thanks I have got it now.
Stuart
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Help with Pump Overrun Timer Please
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
I was wondering if you know how to supply your 5 volts on board the pcb transformerless, ie big resistor and caps ?
Thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- Steve001
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
- Contact:
Re: Help with Pump Overrun Timer Please
I would not recommend this route as there is a increased electric shock riskacestu wrote: I was wondering if you know how to supply your 5 volts on board the pcb transformerless, ie big resistor and caps ?
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
Success always occurs in private and failure in full view.
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Help with Pump Overrun Timer Please
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 ?
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 ?
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- Steve001
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
- Contact:
Re: Help with Pump Overrun Timer Please
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
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
- Attachments
-
- transformer types.jpg (79.52 KiB) Viewed 21658 times
Success always occurs in private and failure in full view.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Help with Pump Overrun Timer Please
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: 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.
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: 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.
Martin
- Steve001
- Valued Contributor
- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
- Contact:
Re: Help with Pump Overrun Timer Please
Cheers for that martin .
Works at 120 Vdc too
Steve
Works at 120 Vdc too
Steve
Success always occurs in private and failure in full view.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Help with Pump Overrun Timer Please
Your welcome Steve.
I guess the input is rectified then chopped, hence allowing: Input: 90 - 265VAC , 47 - 63Hz (100 - 370VDC)
Martin
Indeed it does.Steve001 wrote:Works at 120 Vdc too
I guess the input is rectified then chopped, hence allowing: Input: 90 - 265VAC , 47 - 63Hz (100 - 370VDC)
Martin
Martin
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Help with Pump Overrun Timer Please
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
Thanks again
Stuart
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
Thanks again
Stuart
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Help with Pump Overrun Timer Please
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
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
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Help with Pump Overrun Timer Please
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
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
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Help with Pump Overrun Timer Please
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
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
- Attachments
-
- overrun_4.fcfx
- (16.08 KiB) Downloaded 263 times
Martin
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Help with Pump Overrun Timer Please
Hi Martin,
That's great thanks, even better.....
cheers
Stuart
That's great thanks, even better.....
cheers
Stuart
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Help with Pump Overrun Timer Please
Hi Stuart,
Sorry Missed this post.
From pm:
I used these with no other caps etc.
They are fully regulated.
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
Sorry Missed this post.
You're welcome, glad it helps.acestu wrote:That's great thanks, even better...
From pm:
You assume correct.acestu wrote:I assume that they are regulated etc (no other components needed),
I used these with no other caps etc.
They are fully regulated.
I will keep my eye out, but not PIC's I have spotted thisacestu 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'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
Martin
- acestu
- Posts: 1720
- Joined: Thu Dec 01, 2011 9:36 pm
- Location: Macclesfield UK
- Has thanked: 783 times
- Been thanked: 223 times
- Contact:
Re: Help with Pump Overrun Timer Please
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
cheers
Stuart
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.
Computers are like air conditioners. They work fine until you start opening windows.