NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Support Forum » slowing down the tempsensor
August 16, 2010 by Ralphxyz |
I am getting to many readings how would I read the tempsensor only every minute? Even with no powered sensor there is always a changing millivoltage (101.1 - 103.5 more or less) on the ADC pin. If i power on the MCU and the sensor I get a constantly changing 361 to 365 milivolt reading, this is without any voltage coming from the sensor the sensor is just not reading anything (I am using a strain gage not the temperature sensor but milivolts are milivolts so I can just use the same code except for LCD display text). How can I zero out the readings when there isn't any load? The 360 milivolt is approximately what I get with a 40# weight on the scale so I cannot ignore that voltage range. I also would like to slow down the sensor reading and only read every minute, whatever I have tried just blanks the LCD. Thanks again for the help, Ralph |
---|---|
November 17, 2010 by tkopriva |
Where you able to slow down the temperature readings? I am having the same issue--my lcd just goes blank no matter what I change it to. |
November 30, 2010 by exussum |
You would need to modify that section of code. Maybe putting ADCSRA |= (1<<ADSC); at the top just under uint16_t adc_read() { That would start the reading each time the function is called. wait for the reading to be finished and return it. Then add a sleep(600); somewhere in the while (1) {} Statement. 600 comes from 60,000 Milliseconds in a Minute, Need a 100 Sample average so divide 60,000 by 100 gives 600, Which will be give or take a Minute |
Please log in to post a reply.
Did you know that interrupts can be used to trigger pieces of code when events happen? Learn more...
|