I need to implement a frequency counter (pulses per minute) of a DC circuit that goes up to 20 volts. A little background, I am building a linear power supply 0-20 volts, 0-3 amps for my relative who is a tattoo artist. He wants me to help him build the supply but he has the need to know what frequency the tattoo machine (just a basic doorbell circuit) is operating at. His specialty tattoo machine power supply has this feature and I guess it's helpful for something.

I have found several schematics for DIY frequency counters, I really like the Weeder Tech auto-ranging unit but I cannot figure out a reliable way to interface one with a DC power supply. I have looked into preamp circuits for low voltage signals, but that still presents a question about feeding it up to 20 volts. I am quite certain the full 20 volts will fry the IC's, and honestly I am uncertain if it'll even measure DC pulses because of the capacitors in the signal path of the frequency counter. I have looked into Hall effect current sensors, Zener diodes, voltage dividers and all of that, but I'm lost as to how to simply count how many times a second the circuit is closed by the machine and providing current. I just need a low cost reliable way of making a 0-20 volt DC circuit a logic level signal. Even if it was as simple as an IC or op amp that would go high when any current is flowing, that would seem perfect.

I know this is a rather odd request as usually only AC is interesting frequency wise, but really appreciate any help in finding a solution to this one.

link|improve this question
Is it correct, the supply will provide a constant 20 V, but the machine will need current in pulses several times per second? Do you know about how much current is drawn during a pulse, and how much during the "off" time? Do you know the rough range of frequency you need to measure? – The Photon Jan 4 at 5:30
@ThePhoton: I'm not sure what tdx means by "doorbell circuit", but I think of a device similar to this one: horst-ries.de/Sites/hobby/Elektrisches/Funkeninduktor/Images/… (basically a electrical magnet which attracts a lever and opens an electrical contact this way switching itself off and allowing the lever to swing back and close the circuit. In german this device is know as a "Wagnerscher Hammer". The current would be all over the place, since an inductance is switched several times per second. – 0x6d64 Jan 4 at 10:42
If something is DC then there are no pulses and the frequency is 0. If you are using a linear power supply, I am not sure where the pulses would come from. What am I missing? – Kellenjb Jan 4 at 14:24
@Kellenjb: If the device is similar to the one linked in my comment above then it will switch a coil repeatedly on and off with a frequency depending on the mechanical properties of a oscillating lever. – 0x6d64 Jan 4 at 15:35
The power supply is linear, however the load uses electromagnets with points to make and break the connection. This will be happening between 50 - 200 times per minute, and varies by the individual machine attached. I'm wanting to capture how many times per minute current flow starts and stops. – tdx Jan 4 at 15:42
show 2 more comments
feedback

2 Answers

Maxim has an app note showing how to use their high-side current sensor parts. They also show a basic op-amp circuit as the "traditional" way to do this measurement, and this is probably good enough for your application:

Current monitor circuit

The output from this circuit could be run to a comparator to generate a digital '1' whenever the pulse is "on" and a '0' when the pulse is off. Some low-pass filtering may be required between the sensor circuit and the comparator if there is bounce or noise during the on and off transitions of the current pulse.

Then you have some choices.

In a simple digital logic solution, using probably a fairly modest CPLD, the digital pulse could clock a counter. The size (number of bits) of the counter depends on the maximum frequency you want to measure. A clock circuit would be needed to generate a pulse every 7.5 seconds. The 7.5-second pulse would be used to latch the counter output into a second register, while simultaneously resetting the counter. Some additional refinement would be desirable to avoid latching the counter output while it is the middle of rippling up the result of a newly arrived pulse from the comparator. The latched register, multiplied by 8 (left shifted by 3) would give the pulses-per-minute in the previous 7.5 second interval.

The digital pulse could be input to a microcontroller to count pulses and output how many pulses were seen in the past 7.5 seconds (multiplied by 8 to get pulses per minute). Or, count how many seconds are needed before you receive maybe 10 pulses from the comparator. The micro is more flexible than the CPLD in terms of letting you vary the counting interval depending on the actual frequency, averaging over multiple periods to get a smoother display, being able to change the units of the display, etc., etc.

How you display the output is up to you.

link|improve this answer
An opamp is something I looked at but the current sensing amplifier is also interesting and might be a possible solution. However if I need to be able to measure a circuit that will supply up to 20 volts and 3 amps that would mean I need a current sense resistor that can handle 60 watts correct? – tdx Jan 4 at 15:45
@tdx: No. Your sense resistor will have a voltage drop of far less than 20V (if the voltage drop over the sense resistor gets to high, it influences the operation of the circuit which it is supposed to measure). Sense resistors usually have a voltage drop of a few mV, and therefore an opamp is needed to amplify the output to a usable level. Have a look at the app note from maxim (link in The Photon's post), it contains a few words about "Considerations When Selecting Rsense". – 0x6d64 Jan 4 at 15:58
That makes sense. And actually the power supply I'm building will have a 0.47R 10w resistor on the ground that it uses for its own voltage and current reference & regulation, it would be just as well to use that for a low-side current amplifier correct? The voltmeter I'm integrating uses that resistor, so it shouldn't be a problem tacking on current sense opamp should it? – tdx Jan 4 at 19:02
If all the current from the load flows through the .47 Ohm resistor, and no other current does (or any other current is much smaller), then you should be able to use this as a sense resistor also. Beware, though, of adding extra capacitance on the feedback node of a linear regulator. If you're not sure, please post a schematic, because I'm not entirely clear how your .47 Ohm resistor is connected. – The Photon Jan 4 at 22:11
Here is the schematic for the power supply. R7 at the bottom right on the ground is the .47R current sense resistor for the power supply. I am also going to add a AVR based volt/ammeter which was designed with this power power supply in mind and shares the current sense resistor for itself, but I don't believe there should be much added capacitance as the only a few resistors lie between the power supply output and the AVR IC. – tdx Jan 5 at 0:26
show 1 more comment
feedback

If you only need to measure the frequency a couple of times, I would recommend using an oscilloscope rather than a frequency counter. Odds are that you have one (or can borrow one), and it doesn't require you to build or buy any special circuit that is only useful for one thing.

Alternatively, some higher end digital multimeters have a frequency mode.

But let's say that you really do need a dedicated frequency meter. In that case, I still suggest starting out with an o-scope. Look at the signal you want to measure, then take a picture or screen capture. Post that picture here, along with a link to the frequency counter that you want to use, and then we'll be able to help you with interfacing the two.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.