CH341 USB TO I2C/SPI/EPP
Waveform Generator
AHT21, MAX6675 Thermometer
USB to I2C OLED
USB to LCD
USB Input Output
SD CARD
CH376 USB Picture Frame
SD FAT32 Player PIC12F1822
W25Q64 Flash Recorder
Picture Frame PIC16F690
Color OLED Picture Frame
SD FAT32 TFT Display
Doorbell with SD/EEPROM
SD Talking Clock
SD Sound Recorder
SD FAT32 wav Player
SD Arduino Recorder
Arduino Picture Frame
FREQUENCY COUNTER
AD9833 Waveform Generator
Chrome Browser Counter
Arduino LED MAX7219 Counter
LCD Accurate Counter
OLED Accurate Counter
MilliHertz Counter
PIC Counter For Android
MAX7219 LED Counter
WiFi Frequency Counter
Frequency Generator
OLED Counter PIC12F629
Talking Frequency Counter
TFT Counter PIC16F628A
SSD1306 Counter PIC16F628A
SSD1331 Counter PIC16F628A
Arduino Counter for PC
OLED Arduino Counter
OLED Frequency Counter
TFT 10MHz Counter
PC Counter
LED Counter
Scope Screen Counter
LCD 16 x 2 Counter
LCD Arduino Counter
6MHz Android Counter
NIXIE Android Counter
Bluetooth Counters
USB Counter
OBD2
OBD2 RPM meter PIC16F876A
OBD2 Engine Rev Counter
OBD2 Diagnostic app
OSCILLOSCOPE
Logic Analyzer
PIC12F1822 Scope for PC
Arduino Oscilloscope for PC
Arduino OLED Oscilloscope
Android Oscilloscope
TFT Oscilloscope
USB Oscilloscope
THERMOMETER
Thermocouple 1023 Deg
Thermometer For Browser
OLED Thermometer PIC12F629
OLED Room Thermostat
TFT Clock and Thermometer
LED Thermometer
USB Thermometer
Serial Thermometer
Serial Thermostat
USB DS18B20 Sensor
TIMER / CLOCK
Cuckoo Clock
Real Time Clock DS3231
LED TM1637 Timer
OLED Timer Thermometer
TFT Timer Thermometer
LED Timer
LCD Timer
Clock Thermometer
Talking Clock PIC16F628A
Android Talking Clock
WiFi
WiFi, Ethernet
WiFi Thermometer
WiFi ESP8266
USB
IO for Chrome Browser
USB 16x2 LCD
USB TFT display BMP
USB Meter
USB Input-Output
USB Input-Output Android
DATA ACQUISITION
Analogue to USB (CH341)
MCP3201 on Serial Port
PC Analog Input (USB-UART)
SERIAL PORT
Serial TFT Text
Serial Inputs Outputs
Serial Port LCD
Analogue Signal to Serial
OTHERS
HC-SR04 Sensor
OLED Amp Meter
PC digital I/O (no coding)
Analogue Signal to LPT
LCD Display on LPT
Water Softener
3.7V to 5V
Solar Charger
PIC Music
Code Lock
SMALL PROJECTS  
  Technical Tips  

For low input signal use high speed comperator: eBay

ACCURATE OLED FREQUENCY COUNTER 4MHz PIC12F1822

PIC12F1822 counter uses 2 PPM crystal oscillator in Real Time Clock. The PIC sets the DS3231 module to output accurate 1 Hz which is used to gate the input frequency, I use this module because it is cheaper than other 2 PPM crystal oscillators. The 3V battery isn't needed.
The frequency is displayed on line 1 by 7 digits with leading zeros removed down to 3 digits. Signal input is a TTL type.
Period is displayed on line 2. The period is calculated. For frequencies greater than 1000Hz the display is ns and for less than 1000Hz the display is in us (micro sec).
OLED module is I2C 0.96" SSD1306. Contrast of oled can be set in software. Included C code and circuit diagram.

ds5mhz oled

line

OLED SSD1331 FREQUENCY COUNTER PIC16F1827

Color Oled display 0.95", 96 x 64, SSD1331 driver. Pic drives the Oled using SPI. The counting resolution is 1 Hz for frequencies up to 8 MHz. Included C code and circuit diagram.
The frequency is displayed on line 1 by 7 digits with leading zeros removed down to 1 digits. Signal input is a TTL type, 3.3V max. The time base is generated by the 8MHz crystal oscillator.
The CPU frequency is 32MHz from the PLL.
2 diodes are used to reduce 5V to 3.5V for the PIC's Vdd, it is needed because the SSD1331 inputs don't tolerate 5V.
Period is displayed on line 2. The period is calculated. For frequencies greater than 1000Hz the display is ns and for less than 1000Hz the display is in us (micro sec).
OLED module: https://www.ebay.co.uk/itm/282379866279?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2649

You are free to use the circuit diagram and the software with no limitations

oled1331 oled.jpg

line

16MHz PIC16F1827 LED FREQUENCY COUNTER

Counter based on PIC16F1827 . Included C code and circuit diagram. Input is a TTL level. The counting repeats every about 1sec. The 8MHz crystal is for generating accurate time base for counting the input frequency. The LED module doesn't flicker, LED brightness can be set in the code, value can be 0-15. The 7 segment LED module is driven by 3 lines of the pic SPI.
TMR0 input can count frequency up to 50MHz if the signal is 50% duty cycle. If the duty cycle is 10% then the max frequency is 10MHz. TMR0 prescaler divides by 2 to increase the input frequency range to 16 MHz.
The counter measure the frequency for 0.1sec first, if the frequency is greater than 2MHz TMR0 prescaler divides by 2 to increase the input frequency range to 16MHz with resolution of 2Hz, if the frequency below 2MHz TMR0 is set for no prescaling and the measurment is with resolution of 1Hz.

Software includes PIC code. You are free to use the circuit diagram and the software with no limitations.

7219 led

line

8 DIGITS LED DISPLAY MAX7219 20MHz FREQUENCY COUNTER

Counter based on PIC16F628A . Included C code and circuit diagram. Input is a TTL level. The counting repeats every about 1 sec. The 20MHz crystal is for generating accurate time base for counting the input frequency. The LED module doesn't flicker, LED brightness can be set in the code, value can be 0-15.
PIC16F628A TMR0 input can count frequency up to 20MHz if the signal is 50% duty cycle. If the duty cycle is 10% then the max frequency is 10MHz.
The counter measure the frequency for 0.1sec first, if the frequency is greater than 2MHz TMR0 prescaler divides by 4 to increase the input frequency range to 20MHz with resolution of 4Hz, if the frequency below 2MHz TMR0 is set for no prescaling and the measurment is with resolution of 1Hz.
I tested the counter by connecting the frequency input to the 20MHz crystal, it read 20000422 instead of 20000000. The error is due to time of instructions to the CPU to start and stop the count.
The 7 segment LED module is driven by 3 lines, the pic generates a software SPI.

Software includes PIC code. You are free to use the circuit diagram and the software with no limitations.

7219 led

line

ARDUINO LED DISPLAY MAX7219 6MHz FREQUENCY COUNTER

Counter based on Arduino Uno or Nano. Included INO file and circuit diagram. Input is a TTL level. The counting repeats every about 1 sec. The LED module doesn't flicker, LED brightness can be set in the code, value can be 1-15.
The Arduino generates an accurate 1 second time base for the counter by cascading timer0 and timer2. The link between digital inputs 3 and 4 connects the output of timer2, 250 Hz, to input of timer0. The software waits for the output of timer0 to go positive to start the count of frequency input to timer1. Timer1 is a 16 bits timer, it overflows at the count of 2 power of 16, that in turn advances over-flow register. At the end of the 1 second the 16 bit register is recorded.
Max7219 lib is used: https://github.com/An7orAhmed/MAX7219Segment
You are free to use the circuit diagram and the software with no limitations.

7219 led

line

8 DIGITS 50MHz FREQUENCY COUNTER

Counter based on PIC16F628A . Included C code and circuit diagram. Input is a TTL type. The counting repeats every about 5 sec. The 32K crystal is for generating accurate time base for counting the input frequency. The MCU uses the 4MHz internal oscillator.
PIC16F628A TMR0 input can count frequency up to 50 MHz if the signal is 50% duty cycle. If the duty cycle is 10% then the max frequency is 10MHz. TMR0 can count up to 2MHz , the prescaler is used to increase the input frequency range to 64MHz. Frequencies up to 1MHz are counted with resolution of 1Hz, frequencies above 1MHz are counted at resolution of 32Hz.
I tested the counter up to 2MHz only, I don't have the means to do better tests.
The 7 segment LED is common cathode, cc8 is the common cathode of the digit on the left. 100 ohm resistor for the segments is for a current of 20mA, the max output current of the pic is 25mA, so if you change the resistors make sure you don't exceed this current.
To drive 8 digits from 5 outputs I used a system of 2 out of 5 that gives up to 10 outputs by AND gating to outputs. I used one output to drive the base of the transistor and the other a diode. the emitter of the transistors are elevated by 0.7V by a diode, this to make sure they are switched off when the diode at the base is low. It is possible to reduce the number of digits by deleting them and by deleting the lines in the code that drives the digits.

Software includes PIC code. You are free to use the circuit diagram and the software with no limitations.

Circuit Description
See also Technical Tips

All transistors are BC337 or equivalent.
Total 5V supply current can reach145mA.
The 8 digits display is common cathode, for red LEDs the 7 resistors of 100 ohms enable current of 20 mA total, average of 2.5 mA through each segment which is on for eighth of the time. To increase the brightness the resistors can be decreased to max current of 25 mA. The seven segments, a to g, of one digit are linked to the corresponding seven segments in the other digits. cc8 is the common cathode of the digit on the left.
The 8 digits are multiplexed by 5 pic's outputs, for each group of 2 out of 5 a digit is switched on. The diode to ground from the emitters is to insure full switch off when the gating diode at the base is low.



Name:

Comments and questions

Copy the number from the picture It stops net-robots from adding comments.



12.01.2024 - 13:03
Name: Moty
Comment: There are no enough pins in pic16f628 to have extra 3 leds or inputs for range select.

12.01.2024 - 07:45
Name: GURDEEP SINGH
Comment: CAN YOU PLEASE SHARE 3MHZ FREQUENCY COUNTER CIRCUIT USING THREE 7 SEGMENT DISPLAY AND THREE LED FOR HZ,KHZ,MHZ THANKS GURDEEP1972@GMAIL.COM

14.07.2019 - 20:27
Name: Moty
Comment: Hi Brian, The LEDs i used are old: Toshiba TS358. Choose common cathode that you can buy and I will tell you if they are ok.

14.07.2019 - 03:47
Name: Brian Scott
Comment: What make/model 7-segment LED are you using?

27.02.2019 - 21:10
Name: cc
Comment: All transistors are BC337 ... equivalent

27.02.2019 - 21:09
Name:
Comment: hello

26.02.2017 - 09:54
Name: Bryan Watson
Comment: Like the circuit , I would like to built a 4 digit one ( only using last 4 digits of a 144 .??? transceiver but using a very small readout I have several HDSP2002 DOT MATRIX UNITS but cant find out how to drive them from a normal LED 7 segment as these are a 4 digit unit that connect differently to normal LEDS .Bryan VK7KWB bjwatson3@optusnet.com.au

21.02.2017 - 00:09
Name: Moty
Comment: The LEDs are off during counting because the CPU is quite busy with the count. If we had A32 bits timer/counter it could have done the counting without the CPU.

20.02.2017 - 18:28
Name: Александр
Comment: the led should be off during the measurement?

24.12.2016 - 17:21
Name: Moty
Comment: Hi Bryan, The code converts Long Integer to 8 decimal digits, you can display only the 4 digits that you want. Driving the display will be an interesting task.

24.12.2016 - 04:49
Name: Bryan Watson VK7KWB
Comment: Dear Sir i wish to make a counter using last 4 digits only to count frequency 144 -145 mhz using a by 100 divider to only indicate last for digits example : 144.200 = 4200, using small LED DOT MATRIX readout HCMS2002 from HP . TO fit a small space on my ICOM IC202. BUT MAY need to findout how to program 10.7 off set.

18.04.2016 - 20:41
Name: Carol
Comment: cod hex vrong!!

28.09.2015 - 00:31
Name: Fabio Alexandre
Comment: Hi, First thank you for the great project. Is possible they counting over a period of 0.5 second and not 2 seconds? I want to detect variations in frequency but 2 seconds is too long time for my purpose. I have intended to use 70 - 140 Khz signal. Best Regard.

29.12.2014 - 14:19
Name: Brian Clark
Comment: Hi You have a nice page keep up the good work I will look back at a later time thank you.

20.07.2014 - 02:15
Name: Moty
Comment: Hi Vinay, Try programming the PIC with the led_counter_c.hex.

19.07.2014 - 14:18
Name: vinay
Comment: This circuit is not working, need to change any hardware?

14.06.2014 - 16:36
Name: Moty
Comment: Hi Jack. The circuit is back now. Try programming the PIC with the led_counter_c.hex. The other hex file is compiled from the ASM code and it is not a clever code. If you get clear 0 to 9 seven segments figures then it is likely that you wired it ok.

14.06.2014 - 07:39
Name: Jack Schmidling
Comment: The circuit is not displayed on this page so I may have it wired wrong but it sort of works in a general sense. The display works and blinks every 3 seconds but when a signal is applied, the number displayed has little to do with the freq and is not repeatable. Any ideas? Jack

iconFlag Countermoty22.co.uk  2008-2024