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
HP Stream 7 docking
3.7V to 5V
Solar Charger
Infrared Decoder
PIC Music
Code Lock
Code Lock with LCD
HOME   Technical Tips


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.

The VB6 application

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.


Comments and questions

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

29.07.2020 - 20:27
Name: Alex
Comment: Hello Moty! Can this frequency meter measure the frequency of the electronic clock generator?

26.06.2020 - 15:45
Name: Moty
Comment: Hi Alex, Download the software again and you will find a circuit added that shows how to connect USB to Serial module. Does your talking clock works OK?

26.06.2020 - 11:23
Name: Alex
Comment: Hi Moty! My computer does not have a serial port RS232. How do I use CH340 USB module in a TTL UART converter?

23.09.2018 - 16:30

23.09.2018 - 16:26

20.07.2014 - 02:02
Name: Moty
Comment: Hi Xtal. You are right, thank you for finding the error. I uploaded the old version of the firmware by mistake. Now it's corrected so please download the software again and try it.

19.07.2014 - 18:37
Name: xtal
Comment: Interesting, but software shouldn\'t work....CMCon was set to 7 disabled comparators , cmcon never altered so how to get output from RA3 ? , where was TMR1 set up for external input[RB6] .....

29.08.2013 - 02:02
Name: Moty
Comment: Can't be very intelligent robot.

28.08.2013 - 14:29
Name: uytrurty
Comment: Robot comment.

28.08.2013 - 14:28
Name: fhdrtye
Comment: Robot comment.

moty22.co.uk  2008-2021