element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Help. I need the reverse of zero crossing
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 7 replies
  • Answers 4 answers
  • Subscribers 391 subscribers
  • Views 1110 views
  • Users 0 members are here
  • inrush
  • programing
  • arduino
Related

Help. I need the reverse of zero crossing

phoenixcomm
phoenixcomm over 6 years ago

Ok, I need some hunk of code to detect the peek not the zero crossing. ( this is the solution).

Problem: Toroid based power supply have inrush current problems. As when you turn on the power switch,

it is a random chance where on the sine wave it will be.

You can not start this a zero crossing as that is the Imax and will blow your fuse. image

This solution must be only a primary side problem. I was thinking of a relay but a small triac is much faster.

Thanks

Cris

  • Sign in to reply
  • Cancel

Top Replies

  • michaelkellett
    michaelkellett over 6 years ago +3 suggested
    Why do you need code - the simplest trick is to use an NTC current limiter. These people have a lovely web site: https://www.ametherm.com/ If you have to do it in code it might be easier to detect zero…
  • abrain
    abrain over 6 years ago in reply to phoenixcomm +3 verified
    Yes, sorry Cris, I don’t think I explained it very well. If you’re measuring the voltage (which I think you must be to find the zero crossing) then work out how much that voltage changed from the last…
  • phoenixcomm
    phoenixcomm over 6 years ago in reply to michaelkellett +1 suggested
    I have seen current limiters like Ametherms before. But the problem is that I have three toroidal power transformers, and for the first 20ms or so they draw I max so the idea is to turn them on one at…
Parents
  • abrain
    0 abrain over 6 years ago

    Hi Cris, if you’re sampling fast enough, and measuring the input voltage rather than doing some simple thresholding, then why not actually base it on what you’re interested in? Measure the voltage, quickly work out the change from last time you sampled, and as that rate of change comes down to a nice low value, switch on?

     

    That way you avoid dodgy time delays being affected by changes in frequency, etc, but you may have the issue of a working out the change on a noisy signal, depending on how you’re sampling circuit is filtered.

     

    A

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • phoenixcomm
    0 phoenixcomm over 6 years ago in reply to abrain

    You miss understand, I need just at the peek to fire off some Crydom SS Relays HD6090 (90amp   overkill image)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • abrain
    0 abrain over 6 years ago in reply to phoenixcomm

    Yes, sorry Cris, I don’t think I explained it very well.

     

    If you’re measuring the voltage (which I think you must be to find the zero crossing) then work out how much that voltage changed from the last sample you took, that change is smallest when you’re at the peak of the voltage.

     

    You’ll need to take the absolute value of the difference between the two readings, to account for negative and positive going peaks, but it will let you fire the relay at exactly the right time,

     

    I’ll see if I can sketch something out tomorrow to explain it better.

     

    A

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • phoenixcomm
    0 phoenixcomm over 6 years ago in reply to abrain

    Abrain, I have been working with C for well decades (1980) but I really hate the Arduino's IDE, personally, it sucks. I use eclipse. I haven't done too much with the analog side of the house except for some synchro stuff. For the most part, I use them for control. They really have no guts. like arm cortex stuff (32bit).  And the TI Launchpads are 10-20 bucks and load of IO. and well-done libraries.

    not like Arduino. Like we have a print-line function but not printf( " string" arg1,.... ). Using there IDE makes me brain dead. They are trying to stop good programming techniques by using setup() and loop() instead of main() which could call your init stuff, and then fall into a do{ }while( TRUE == some

    variable );

    At Trenton State, I used to teach and help with programming skills and they where pushing Pascal at the time. I used to say "The C Programming Language is akin to playing Russian Roulette.  Where the Wheel is gun which is your program. The little ball is the bullets. And of course, you are holding the gun to your head. and between the OS and your errors is what pulls the trigger"  You have to remember that this was K&R and no IDE on a pcXT.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • phoenixcomm
    0 phoenixcomm over 6 years ago in reply to abrain

    Abrain, I have been working with C for well decades (1980) but I really hate the Arduino's IDE, personally, it sucks. I use eclipse. I haven't done too much with the analog side of the house except for some synchro stuff. For the most part, I use them for control. They really have no guts. like arm cortex stuff (32bit).  And the TI Launchpads are 10-20 bucks and load of IO. and well-done libraries.

    not like Arduino. Like we have a print-line function but not printf( " string" arg1,.... ). Using there IDE makes me brain dead. They are trying to stop good programming techniques by using setup() and loop() instead of main() which could call your init stuff, and then fall into a do{ }while( TRUE == some

    variable );

    At Trenton State, I used to teach and help with programming skills and they where pushing Pascal at the time. I used to say "The C Programming Language is akin to playing Russian Roulette.  Where the Wheel is gun which is your program. The little ball is the bullets. And of course, you are holding the gun to your head. and between the OS and your errors is what pulls the trigger"  You have to remember that this was K&R and no IDE on a pcXT.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube