anemometer interface with AVR

Status
Not open for further replies.
Hi Eric

can u plz send me the screen shot of the lts file naz2.asc which had the pt1000s in it as i am not able to open the .asc file that u sent me...

thnx

hi naz,
Screenshot as requested.
 

Attachments

  • AAesp01.gif
    7.9 KB · Views: 738
  • AAesp03.gif
    8.7 KB · Views: 625
Last edited:
simulation results

Hi Eric,

I have attched the simulation results using two different values of resistors... plz do comment as to what you think of the circuit..

Thank u for the screenshot of the file, could u also plz post the screen shot of the graph for the same pt1000 circuit...

Thanks
 

Attachments

  • Simulation results fro 100 and 470 ohms.doc
    165 KB · Views: 583

hi naz,
The doc file you have posted is the same as the other day,?? it dosnt work.

EDIT:
Try to simulate this option.
 

Attachments

  • naz83_v1.gif
    26.6 KB · Views: 632
Hi
could you please help me with this part of the coding...

my initial value is 2.88v that should display 0 m/s i.e the velocity.. and for every 0.15v increase in voltage thereby should increase the velocity by 1m/s..

Please do help me as to how to include this in my code and perform the above function..

Thanks
 
hi naz.
Can you post the program code that you have already written.?
 
hi Eric

The code is as shown below... even though it compiles fine it does not display anything on the lcd... I am not sure of the functions used to write to LCD and the library used as this is new to me...

#include <avr/io.h>
#include "lcd_lib.h"
#include <util/delay.h>
void init(void)
{
LCDinit(); //initialises LCD
LCDGotoXY(0, 0); //Cursor Home

}
void delay1s(void)
{
uint8_t i;
for(i=0;i<100;i++)
{
_delay_ms(10);
}
}
int main (void)
{
int buffer[7];
int num ;
init ();


DDRB |= (1 << 2); // Set LED1 as output
DDRC = (1 << 0); // Set LED2 as output

ADCSRA |= (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0); // Set ADC prescalar
ADMUX |= (1 << REFS0) | (1 << REFS1); // Set ADC reference to 2.56V
ADMUX |= (1 << ADLAR); // Left adjust ADC result

// No MUX values needed to be changed to use ADC0

ADCSRA |= (1 << ADATE); // Set ADC to Free-Running Mode
ADCSRA |= (1 << ADEN); // Enable ADC
ADCSRA |= (1 << ADSC); // Start A2D Conversions
for(; // Loop Forever
{
ADCH = num ; // convert integer into string
Itoa ( num , buffer, 10);
Printf ("The velocity is");
Printf ("%d", ADCH);

if(ADCH < 128)
{
PORTB|= (1 << 2); // Turn on LED1
PORTC &= ~(1 << 0); // Turn off LED2
}

else
{
PORTB &= ~(1 << 2); // Turn off LED1
PORTC|= (1 << 0); // Turn on LED2
}
}
delay1s();
delay1s();
}


The code above is written to perform the analogue to digital conversion and for the display on the LCD. The first part of the code is to initialise the LCD for it to be ready to display. Then the ADC is initialised by setting the various bits of the ADCSRA register and ADMUX register. The result is left adjusted to read only the eight bits of the register. Only eight bits of the ADC is used so the resolution is only 256 bits. I have set port B and Port D LEDs just to indicate if the value contained in ADCH is above 128 or below 128.
 
The Code can't run, because there is a hardware problem.

You write you are using the reference of the A/D Converter of 2.56V.
The measured Voltage must been lower then 2.56V.
All higher voltages will be shown as 0xFF.

You could insert an resistor divider that divides the sensor Voltage by 2.

I won't use the ADLAR Bit. You have a resolution of 8Bit ( 256 Steps ) only.
The A/D Converter has an full resolution of 10Bit ( 1024 Steps ).
The results has lower steps when using 10Bit.

In 10 Bit resoluten one Step has an voltage increasing of 2.5mV ( 2,56V/1024 ).
75mV ( 1m/s; 150mV/2 ) generates 30 Steps.
A Voltage of 1.44V ( 2,88 /2 ) generates an A/D Output value of 576.

OK i try to built a Speed formula with an 10 Bit A/D Converter.
if(AD_Result>576)
{
Speed= ((AD_Result-576)*10)/30; /*Speed must been divided by 10 finally. First Subtract Zero Voltage Value from AD_Result.
Then multiply by 10 to get one Number after Point. Then Divide by 30 to get real wind speed Values*/
}
else
{
Speed=0; //Avoid negative Results
};
/* Now you only have to format the Result */
speedl=Speed%10; //Get the Number after point
speedh=Speed/10; //Get the Numbers before point
itoa(speedh,string);
lcd_puts(string);
lcd_putsf(".");
itoa(speedl,string);
lcd_puts(string);
lcd_putsf(" m/s");

I'll hope I've calculated right...
 
Last edited:
Hello,

somebody have tried wind flow circuit? Please suggest me a circuit for 10k NTC thermistor, I need to measure up to 20m/s wind velocity. I have 10V power supply.

What is the difference between #61 post circuits? Both can measure wind velocity?
 
What is the difference between #61 post circuits? Both can measure wind velocity?
hi valforf,

The left side circuit uses a thermistor, on the right side circuit it uses two transistors [ measuring change in Base/Emitter voltage versus temprature.

E
 
hi valforf,

The left side circuit uses a thermistor, on the right side circuit it uses two transistors [a measuring change in Base/Emitter voltage versus temprature.

E
Thank you for your reply. Let say I have 10k NTC thermistor and I would like to use the first circuit. What power supply and other resistor values of the bridge I should use? Is it enough 10V to heat a 10k thermistor when wind is blowing?
 

Attachments

  • AAesp01.gif
    7.9 KB · Views: 377
hi v,
Look at this Tool link, it should help with your project.
https://www.electro-tech-online.com/tools/ThermPlotV2.php

Ideally you should have 'matched' thermistors.
One exposed to the airflow, which would cool and its resistance increase and the other at the same ambient temperature as the first, but not exposed to the airflow.

That would compensate for changes in the ambient temperature.

Calibration can be a problem.

E
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…