Connect with us

Count 15kV pulses using PIC

Discussion in 'Electronic Basics' started by ChadMan, Jul 13, 2005.

Scroll to continue with content
  1. ChadMan

    ChadMan Guest

    I have a PIC counting pulses. I know the software is working. I need to
    knock a 15kV spike down to 5 volts to be counted by my PIC. The spark is
    20hz for a count of 200 pulses. I need to monitor it and make sure it is
    sparking every time. I tried a MPSA350 with a 5.1 volt Zener in parrallel to
    no avail. Too much noise. The PIC gets flakey. Can anyone point me to a
    circuit or give me a hint on how to tame this spark?

  2. Are you needing to count voltage pulses, or sparks.

    If just voltage, I might use a high voltage divider, something like
    100 Meg and 100k, with a 4.8 volt zener and a small Schottky diode
    across the 100k. Finding a 100 Meg resistor rated for repeated 15kV
    pulses is the hard part. These might work: Data/Slim Mox.pdf
  3. ChadMan

    ChadMan Guest

    Hopefully I have a fixed width font.....

    Spark gap
    ---->spark source>------| |-----/\/\/\/----+---/\/\/\/---+---->to pic pin

    Was thinking along these lines but it is not working well. Noise befuddles
    my Pic. Should I do away with the gap maybe?
    My pic drives a relay that switches Variac output to 120VAC spark circuit
    ( I can drive the line voltage higher
    if I want). The spark circuit is a pic square wave @ 20 hz drive an scr thru
    coil primary. Secondary sparks.
    Need to count actual sparks to make sure nothing is missing any beats for
  4. If I understand your drawing, you are measuring the current from the
    spark. The really important part of that sort of scheme is to have a
    clean current path back to the coil secondary that does not take the
    spark current past any other parts of the circuit.

    The spark will also ring both directions, so you have to make sure
    that the PIC does not see any negative voltage (or at least, nothing
    more negative than a couple tenths of a volt).

    I don't see what the resistors do, except, possibly to damp ringing.

    I think I would pass the spark current through a zener (perhaps a 15
    volt zener) in parallel with a small capacitor, and then divide the
    zener voltage by 4 with a pair of resistors, to produce the PIC input,
    so that the negative swings that forward bias the zener will produce
    only a fourth of a forward biased diode voltage at the PIC. Use a
    Schmitt trigger input and noise debounce the signal with software.

    Are you sure the step up transformer is phased to output a positive pulse?

    The PIC will have to be tightly laid out (crystal well shielded, if
    used) and all other input traces short or shielded. This especially
    applies to the MCLR input. Good supply bypassing is also needed, and
    the SCR primary loop should be separately bypassed, to keep all that
    noise local to that loop.
  5. John Popelish wrote:

    One other idea. You may be able to use the (excessive) duration of
    the spark current to infer that the spark gap is shorted.
  6. JeffM

    JeffM Guest

  7. Tom Biasi

    Tom Biasi Guest

    If its the spark's reliability that concerns you why not monitor the sparks
    light with a UV sensor. Easier to keep the nasties out of the pic.
  8. mike

    mike Guest

    Sparks are very nasty to measure as the radiation gets into everything.
    Unhook the sense lead at the spark gap, but leave the rest of the wire
    positioned. What does your pic measure then? If it's not zero, work on
    shielding until it is. Then stick a 21 hz signal directly into the pic
    and fire off the sparks. Work on that until you get a steady 21hz
    measurement. Now, you're ready to go back to working on the spark
    attenuation problem.
    You know the frequency, so sense the first transition then ignore
    everything else until just before time for the next one. That will save
    you a lot of grief. When all else fails, fix it in software.

    Return address is VALID but some sites block emails
    with links. Delete this sig when replying.
    Wanted, PCMCIA SCSI Card for HP m820 CDRW.
    FS 500MHz Tek DSOscilloscope TDS540 Make Offer
    Wanted 12" LCD for Compaq Armada 7770MT.
    Bunch of stuff For Sale and Wanted at the link below.
  9. James Beck

    James Beck Guest

    How about an inductive pickup with a little signal conditioning?
    I would have a problem with any kind of direct connection of 15KV to an
    MCU no matter how well the divider looks on paper. Something along the
    lines of coil pickup (isolation acheived here), amplification (may not
    be needed if signal is big enough, some type of clipping if it is too
    big) ,low pass filtering, MCU pin.

  10. Jeff Thon

    Jeff Thon Guest

    Use an opto-transistor. Choose the opto input LED currrent limit resistor to
    handle the max peak voltage and the power dissipation it will see and select
    the resistance for the nominal operating current of the LED. It may take
    several resistors in series to accomplish this. As an example, if the LED
    current required is 10mA then R=V/I=15000/.01=1.5M?. The output transistor
    can be configure as an open collector NPN with a pullup resistor to your PIC
    input pin. If you keep the input of the opto connected only to the spark
    circuit you will have a good degree of isolation from the PIC circuit.
  11. Bob Eldred

    Bob Eldred Guest

    First, the PIC and any other 5 volt circuitry needs to be isolated and
    shielded from the spark, spark leads, spark coil, capacitors, charging
    resistors, SCR's or any other circuitry associated with the discharge. All
    of this stuff radiates EMR when the spark fires. Secondly, the spark may not
    be a single pulse but may oscillate many times as the discharge progresses.
    Depending on how the PIC is programmed, it may multiply trigger on each
    discharge. Be sure the code can't interrupt or poll the port in quick
    succession causing erratic behavior. In other words run time delays to
    insure single pulse triggering.

    A number of ways have been mentioned to pick up the pulse including resistor
    dividers, optical, etc. Any of these can be made to work if they are done
    properly. One method you may try is a current transformer to sense the spark
    current made by running one of spark leads through a small ferrite torroid
    core. On this core wind a secondary of 100 turns more or less of fine wire.
    Load this winding with a resistor, capacitor and zener and use it to feed
    the PIC port. The advantage of this method is that it does not load the
    spark as a divider scheme might plus its low impedance makes it less
    vulnerable to interference and EMR, furthermore, it can easily and safely
    isolate the HV from the PIC.
  12. Jamie

    Jamie Guest

    because of slowness in the Zener, it may not be a good idea
    to be using that as a suppresser.
    also you are truncating and most likely causing a
    capacitive build up which is most likely making you
    miss some counts.
    i would try a current transformer to detect the
    spark when it discharges. simply tailor the output with
    a shunt resistor to keep the output down.
    you could also look into TVS diodes. (Transient Voltage suppresser)
    they are much faster than a zener.
  13. ChadMan

    ChadMan Guest

    Thanks to all who replied. I appreciate it very much. I tried several things

    I managed to tame the spark pretty well with a 1meg | 1K | Zener divider.
    Now I get a ringing in the pulse right after the rise, and another right
    after the fall of the pulse.

    Is that because of capacitance in the coil making it behave kind of like a
    tank circuit does?

    I will put a picture on my website later if I can't figure it out.

    My tester counts 200 pulses which is what I expect. Sometimes it counts 204
    or so. I think it's because of this ringing in the coil. Have a .1 cap and a
    1k resistor before the pic. I am going to fiddle with these values. I think
    I need to put the 1k before the cap on the way to the pic like a low pass?
    Anyways, if I get the filter values right, it should dampen the ringing in
    the pulse from the coil I think.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day