Help with Pump Overrun Timer Please

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Help with Pump Overrun Timer Please

Postby acestu » Thu Jan 29, 2015 6:49 pm

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
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.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8440
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2412 times
Been thanked: 3450 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby medelec35 » Thu Jan 29, 2015 7:50 pm

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.
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8440
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2412 times
Been thanked: 3450 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby medelec35 » Fri Jan 30, 2015 10:16 pm

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.
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby acestu » Fri Jan 30, 2015 11:36 pm

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 209 times
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.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8440
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2412 times
Been thanked: 3450 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby medelec35 » Sat Jan 31, 2015 2:11 am

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
Attachments
overrun_2.fcfx
(10.77 KiB) Downloaded 192 times
These users thanked the author medelec35 for the post:
acestu (Sat Jan 31, 2015 3:00 am)
Rating: 5.26%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby acestu » Sat Jan 31, 2015 3:00 am

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
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.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby acestu » Sun Feb 01, 2015 8:48 pm

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 13916 times
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.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8440
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2412 times
Been thanked: 3450 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby medelec35 » Sun Feb 01, 2015 9:20 pm

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
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby acestu » Sun Feb 01, 2015 9:48 pm

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 13909 times



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.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8440
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2412 times
Been thanked: 3450 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby medelec35 » Sun Feb 01, 2015 10:36 pm

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,
These users thanked the author medelec35 for the post:
acestu (Sun Feb 01, 2015 10:49 pm)
Rating: 5.26%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby acestu » Sun Feb 01, 2015 10:48 pm

Hi Martin,

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.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby acestu » Tue Feb 03, 2015 12:21 am

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
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.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1086
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 440 times
Been thanked: 492 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby Steve001 » Tue Feb 03, 2015 9:27 pm

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
These users thanked the author Steve001 for the post:
acestu (Tue Feb 03, 2015 10:48 pm)
Rating: 5.26%
 
Success always occurs in private and failure in full view.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby acestu » Tue Feb 03, 2015 10:48 pm

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 ?
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.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1086
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 440 times
Been thanked: 492 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby Steve001 » Wed Feb 04, 2015 9:44 pm

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
Attachments
transformer types.jpg
transformer types.jpg (79.52 KiB) Viewed 13841 times
These users thanked the author Steve001 for the post:
acestu (Mon Feb 09, 2015 7:16 pm)
Rating: 5.26%
 
Success always occurs in private and failure in full view.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8440
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2412 times
Been thanked: 3450 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby medelec35 » Thu Feb 05, 2015 12:30 pm

Hi guys,
I personally would use this:
http://uk.farnell.com/vigortronix/vtx-214-003-105/ac-dc-conv-fixed-1-o-p-3w-5v/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
AC to DC converter.png (71.16 KiB) Viewed 13832 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.
These users thanked the author medelec35 for the post (total 2):
Steve001 (Thu Feb 05, 2015 7:49 pm) • acestu (Mon Feb 09, 2015 7:09 pm)
Rating: 10.53%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1086
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 440 times
Been thanked: 492 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby Steve001 » Thu Feb 05, 2015 7:50 pm

Cheers for that martin .

Works at 120 Vdc too :D :D :D

Steve
Success always occurs in private and failure in full view.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8440
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2412 times
Been thanked: 3450 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby medelec35 » Thu Feb 05, 2015 11:31 pm

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
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby acestu » Mon Feb 09, 2015 7:15 pm

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
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.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby acestu » Mon Feb 09, 2015 7:21 pm

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
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.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby acestu » Mon Feb 09, 2015 7:43 pm

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 174 times
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.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8440
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2412 times
Been thanked: 3450 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby medelec35 » Mon Feb 09, 2015 9:39 pm

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
Attachments
overrun_4.fcfx
(16.08 KiB) Downloaded 151 times
These users thanked the author medelec35 for the post:
acestu (Mon Feb 09, 2015 11:11 pm)
Rating: 5.26%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby acestu » Mon Feb 09, 2015 11:12 pm

Hi Martin,

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.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 8440
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2412 times
Been thanked: 3450 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby medelec35 » Sun Feb 22, 2015 5:06 pm

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
These users thanked the author medelec35 for the post:
acestu (Sun Feb 22, 2015 10:10 pm)
Rating: 5.26%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 787 times
Been thanked: 226 times
Contact:

Re: Help with Pump Overrun Timer Please

Postby acestu » Sun Feb 22, 2015 10:10 pm

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
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.