What's the cheapest way to switch a relay by frequency of pulsed DC? - Page 1
Forum section: electronics / projects

author: eKretz
author_rank: Frequent Contributor
timestamp: August 01, 2017, 12:58:58 pm
content: Hiya fellas,I just started working on a project, installing a tankless water heater to replace our dead storage tank version. I installed a recirculation loop for instant hot water at the faucets but I don't want to leave it running all the time (or even on a timer) and waste the electricity and gas. It also requires a fairly decent flow to turn the heat on. The manual claims 0.4 GPM but it's actually taking more like a bit over 1 GPM by my testing.Anyway, I hooked up my scope to the water sensor to see how it works, and it runs a turbine with the wires coming out to sense water flow - 12.5VDC is supplied to the sensor and it sends out a pulse train depending on the speed of the water flow. The pulse is from 0 VDC to ~11.8VDC, and frequency runs from about 6Hz at the flow rate where I'd like to switch the circulation pump on to about 120Hz at full water flow.My idea is to use the output from the sensor to switch a relay that turns on the circulation pump, basically turning on the circulation loop and activating the heater as soon as there's any demand for hot water. Am I going to need a microcontroller for this? Haven't played with those much. Any simple, easy ways that I'm not thinking of?

author: Ian.M
author_rank: Super Contributor
timestamp: August 01, 2017, 02:11:43 pm
content: 555 missing pulse detector feeding a second 555 (or the other half of a 556) to get a steady state when the pulse train is too slow. Seehttp://home.cogeco.ca/~rpaisley4/LM555a.html#22However, you may want to use an Arduino or other MCU as that makes it *MUCH* easier to add extra features like return pipe temperature monitoring, or PIR motion sensors to pre-trigger the recirculation loop pump for true instant hot water.

author: danadak
author_rank: Super Contributor
timestamp: August 01, 2017, 11:25:43 pm
content: Consider an Arduino running BASCOM-AVR, very easy to code as its in Basiclanguage. Free version of BASCOM more than enough to do this job. Tonsof videos on youtube for training.The input to Arduino should be a V divider to limit pulse amplitudeto <= Vdd of Arduino. A divider with proper value 1 - 10K ohm Rsadequate. Maybe add a zener to ground at the pin for additionalprotection.http://www.bipom.com/products/us/1427.htmlAn alternative is to use PSOC 4 family. 4200 familiy part for starters.It has way more capabilities that could be exploited as you enhanceyour solution over time or do new more complicated design likeimplementing a PID control loop to get optimized control over system.Programs in C or assembler (stick with C). Software (Creator) free,drag and drop GUI configurator with lots of prewritten APIs you callto control the HW. Lots of fun.Regards, Dana.

author: David Hess
author_rank: Super Contributor
timestamp: August 02, 2017, 12:54:37 am
content: I might use a charge pump to drive a voltage comparator. Charge pumps are a simple frequency to voltage converter and were commonly used with speedometers and tachometers in vehicles at one point. If the source impedance is low enough, then charge pump can be made with 2 capacitors, 2 diodes, and one resistor.

author: eKretz
author_rank: Frequent Contributor
timestamp: August 02, 2017, 03:44:57 am
content: Thanks guys! The charge pump is a very good idea. Forgot about those. I like the missing pulse detector also - that might be better in this case because as far as I can tell the voltage is actually pulsed off rather than on. (No flow = 11.8VDC, and once flow starts it is pulsed off and on). It could be that the sensor just happened to stop in a certain place every time though I guess. Wish I could get to it to see any numbers and look it up.I don't need any temperature sensing or any of that, all of that is taken care of by the heater - it varies the burner intensity or even shuts it off based on the water temperature. My main concern is keeping the heater on when the water is running at a lower flow rate - right now it tends to shut off at low flow and we end up with cold water coming out of the hot water tap. The circulation pump solves that problem entirely by increasing the flow through the heater to a point that it fires right up - so if I can get the missing pulse detector to activate a relay that fires the pump at a much lower flow rate I will be happy. That will trick the heater into thinking the water is running faster than it is and activate the burner. The circulation loop is not very long so the pump pushing the water through the heater heats it up almost instantly, at which point the burner will be varied or even turned off to suit the water demand.