OLED Current Meter PIC12F675
Picture Frame PIC16F690
Talking Clock PIC16F628A
OLED Thermometer PIC12F629
OLED Thermostat PIC16F628A
TFT Counter PIC16F628A
SSD1306 Counter PIC16F628A
SSD1331 Counter PIC16F628A
Color OLED Picture Frame
Arduino Counter for PC
Arduino Oled Code Lock
PC digital I/O without MCU
PC Analog Input without MCU
Arduino Oscilloscope for PC
Arduino OLED Oscilloscope
Arduino Picture Frame
OLED Bitmap Arduino / PIC
OLED Arduino Counter
OLED Timer Thermometer
OLED Frequency Counter
Android Oscilloscope
OBD2 Engine Rev Counter
OBD2 Diagnostic app
TFT Clock and Thermometer
WiFi, Ethernet
WiFi Thermometer
WiFi ESP8266
Doorbell with SD / EEPROM
SD FAT16/32 for .bmp
PETIT FAT bmp Display
TFT Timer, Thermometer
TFT Oscilloscope
SD Talking Clock
Android Talking Clock
SD Sound Recorder
SD FAT32 wav Player
SD Arduino Recorder
LED Thermometer
LED Timer
LCD Timer
TFT 10MHz Counter
100KHz Counter For PC
1MHz Counter For PC
8 Digits LED Counter
Scope Screen Counter
LCD 16 x 2 Counter
LCD Arduino Counter
6MHz Android Counter
NIXIE Android Counter
Bluetooth Counters
USB Counter
USB TFT display BMP
USB DS18B20 Sensor
USB Thermometer
USB Meter
USB Oscilloscope
USB Input-Output
USB Input-Output Android
USB 16x2 LCD
Serial TFT Text
Serial Inputs Outputs
Serial Port LCD
MCP3201 on Serial Port
Serial Thermometer
Analogue Signal to Serial
Serial Thermostat
MCP3201 on LPT
Analogue Signal to LPT
LCD Display on LPT
Water Softener
3.7V to 5V
Solar Charger
Infrared Decoder
PIC Music
Code Lock
Code Lock with LCD
HOME fr  ru  de  in  ro  ar  tr  nl  il  Technical Tips

6MHz ARDUINO FREQUENCY COUNTER

Arduino Uno or Nano 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 overFlow register. At the end of the 1 second the 16 bit register is recorded. The Arduino then sends to the PC via the USB cable and the Com Port 6 bytes of data.
The Arduino has to be connected to the PC first and then the VB6 app started. The app searches for the Com Port by sending a byte and checking if the byte is echoed. It takes a few seconds. The app has to be switched off when the Arduino IDE programs the Arduino.
The frequency input at pin 5 is TTL signal levels, for low signal a video amp has to be added. The specs recommend input up to 6 MHz, I tested it at 2 MHz. Included a Visual Basic (VB6) code and .EXE file and Arduino sketch.

arduino counter

SERIAL PORT 100KHz FREQUENCY COUNTER

Self powered frequency counter plugged into the serial port. Included a Visual Basic (VB6) code, PIC code, and a circuit diagram. The PIC16F628A microcontroller is programmed to count the input frequency and transmit it serially to the serial port. The microcontroller is powered by the signals of the serial port, so no external power supply is needed. The counter is 17 bit (16 bits + overflow). The crystal can be changed to a ceramic resonator if accuracy isn't essential.
The signal input is connected via the chip comparator to allow sensitivity down to 100mV.
You can read more about serial interface in http://www.beyondlogic.org/spp/serial.htm

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

SERIAL PORT 1MHz FREQUENCY COUNTER

Self powered frequency counter plugged into the serial port. Included a Visual Basic (VB6 and VS2005) code and .EXE file, PIC assembly, PIC C code, and a circuit diagram. The PIC16F628A microcontroller is programmed to count the input frequency and transmit it serially to the serial port. The micro controller is powered by the signals of the serial port, so no external power supply is needed. The counter is 20 bit transmitted by the UART in 3 bytes. The crystal can be changed to a ceramic resonator if accuracy isn't essential.

You can read more about serial interface in http://www.beyondlogic.org/spp/serial.htm

Code is for MPLAB, MPLABX and compilers HI TECH or XC8.

USB PORT 6MHz FREQUENCY COUNTER USING USB TO UART

Self powered frequency counter plugged into a USB port. The PIC16F628A microcontroller is programmed to count the input frequency during accurate 1 second derived from the 16 MHz crystal. The micro controller is powered by 5V output from the USB to UART module. When pluging the module it creates a serial port on the PC which can be found in Device Manager, set the VB app to connect to that port number. Every second the PIC sends 3 bytes of data to the PC.
Included a Visual Studio (VS2010) code and App, pic C code, and a circuit diagram. Software can be downloaded from GitHub: https://github.com/projects22/Frequency-Counter-for-PC To install the app to PC click setup.exe.
USB to UART can be bought in Ebay https://www.ebay.co.uk/sch/i.html?_from=R40&_trksid=p2060353.m570.l1313&_nkw=usb+to+uart&_sacat=0 make sure it has 5V output.

usb usb

 

Circuit Description
See also Technical Tips

Pin 4 at the serial port is turned to +12V by the software enabling RTS. It is regulated to 5V by 78L05. The 5V is the supply to the microcontroller.
Pin 3 is at -12V and pin 7 at +12V constantly and they are used to drive RX input between -9V (input HIGH) and +8v (input LOW) . These levels are sufficient to drive the RS242 input.

Pin 12 is the frequency input, input signal has to be TTL type.
Pin 8 is the UART output, it transmits the 20 bit count in three bytes in RS232 format. When pin 8 is high both transistors conduct and voltage at pin 2 of serial port is at -9V.
The other pins are not in use but must be left open circuit.

100mhz c100

Circuit Description
See also Technical Tips

Pin 4 at the serial port is turned to +12V by the software enabling RTS. It is regulated to 5V by 78L05. The 5V is the supply to the microcontroller.
Pin 3 is at -12V and pin 7 at +12V constantly and they are used to drive RX input between -9V (input HIGH) and +8v (input LOW) . These levels are sufficient to drive the RS232 input.

PIC16F628A contains a UART for serial comm and a 16 bit counter.
Input signal can be 0.1 to 5 vollts peak to peak.
Pin 17 is the frequency input, it's the PIC comparator input. Referance voltage to the comparator is 2.5V at pin 1. Output of the comparator at pin 2 is linked to the PIC counter input at pin 12.
Pin 8 is the UART output, it transmits the 16 bit count and overflow in three 8 bit words in RS232 format.
The other pins are not in use but must be left open circuit.

 





20.06.2021 - 12:49
Name: Moty
Comment: Diagram added.

20.06.2021 - 03:58
Name: Wing
Comment: Where is the schematic diagram of the Aeduino version?

23.05.2015 - 12:35
Name:
Comment:

07.03.2015 - 00:26
Name: soho
Comment: 78l05 in or out ??

04.03.2014 - 03:57
Name: Carlos
Comment: Obrigado amigo estava a procura de algo assim para aprender muito bom!
01.05.2010 - 18:56
Name: Mustafa Sayan
Comment: Mersi


moty22.co.uk  2008-2021