Sunteți pe pagina 1din 8

1/31/13

Frequency Counter Circuit using Micro Controller

Home Forums Datasheets Lab Manual Testing Components Buy Project Kits

Electronic Circuits and Diagram-Electronics Projects and Design


Search
Custom Search

Ads by Google

Frequency Counter

Circuit

Clock Timer Circuit

AVR

Frequency counter circuit


rakesh April - 3 - 2012 0 Comments

Simple Frequency Counter


You may have already seen various projects over many websites named Frequency counter, Digital Frequency Counter etc. Im posting just another of them. Showing the use of timer/counter of AVR micro controller (Atmega8) in one of its form. This circuit can be used as a simple micro controller project for your engineering courses. Frequency of a periodic signal is the number of cycles it repeats per second! So If we count the number of cycles recorded in a second it will directly read the frequency. So what we are going to make is a frequency counter circuit, which can also be called as a frequency meter. To make this frequency meter 1) we need a signal (whose frequency has to be counted) 2) Atmega8 micro controller from Avr 3) An LCD to display the counted frequency. I assume that you are familiar with Avr Atmega8 and you know how to program it. You also need to know How to interface LCD with Avr Now lets get into the details of the project Simple Frequency Counter or otherwise Frequency Meter! Take a look at the circuit diagram given below and also skim through the program given towards the end of this article.

www.circuitstoday.com/frequency-counter-circuit

1/8

1/31/13

Frequency Counter Circuit using Micro Controller

Frequency counter schematic circuit diagram

Description of circuit:So what I have done here is; Set the counter to zero, waited for 1S, and read the counter again. But remember,you need to read the value immediately after the delay loop ends. It is simple. Just assign a variable and copy the count to that. The data type of the variable is essentially an unsigned integer. You can try floating point data type too! But here you need to typecast it! Thats all! To read about floating point conversion in Avr read this article carefully String Formatting of Avr And yes! Its better that you apply a conditioned signal for counting the frequency. i.e. a square wave or a trail of pulses. You may use a suitable signal conditioning circuit like Comparator; Schmitt trigger, sine wave to square wave converter, whatever suits you. If the signal is of low power, then use a conditioning circuit . You can get lots of signal conditioning circuits in this website check here - Signal Conditioner Circuits Now here is the Technical details of my project. I hope youll have not much problem to make this.

The program [Embedded C, AVR Studio]:


#eieFCU1000 dfn _P 000 #nld icue #eieSP1 dfn M itmi(od n anvi) {usge iti nind n ; sdu=ldsr tot&c_t; iiLD) ntC(; _ea_s5) dlym(0; wie1 hl() {TN1=; CT 0 _ea_s10/M) dlym(00SP; iTN1 =CT; LDm(x1; Ccd00) pit(Fe:uz,*M) rnf"rq%H"iSP;

www.circuitstoday.com/frequency-counter-circuit

2/8

1/31/13
_ea_s50; dlym(0) } rtr 0 eun ; }

Frequency Counter Circuit using Micro Controller

The internal code of the Header file ATmega8LCDcfg1.h


Note: the Location of the Headr file is: C:\Program Files \Atmel\AVR Tools\AVR Toolchain\avr\include\user
#fe _C_F_ idf LDCGH #ann "C cniuainfl araylae.Amg8Ccghicuinsipd" wrig LD ofgrto ie led odd TeaLDf. nlso kpe. #ni edf #fdf_C_F_ ine LDCGH #eie_C_F_ 1 dfn LDCGH #fdf_V_OH ine ARI__ #nld icue #ni edf #fdf_TLDLYH ine UI_EA__ #nld icue #ni edf #fdf_TI__ ine SDOH #nld icue #ni edf #eieDL 1 dfn E1 0 #eieDL 4 dfn E2 0 #fdfDOT ine PR #eieDOTPRB dfn PR OT #ni edf #fdfCOT ine PR #eieCOTPRD dfn PR OT #ni edf #fdfDDR ine PD #eieDDRDR dfn PD DB #ni edf #fdfCDR ine PD #eieCDRDR dfn PD DD #ni edf #fdfR ine S #eieR P6 dfn S D #ni edf #fdfE ine N #eieE P7 dfn N D #ni edf itLDca c,FL *p; n C(hr h IE f) / Fnto T sn asnl ca.t LD / ucin o ed ige hr o C vi LDm(hrc) od Ccdca h; vi iiLD) od ntC(; sai FL ldsr FE_EU_TEMLDNL,FE_EU_RT) ttc IE c_t= DVSTPSRA(C,UL_DVSTPWIE; / * / Aoe Asra i stu t gv afratdotu / bv: tem s e p o ie omte upt / t LDuigamcoFE_EU_TEM) Tesra / o C sn ar DVSTPSRA(. h tem / icue tefnto 'C('ta dsrbshwa / nlds h ucin LD) ht ecie o / snl caatri sn t LD Bttefnto / ige hrce s et o C. u h ucin / pooyeo 'C('ms b a prdmn b temco / rttp f LD) ut e s e ead y h ar / 'DVSTPSRA(' Setepooyedfnd Ti / FE_EU_TEM). e h rttp eie. hs / pooyei fxd I ti pooyedfes Teporm / rttp s ie. f hs rttp ifr. h rga / wl ntgtcmle. / il o e opid / I teagmn Fedo 'DVSTPSRA(,,).Frt / n h ruet il f FE_EU_TEMABC' is / fedA hlstenm o tefnto/otn ta i t b / il() od h ae f h ucinruie ht s o e / ue frsnigasnl caatr Nx feddfns / sd o edn ige hrce. et il eie / fnto t rciecaatr.Tenx oedfnsi / ucin o eev hrces h et n eie f / tesra t b stu cnb ue frraigcaatr, / h tem o e e p a e sd o edn hrces / wiigcaatr o bt. / rtn hrces r oh / t ko mr,vst / o nw oe ii: * / vi LDm(hrc) od Ccdca h {DOT=c; PR h COT=(<_ea_sDL) PR 1 dlyu(E1; COT=(<_ea_sDL) PR 0 dlyu(E2; i(h=x1|h=x2 fc=00|c=00) _ea_s1) dlym(0; }

www.circuitstoday.com/frequency-counter-circuit

3/8

1/31/13
itLDca c,FL *p n C(hr h IE f) {DOT=h PR c; COT=(<_ea_sDL) PR 1 dlyu(E1; COT=(<_ea_sDL) PR 0 dlyu(E2; rtr 0 eun ; } vi iiLD) od ntC( {CDR=(<DDR=0f; PD 1 PD xf LDm(x8; Ccd03) LDm(xf; Ccd00) LDm(x1; Ccd00) LDm(x2; Ccd00) } #ni / _C_F_ edf / LDCGH

Frequency Counter Circuit using Micro Controller

Download the HEX File


Frequency Meter Hex File

You may also like:


AVR Microcontroller Tutorial The complete guide to learn AVR How to work with the ADC unit of an AVR Micro-controller Working with External Interrupts in AVR micro controller How to Establish A PC-Micro controller USART communication How to Work With SPI in AVR Micro Controllers

We recommend:
Multi-channel audio mixer circuit using LM3900 Thyristor vs Transistor Sensitive Intruder Alarm Circuit Latest Research on Nanotechnology PWM inverter circuit
Search
Custom Search

Posted in AVR

Leave a Reply
Name (required) Mail (will not be published) (required) Website

www.circuitstoday.com/frequency-counter-circuit

4/8

1/31/13

Frequency Counter Circuit using Micro Controller

Submit Comment

Get Daily Updates via Email


Enter your email Subscribe

Latest Articles
Ultrasonic range finder using 8051 Digital tachometer using 8051 PWM lamp dimmer using NE555 PN Junction Diode and its characteristics Simple audio circuits Understanding the PN Junction Delay using 8051 timer The Best & Free Android Applications for the Electronics & Electrical Engineers How to debug in Keil Microvision What is Image Processing?An Introduction to basics

Categories
101-Announcements 555 Timer IC 8051 8051 projects Amplifier Circuits Arduino
www.circuitstoday.com/frequency-counter-circuit 5/8

1/31/13

Frequency Counter Circuit using Micro Controller

Audio Circuits Automotive Circuits AVR Basic Electricity Basic Electronics Battery Circuits C plus plus C Programming Cable TV Circuits Camera Technology Clipping and Clamping Circuits Clocking & Timer Circuits Conversion Circuits Counter Circuits Counters Digital Electronics Education & Training Electronic Components Electronic Keys & Locks Electronics Books Electronics Jobs Embedded Systems Equipment Reviews Events Fan Circuits Filter Circuits Fire Alarm Fun & Game Circuits Gadget Reviews Ham Radio Circuits High Voltage Circuits History Home Circuits Industrial Circuits Instruments Integrated Circuits Inverters Lab Manuals LED related Light Related Lighting Circuits MATLAB Microcontrollers Mobile Phone Related Motor Related Nanotechnology Oscillators Peripheral Interface Controller (PIC) Power Controller Circuits Power Electronics Power Supplies Project Ideas Projects Proximity Detectors Radio Circuits Radio Transmitters Raspberry Pi Relays Remote Circuits Reviews Robotics RTOS Security & Saftey Sensor Circuits Signal Conditioners Signal Generators Speed Controller Circuits State space analysis
www.circuitstoday.com/frequency-counter-circuit 6/8

1/31/13

Frequency Counter Circuit using Micro Controller

Switching Circuits Tech News Telephone Related Television Related Temperature Related Test & Measurement Circuits Testing Components Three phase circuits Timer Circuits Tone generator circuits Tools and Softwares Transmitters Tutorials UPS USB Circuits Videos VLSI Voltage Regulators

Like Us on Facebook
Circuitstoday.com
Like 10,987 people like Circuitstoday.com.

F acebook social plugin

Recent Comments
Anish on Transistor intercom circuit. RAVEN on Transistor intercom circuit. dileepa mahaegodage on Infrared motion detector circuit Anish on Remote Control Circuit Through RF Without Microcontroller Anish on Simple FM transmitter circuit. Anish on Working of Resistors Biju on Automatic LED Emergency Light-Modified Version priyanka singh on Working of Resistors Cee Em on Water Sensor Circuit with Alarm M.P.Saini on Water level Controller priyanka on Simple Water Level Indicator Ch.shashank on 100 Watt sub woofer amplifier. greeshma on Electronics Mini projects Mohit on Simple FM transmitter circuit. deepika rawal on Remote Control Circuit Through RF Without Microcontroller

Pages
About Advertise With Us Authors Buy Project Kits Datasheets Electronic Circuit Symbols Lab Manuals Electronic Circuits Lab Microcontroller lab Microprocessor Lab Privacy Policy Project Contests Sitemap
www.circuitstoday.com/frequency-counter-circuit 7/8

1/31/13

Frequency Counter Circuit using Micro Controller

Testing Components

Popular Tags
circuits circuit design circuit diagram Electronic Circuits Electronic Components Electronic Instruments Filter Circuits hobby circuits hobby projects Home Circuits IC Integrated Circuits Most Popular Circuits Nanotechnology NE555 timer Oscillators PIC Power Amplifiers Power Supplies Radio Circuits SCR Simple Electronics Projects Tech News Thyristors Tutorials VLSI Voltage Regulators
555 IC

555 timer Audio Amplifier Circuits Audio

Most Discussed
150 Watt amplifier circuit 100 Watt sub woofer amplifier. Automatic LED Emergency Light-Modified Version Mains Operated LED Circuit Suggest a Topic to Publish & Win a 8GB Pen Drive 2 km FM transmitter Automatic LED Emergency Light Copyright 2007 - 2011 Circuitstoday.com Designed by Web Design Cochin

www.circuitstoday.com/frequency-counter-circuit

8/8

S-ar putea să vă placă și