Organize and Share your Electronics the way you want. Sign-Up for a free account now. It takes only 30 seconds!

Raspberry Pi RF frequency counter

Raspberry Pi RF frequency counter

A Raspberry PI RF frequency counter project from Scott Harden, that is available on GitHub:

Raspberry PI RF Frequency Counter with Python Interface. The RF signal clocks a 32-bit counter (SN74LV8154) connected to a 16-bit IO expander (MCP23017) accessable to the Raspberry Pi (via I²C) to provide real-time frequency measurements from a python script.

The entire circuit is only two microchips! I have a few passives to clean up the RF signal (the RF input is loaded with a 1k resistor to ground, decoupled through a series 100 nF capacitor, and balanced at VCC/2 through a voltage divider of two 47k resistors), but if the measured signal is already a strong square wave they could be omitted. The circuit requires a gate pulse which typically will be 1 pulse per second (1PPS) and can be generated by dividing-down a 32.768kHz oscillator, a spare pin on a microcontroller, a fancy 1PPS time reference, or like in my case a GPS module (Neo-6M) with 1PPS output to provide an extremely accurate gate.

….

Here’s a quick summary describing how the code works: First I send bytes to address 0 and 1 to set all pins of GPIO A as inputs, and GPIO B as outputs. Note that only 4 of 8 pins are used for the output, so technically 4 extra pins could be used for things like blinking LEDs or controlling other devices. I then set the register select pins by sending a value to 0x13 (GPIO B), and read the entire GPIO A bus (INTCAPB, 0x18). For address details, consult the datasheet. I do this 4 times (1 for each byte of the 32-bit counter), do a little math to turn it into a frequency value, and compare the current value with the last value and take the difference to display as the measured frequency.

More details at Scott Harden’s blog.

Read more Here







 

More Articles to Read

Binary clock
Binary clock
Play the guitar on a guitar bag
Play the guitar on a guitar bag
NanoPi NEO – Smaller and faster than Raspberry Pi Zero
NanoPi NEO – Smaller and faster than Raspberry Pi Zero
PT100 Control Board for Raspberry Pi. Completed!
PT100 Control Board for Raspberry Pi. Completed!
LEGO Train Automation – IoL Internet of LEGO
LEGO Train Automation – IoL Internet of LEGO
9-year-old creates an award-winning, life-saving asthma monitor
9-year-old creates an award-winning, life-saving asthma monitor
Make your own LoRa gateway with less than $200
Make your own LoRa gateway with less than $200
Marty, the nice educational robot can now feature a Raspberry Pi
Marty, the nice educational robot can now feature a Raspberry Pi
Build a pan and tilt camera with Raspberry Pi + Arduino
Build a pan and tilt camera with Raspberry Pi + Arduino
An open source 3D Scanner made with Raspberry Pi
An open source 3D Scanner made with Raspberry Pi

Top


Shares