EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / frequency measurement and display on LCD

frequency measurement and display on LCD

|

Microcontroller › AVR › frequency measurement and display on LCD

  • This topic has 8 replies, 3 voices, and was last updated 13 years, 5 months ago by AJISH ALFRED.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • May 13, 2012 at 8:53 pm #1797
    sanam
    Participant

    Dear reader,

                     could you please provide me code for sampling frequency readings from  555 timer oscillator into ATmega 16 kit. I am finding it difficult to count the frequency reading and display it in the LCD showing the level of water level measurement. From the hardware configuration i a have found frequency reading as follows

    at 0cm water level = frequency is 900khz

    at 1 cm ,872khz

    at 2 cm 864khz

        .

        .

        .

    at 30 cm, 435 khz

    how can intake this random frequency range into the atmega16 kit and display the output in the LCD.

    i would be most grateful for your support and guidance.

    Thank you.

    May 14, 2012 at 2:54 pm #7797
    Anonymous
    Guest

     

    Hi,

           Really interesting project. Could you please tell me how are you generating different frequencies according to the water level using 555 IC ?

    May 14, 2012 at 2:54 pm #7810
    Anonymous
    Guest

     

    Hi,

           Really interesting project. Could you please tell me how are you generating different frequencies according to the water level using 555 IC ?

    May 14, 2012 at 7:33 pm #7801
    sanam
    Participant

    Dear reader,

                      Lets say the experiment i am doing is divided into 4 parts like any other measurement device principle: 1) the sensing element, 2)The signal conditioning element 3)signal processing element and software 4)data presentation element.

    The sensing element in my experiment is the capacitive co-axial probe that operates using capacitive principle,As you immerse the probe in the water, the di-electric medium in between the 2 electrodes increase further increasing the capacitance. I have connected this probe to a frequency oscillator designed using a 555 timer in astable mode. The sensed signal is enhanced by this oscillator into a frequency domain. The frequency of the signal decreases as capacitance of the probe increases.WE have the relation as,

    f =1/(2*pi*(LC)^1/2) for an LC circuit

     

    f= 1.44/{(R1+2R2) C} for an RC circuit n this is my circuit and i have designed keeping my own values.

    hence, when the probe is immersed in the water at0 cm scale, the frequency received is 872khz,further more as i went on taking the reading,the final point i needed to take is at 30 cm scaling and i received 435khz. So there is a frequency range of 400khz to 900khz.now i need to feed this signal to the ATmega16 controller. Its bit tricky at this point. The data sheet for atmega16 can be found in the internet. I know frequency and time is inversely related and i need to use timers .how ever i am stuck at this point of writing the codes,if anyone could help ma,then please i ask for it ,your effort,guidance and sample codes could lead to my progress.

    thanking you 

     

    May 14, 2012 at 7:33 pm #7812
    sanam
    Participant

    Dear reader,

                      Lets say the experiment i am doing is divided into 4 parts like any other measurement device principle: 1) the sensing element, 2)The signal conditioning element 3)signal processing element and software 4)data presentation element.

    The sensing element in my experiment is the capacitive co-axial probe that operates using capacitive principle,As you immerse the probe in the water, the di-electric medium in between the 2 electrodes increase further increasing the capacitance. I have connected this probe to a frequency oscillator designed using a 555 timer in astable mode. The sensed signal is enhanced by this oscillator into a frequency domain. The frequency of the signal decreases as capacitance of the probe increases.WE have the relation as,

    f =1/(2*pi*(LC)^1/2) for an LC circuit

     

    f= 1.44/{(R1+2R2) C} for an RC circuit n this is my circuit and i have designed keeping my own values.

    hence, when the probe is immersed in the water at0 cm scale, the frequency received is 872khz,further more as i went on taking the reading,the final point i needed to take is at 30 cm scaling and i received 435khz. So there is a frequency range of 400khz to 900khz.now i need to feed this signal to the ATmega16 controller. Its bit tricky at this point. The data sheet for atmega16 can be found in the internet. I know frequency and time is inversely related and i need to use timers .how ever i am stuck at this point of writing the codes,if anyone could help ma,then please i ask for it ,your effort,guidance and sample codes could lead to my progress.

    thanking you 

     

    May 14, 2012 at 7:36 pm #7803
    sanam
    Participant

    i would be most grateful if anybody could help me.

    Thanking you

    May 14, 2012 at 7:36 pm #7813
    sanam
    Participant

    i would be most grateful if anybody could help me.

    Thanking you

    May 16, 2012 at 10:46 am #7835
    sanam
    Participant

    This is my approach but i am not getting anything. could u please help me where am i doing wrong.

    Your help and guidance is heartily acknowledged.

     

    #include <avr/io.h> 
    #include <util/delay.h> 
    #include <stdio.h> 
    #include <avr/interrupt.h> 
    #include <compat/ina90.h>    
     
    #include “easyavr_lcd.c”    
     
    volatile ov_counter; 
    unsigned long frequency; 
     
     
    ISR(TIMER1_CAPT_vect) 
    { 
       // Counter to 0 
       TCNT1 = 0; 
      
       // The result is valid only if the counter 
       // has not overflowed yet 
       if (!(TIFR & (1 << TOV1))) 
       { 
          // Calculating the frequency from the period 
          frequency = (unsigned long)8000000 / 
                      (unsigned long)ICR1; 
       } 
        
    } 
     
    ISR(TIMER1_OVF_vect){ 
       ov_counter++; 
    } 
     
    void init_timer(){ 
     TCCR1B = (1<<ICES1)  | (1<<CS10); 
      TIMSK = (1<<TICIE1) | (1<<TOIE1); 
    } 
     
    int main(){ 
      
       DDRB = 0x00; 
      
        
       init_timer(); 
             lcdinit(); 
    lcdmsg(“CURRENT LVL”,1); 
     
     
        
    char a1[7]; 
        sei(); 
       while(1){ 
    lcdmsg(“CURRENT LVL”,1);    
      
        
        itoa(frequency, a1, 10); 
        lcdmsg(a1,2); 
          lcdmsg(“CURRENT LVL”,1); 
          _delay_ms(500); 
       lcdclr(); 
      
       } 
       return 1; 
    } 
     
    May 21, 2012 at 6:19 pm #7863
    AJISH ALFRED
    Participant

     

    The LCD is your only output device; you are not getting means, no display on LCD?

    First thing I’ve noted in your code is the refereshing rate. Try giving a bit more delay around 2 seconds before clearing the LCD inside the while loop.

  • Author
    Posts
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • WTB: "The Theory Of Servicing AM, FM, And FM Receivers" by Clarence R. Green and Robert M. Bourque November 10, 2025
  • Anyone In The US Ordered From AliExpress Recently? November 10, 2025
  • Calculation of A Class amplifier November 10, 2025
  • strange laptop problem November 10, 2025
  • restarting this Christmas project November 10, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise