How To Count Frequency with Arduino

Поділитися
Вставка
  • Опубліковано 25 сер 2024
  • Nice simple, but useful little project. Using FreqMeasure library to count or measure the frequency using an Arduino Uno. The frequency of a signal is from an old parallaz development board, this board have an in-built pulse generator for 1,10,100 and 1k Hz. Our ardunino code will be counting the number of pulses during a fixed time.

КОМЕНТАРІ • 25

  • @rossgardiner2197
    @rossgardiner2197 Рік тому +1

    Great video! Neat little library :)

  • @studentofedison421
    @studentofedison421 Рік тому +1

    useful one, plz make more of them

  • @adambeedle
    @adambeedle 3 роки тому +1

    Awesome mate 👍

  • @user-em6rc6jy2o
    @user-em6rc6jy2o Рік тому

    So tried writing out the code connected to a arduino r3, I was wondering why the error message” freqMeasure.h : no suck file or directory

  • @Infinityautomotivetools
    @Infinityautomotivetools Рік тому +1

    Is it possible to measure frequencies with amplitude greater than 5V without damaging the Arduino?

    • @Lumpy-Beautiful
      @Lumpy-Beautiful Рік тому +1

      Yes, it is possible with an opto-isolator (optocoupler) like PC817.

  • @t1hello864
    @t1hello864 2 роки тому

    Gosh.. I'm trying to use pulseIn to measure the phototr's pulse when it's high, and I'm totally stuck with this.. Do you have any methods in your mind..? It's almost killing me

  • @ahmetozdemir7173
    @ahmetozdemir7173 2 роки тому

    Is it possible to count a continuously changing duty cycle? For example When counting a frequency, we first turn the analog signal to the square wave. The frequency count of a regular analog signal can be considered regularly with 50% duty cycle. However, the square wave duty cycle is not regular in the count of irregular and mixed analog signals. For example, 50, 55, 43, 20, 70, 30, 3, 43, 20, 70, 30, 3, 21, 17, 35 ....... can be a duty cycle. In this case, can the frequency of an analog signal provided in this case?

    • @codingwithalfred
      @codingwithalfred  2 роки тому

      Sorry I can not help, your question went over my head.

    • @jasonwalker4610
      @jasonwalker4610 2 роки тому +1

      I would connect to the analog pin and find a fft library, or code your own to calculate the frequencies. A mixed analog signal, or audio signal is just change in current over time so you just measure the time between each time the signal changes direction.

  • @yassinegaming9398
    @yassinegaming9398 2 роки тому

    my brother Is it possible to install a motor and make an antenna on top of it? It is programmed to rotate 180 or 360 degrees As it rotates, it searches for a specific frequency When you catch him, he determines his grade For example, it finds a frequency of 100 Hz at 80 degrees and stops rotating Thank you for your answers to my question

    • @homeupdatewithalfred
      @homeupdatewithalfred 2 роки тому

      Yes, this is possible but you will need more hardware and possible use another programming software to process these logic, as well as interface with the hardware. Thoughts: You will need a stepper motor and module controller to rotate the antenna. Antenna need to be able to interface with your program. This sounds like a really cool project, I can already see it working really well given we have good hardware.

  • @rodriguezfranco3839
    @rodriguezfranco3839 Рік тому

    I try the freqcount library and it won't work if I use my 16x2 lcd shield I think it is because the liquidcrystal uses the pins that the code needs for the freqcount , anyways I did the sketch that uses the serial monitor and then I got it to show me something but I think it is not acurated at all and looks like as I up the input Frequency it shows less I need to do more testing

    • @kevinlcarlson
      @kevinlcarlson Рік тому +1

      You might want to look at the ESP32 for your application, it runs much faster and has more features than the Uno. You can still use the Arduino IDE with the ESP32

    • @rodriguezfranco3839
      @rodriguezfranco3839 Рік тому

      @@kevinlcarlson I solved it by using other lcd that had SPI connetion , it works great for ac freqcounting but it won't count square waves signals I don't know why

  • @electro_CC
    @electro_CC Рік тому

    hey i used the same library and code, but my serial monitor shows some random characters. pls solve this issue

    • @codingwithalfred
      @codingwithalfred  Рік тому

      verify that you have the same baud rate as i had in the video.

    • @electro_CC
      @electro_CC Рік тому

      @@codingwithalfred thank you, I forgot to change the baud rate in serial monitor, it is working now

  • @rodriguezfranco3839
    @rodriguezfranco3839 Рік тому

    I need to measure my tesla coill PLL cd4046 board I think I am around 2 Mhz so this will not work right?

    • @codingwithalfred
      @codingwithalfred  Рік тому +1

      Yes and no. It will not work using the standard arduino syntax eg. programm delay due to code overhead, but if you use the hardware timer it should work. I will have to create the condition on my bench to test it. Maybe a future video... Counting high frequency values using hardware timer since the Uno uses a 16MHz oscillator.

    • @rodriguezfranco3839
      @rodriguezfranco3839 Рік тому

      @@codingwithalfred thanks so much

  • @arivnidunami3047
    @arivnidunami3047 2 роки тому

    so it is not suitable for high voltage freq? like ac main..