Shop OBEX P1 Docs P2 Docs Learn Events
Counting AC frequency with a BS2 — Parallax Forums

Counting AC frequency with a BS2

roverxroverx Posts: 24
edited 2009-03-05 02:27 in BASIC Stamp
Here we go, I'm looking to get the AC frequency off one of the legs of a 3 phase wind turbine alternator. The goal is to get the RPM of the wind turbine.

I have seen solutions using the LM2917 that end up returning a voltage that I could then pass to an ADC.
http://www.scoraigwind.com/circuits/index.htm

Are there simpler ways to do this using the COUNT/PULSEIN functions

Any Circuit diagrams greatly appreciated

Parameters
Voltage AC on a leg 0 to 25 Volts, current 0 to 60 amps (this is a 12 volt system) Ac is rectifed and then fed to·12 volt batteries. Approximate frequency 0 to 100 Hz

·

Comments

  • BeanBean Posts: 8,129
    edited 2009-03-03 22:53
    Roverx,
    Just a resistor and a zener diode is all you should need.
    And COUNT will get you the frequency.

    ·
                                                 22K 
    AC In >------------/\/\/\-----+----> BS2 Pin 
                                  | 
             5.1V Zener Diode     | 
    AC In >---+----|>|------------+ 
              | 
              | 
           BS2 Ground
    


    Bean.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There is a fine line between arrogance and confidence. Make sure you don't cross it...

    ·
  • roverxroverx Posts: 24
    edited 2009-03-03 23:16
    A little concerned about taking one of the legs to the bs2 ground , The BS2 ground and the rectified AC from 3 phases are the same. ·
  • BeanBean Posts: 8,129
    edited 2009-03-03 23:23
    Oh, then you don't want the connection to ground. Just leave it off.


                         22K 
    AC In >------------/\/\/\-----+----> BS2 Pin 
                                  | 
             5.1V Zener Diode     | 
              +----|>|------------+ 
              | 
              | 
           BS2 Ground (common to AC)
    

    · Or you could you a regular diode to the BS2 Vdd (+5V) pin.

                                      Diode
                                  +----|>|------------> BS2 Vdd Pin 
    
                                  |
                         22K      |
    AC In >------------/\/\/\-----+----> BS2 Pin 
                              
    
    



    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There is a fine line between arrogance and confidence. Make sure you don't cross it...



    Post Edited (Bean (Hitt Consulting)) : 3/3/2009 11:36:05 PM GMT
  • roverxroverx Posts: 24
    edited 2009-03-03 23:34
    thanks, , now that may be something to play with
  • BeanBean Posts: 8,129
    edited 2009-03-03 23:37
    Keep the resistor close the to AC connection because it limits the current. So anything before the resistor that shorts will cause bad things to happen. Like flames.

    And you might want to start with a larger resistor value, maybe 100K or 47K and see if that works okay. Use the largest value that works. The 22K will limit the current to 1mA when the voltage is 22V.

    Also PULSIN will give you better resolution with less time, but you'll need to measure the LOW time and HIGH time with seperate PULSIN commands and add the result together to get a period measurement.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There is a fine line between arrogance and confidence. Make sure you don't cross it...



    Post Edited (Bean (Hitt Consulting)) : 3/3/2009 11:42:24 PM GMT
  • roverxroverx Posts: 24
    edited 2009-03-03 23:50
    Thanks again, I have a turbine that happens to be down from the ground for repair that I will use to test , see http://www.rovr1.com/wind/ . I will probably need another BS2 for testing since the BS2PX i have lloggin the system is a bit of a pain to remove.
  • roverxroverx Posts: 24
    edited 2009-03-03 23:55
    Added Not , here is an overview of what I have.. more info on site (posted previously)
    480 x 533 - 28K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-03-03 23:55
    This app cries out for an optoisolator. Here's the circuit I would use:

    attachment.php?attachmentid=59072

    The input resistor limits the zener current and should be selected to match the zener's specs. The zener and the second resistor limit the LED forward current, and the zener limits the LED reverse voltage.

    -Phil
    520 x 220 - 2K
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-03-04 00:20
    Allow me to give a strong second to Phil's suggestion. Isolation is essential for safety. I was going to suggest an isolation transformer, but Phil's idea is cheaper, smaller, more reliable, and more fun.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • BeanBean Posts: 8,129
    edited 2009-03-04 00:23
    Well, I like to live on the edge...

    If it was 120V I'd definately use an opto. But for 25VAC max... I would chance it.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There is a fine line between arrogance and confidence. Make sure you don't cross it...

    ·
  • roverxroverx Posts: 24
    edited 2009-03-04 01:04
    Bean, no offense... but I like the segregation .....Something about tapping AC from DC always messes with my head... unless rectified, Besides adding the noise from the AC to the DC..although minimal might affect my other sensors which are hall effect.

    On the other hand, I also like the direct measuremnt approach as opposed to the proxied measurement through an opto.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-03-04 01:14
    The voltage magnitude is not the issue. What's even more important is what else the generator is connected to. By connecting one leg of the AC output to the BASIC Stamp's Vss, you may inadvertently create an undesired path of conduction through your PC, say, back to something the generator is powering or is otherwise connected to. The consequences could be dire. I would not do this without isolation.

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-03-04 01:20
    roverx said...
    On the other hand, I also like the direct measuremnt approach as opposed to the proxied measurement through an opto.
    Since you'll be measuring frequency instead of an analog voltage, the "proxied measurement" will be equivalent to that obtained from a direct connection. There will, however, be a generator "dropout voltage", below which you won't be measuring any frequency. To minimize this, you can reduce the zener voltage, so long as it's above the LED's forward voltage.

    -Phil
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2009-03-04 03:56
    roverx,

    You said... "I'm looking to get the AC frequency off one of the legs of a 3 phase wind turbine alternator." ... could you use two legs?

    If so, then this circuit with an ordinary 741 Op-Amp would provide a 5V square wave output that would be proportional to the turbine speed.· Then you could read the 5V square wave·directly into a Stamp using the COUNT or PULSIN command.

    Note: ANY two phases will work.

    Edit: The Diodes from the Op-Amp inputs to +5V are optional, the built-in ESD diodes should function here, but for added·robustness you can leave them in the circuit.· With 50V output from the·wind·turbine, these diodes would only see about 450 micro Amps.








    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 3/4/2009 4:27:45 AM GMT
    1103 x 429 - 132K
  • Carl HayesCarl Hayes Posts: 841
    edited 2009-03-04 05:19
    Bean (Hitt Consulting) said...
    Well, I like to live on the edge...

    If it was 120V I'd definately use an opto. But for 25VAC max... I would chance it.

    Bean.

    Well, that does make a difference.· However --

    My father was a career Chief Radioman in the U S Navy.· Once, when he was stationed on USS Saint Paul, a heavy cruiser (temporarily home from the bombardment line in Korea), he took me on a tour.· I was 12 at the time.· He showed me a pair of footprints in a steel deck.· "What's that, Dad?"· He explained that an electrician was drilling through the bulkhead (the hole was still there, but welded up)·and drilled into a large copper bus bar that was carrying 24 volts DC, and that his steel-shank safety shoes had welded themselves to the deck, which was very wet with seawater at the time.· He was dead, a Crispy Critter.

    I've remembered this always.· It's not voltage that kills, it's current.· Isolation is good.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    · -- Carl, nn5i@arrl.net
  • roverxroverx Posts: 24
    edited 2009-03-04 22:02
    Beau Schwabe (Parallax) said...

    roverx,

    You said... "I'm looking to get the AC frequency off one of the legs of a 3 phase wind turbine alternator." ... could you use two legs?

    If so, then this circuit with an ordinary 741 Op-Amp would provide a 5V square wave output that would be proportional to the turbine speed.· Then you could read the 5V square wave·directly into a Stamp using the COUNT or PULSIN command.

    Note: ANY two phases will work.

    Edit: The Diodes from the Op-Amp inputs to +5V are optional, the built-in ESD diodes should function here, but for added·robustness you can leave them in the circuit.· With 50V output from the·wind·turbine, these diodes would only see about 450 micro Amps.

    What·type an size for the two diodes?






  • roverxroverx Posts: 24
    edited 2009-03-04 22:07
    Phil Pilgrim (PhiPi) said...
    This app cries out for an optoisolator. Here's the circuit I would use:

    attachment.php?attachmentid=59072

    The input resistor limits the zener current and should be selected to match the zener's specs. The zener and the second resistor limit the LED forward current, and the zener limits the LED reverse voltage.

    -Phil
    What size and type of opto ... part number would be good
  • roverxroverx Posts: 24
    edited 2009-03-04 22:09
    I'm probably going to try out both the OPto and opAMP routes, thanks for everyones input
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-03-05 00:30
    roverx,

    I'm quite partial to the H11N1 optocoupler. (It uses a powered detector, so it's schematic is a little different from the one in the circuit above.) It has a built-in Schmitt trigger and will respond to an LED current as little as 3.2mA, or possibly less.

    -Phil
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2009-03-05 02:27
    roverx,

    You said ... "What type an size for the two diodes?" - Since the current is so low, just about any germanium diode will work. I'd probably use something like a 1N34A.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
Sign In or Register to comment.