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.
Great video! Neat little library :)
useful one, plz make more of them
Awesome mate 👍
:)
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
Is it possible to measure frequencies with amplitude greater than 5V without damaging the Arduino?
Yes, it is possible with an opto-isolator (optocoupler) like PC817.
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
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?
Sorry I can not help, your question went over my head.
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.
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
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.
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
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
@@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
hey i used the same library and code, but my serial monitor shows some random characters. pls solve this issue
verify that you have the same baud rate as i had in the video.
@@codingwithalfred thank you, I forgot to change the baud rate in serial monitor, it is working now
I need to measure my tesla coill PLL cd4046 board I think I am around 2 Mhz so this will not work right?
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.
@@codingwithalfred thanks so much
so it is not suitable for high voltage freq? like ac main..
No not AC main in this application.
Why will you need to count high voltage freq?