Frequence meter with arduino - Page 1
Forum section: electronics / beginners

author: capitainekurck
author_rank: Contributor
timestamp: May 01, 2020, 11:39:20 pm
content: hello AllFirst of all i m not a electronicianI ve got a old signal generator, a little xr2206 kit that i build myself a long time ago. i try to make a little frequency meter to put on to see the output frequency.the generator can give square, sine and triangle signal from 0 to 24 V and 1Hz to 400kHz.i try to do it with an arduino. I look on the net and i find 2 libraries to do that.https://www.pjrc.com/teensy/td_libs_FreqMeasure.htmlhttps://www.pjrc.com/teensy/td_libs_FreqCount.htmli also find that i can use a IC74LS14 In order to convert any signal into square for the arduino input.but now the problem for me it to convert the output voltage from the generator 0 to 24 V to 0 - 5 V arduino input, with a high input impedance and i don't i know how to do that, perhaps with a voltage divider ?.thanks for your help

author: Manul
author_rank: Super Contributor
timestamp: May 02, 2020, 11:21:35 am
content: If your signal is constant amplitude, and always positive (0 - 24V), you can use a voltage divider. After voltage divider use schmitt trigger inverter to get a nice sharp square wave. IC74LS14 is not very good for that, because it is TTL and needs some input current and that will disturb high impedance voltage divider. That is a dinosaur of electronics. Use a more modern CMOS version like SN74HC14N.Voltage divider can be made by different combinations, for example 39K and 10K will be close enough.Use ceramic bypass capacitor close to the IC, like 100n.

author: EEVblog
author_rank: Unknown
timestamp: May 02, 2020, 11:31:18 am
content: Does your function generator have a square wave or TTL output?

author: capitainekurck
author_rank: Contributor
timestamp: May 02, 2020, 12:25:10 pm
content: Quote from: EEVblog on May 02, 2020, 11:31:18 amHiYes there is a TTL output and a synchro output. In fact you mean that i can use the TTL signal as is a 5 V output to take the frequency for the arduino.So i don't need a voltage divider and the schmitt trigger as it s a square waveI think i also have to connect the ground of the arduino to the ground to the function generator.Thanks

author: capitainekurck
author_rank: Contributor
timestamp: May 02, 2020, 12:29:41 pm
content: Quote from: Manul on May 02, 2020, 11:21:35 amHiWhere do i have to put that capacitor ? betwin the signal and the ground out the signal and the input pin of the arduino ?thanks

author: Picuino
author_rank: Super Contributor
timestamp: May 02, 2020, 12:36:29 pm
content: Quote from: capitainekurck on May 01, 2020, 11:39:20 pmThose libraries are not for arduino, they are for Teensy Boards:https://www.pjrc.com/teensy/I leave you a link to my frequency counter that can help you:https://github.com/picuino/freqcounter

author: Manul
author_rank: Super Contributor
timestamp: May 02, 2020, 12:45:09 pm
content: Quote from: capitainekurck on May 02, 2020, 12:29:41 pmNo, just between gnd and Vdd (+5V power supply) near IC. But you do not need all of this if your generator has 5 square output.

author: capitainekurck
author_rank: Contributor
timestamp: May 02, 2020, 02:06:00 pm
content: Quote from: Picuino on May 02, 2020, 12:36:29 pmThanks I will take a look a your library. but you can' use the tensy library for arduino too. you just have to find the correct timer pin to use :"Other Arduino Compatible BoardsFreqMeasure can be used on Arduino, Sanguino and probably other boards. See the file util/capture.h for details to port to other AVR-based boards.Arduino Mega's pin 49 may be used by the SPI library, or SPI-based libraries like Ethernet or SD. You may need to edit FreqMeasure's util/capture.h to use ICP5 (pin 48) instead of ICP4.Seeeduino GPRS requires editing FreqMeasureCapture.h. This this issue report for details. "

author: EEVblog
author_rank: Unknown
timestamp: May 02, 2020, 02:33:39 pm
content: Quote from: capitainekurck on May 02, 2020, 12:25:10 pmYes, correct on all those things. That's what the TTL output is for, just connect direct to an Arduino input pin with the ground pin.

author: capitainekurck
author_rank: Contributor
timestamp: May 03, 2020, 02:31:05 am
content: an other think is it safe for my computer, if i had to connect the ground of the generator to the arduino, to connect it to my computer to capture via serial the frequency or to program it ( while it still connect to the generator) ?thanks