Measure 2 frequency signals using arduino mega

Status
Not open for further replies.
Trying to measure 2 on Arduino Mega will require substantial work, in editing source code and resolving compiler errors. You should consider if this work costs more than simply buying better hardware. Teensy LC is under $12, and can run FreqMeasureMulti.

In theory, perhaps you could create another library that is a copy of FreqMeasure. But in this other library, you would rename almost everything. You would also edit FreqMeasureCapture.h (or whatever its new name is) and for the section of Arduino Mega change the other copy to use TIMER5 instead of the default TIMER4. See the comments in that file for info.

The pin numbers in FreqMeasureCapture.h are a result from the AVR chip which offers timer input capture on specific pins, and the circuit board design of Arduino Mega. You can get the chip datasheet from Atmel's website, and Mega's schematic from Arduino.cc's website.

If you can edit the code sufficiently so the 2nd copy is completely separate and does not use any of the same global names, perhaps both can run together. Arduino Mega is a fairly slow processor, so this will only work if both frequencies are relatively low.

If you do this and get it to work reliably, perhaps you'll share the results so others can benefit? Maybe you'll even answer some of their questions, as I have done here for you?
 
Thank you very much for explanation.
I will write a little bit more detailed about my project so maybe you can help me to have best decision.
I am using an arduino mega and read some load cells using hx711 (i read 12 load cells)
I am also control few relays on/off
I don t have a problem to buy that teensy LC for measure these frequencies that i need, but can this somehow comunicate with arduino mega? I mean now I have a setup with ethernet and the arduino send data's to a server.
So do i have a chance to make them talk to each other?


Thanks again for help

p.s. the 2 frequencies that i want to measure are between 0 and 15Hz
 
Status
Not open for further replies.
Back
Top