user18398: I have moved the MCU of the Arduino to a breadboard using these steps https://www.arduino.cc/en/Main/Standalone then interfaced it with an LM35 temperature sensor to the ADC0. But I can't get proper values from the LM35. I think it's because of the Aref or AVcc. Both are just connected to +5? 
Here is my code:
float tempC;
float reading;

void setup()
{
    Serial.begin(9600);
}

void loop()
{
    reading = analogRead(0);
    tempC = (reading * 0.4882815) + 5;
    Serial.print(tempC);
    delay(1000);
}

I get hex values and sometime high values. What to do with Aref and AVcc?
EDIT: I get values like these 
€
Œ

user2926: Check the baud rate of your serial monitor matches what you have set in your setup() function.  In the above code that is 9600.  If the baud rate is incorrect you typically get rubbish output in the serial monitor.

You may also want to change the Serial.print(tempC) to
Serial.println(tempC,2);

To get some decimal places.
As for the circuit ~


You don't need ARef connected. 
The LM35 VCC should be connected to Arduino 5V 
The LM35 GND to Arduino Gnd (any of them) 
Finally LM35 signal (Vout) to Arduino A0.


user313: 
clearly it's not flashing every second.

Is it flashing about every .73 seconds? That would be the period you'd expect if you have a 22.000MHz crystal: period = (16/22 * 1.00 sec). (If so, that is a rather high over-clock rate for the chip but suggests just how hardy they really are.)

I haven't bought any 16 MHz crystal. What will I do?

Buy a 16MHz crystal. That's the right fix. But you might (if I guessed correctly that you have a 22MHz crystal) - might - get away with trying a baud rate of (16/22) times your present baud rate, de-rating it to compensate for the clock rate. Be as precise as you can. You'll need to reprogram the chip with your Arduino board because the chip's bootloader expects a 16MHz clock.
Or, if it's not 22MHz, you could time a number of blinks (50 or 100), calculate the clock rate error, and re-calculate a baud rate the way I did above. Use a lower baud rate to start with; it is likely to be less affected by small timing errors.

18398: <p>I have moved the MCU of the Arduino to a breadboard using these steps <a href="https://www.arduino.cc/en/Main/Standalone" rel="nofollow">https://www.arduino.cc/en/Main/Standalone</a> then interfaced it with an LM35 temperature sensor to the ADC0. But I can't get proper values from the LM35. I think it's because of the Aref or AVcc. Both are just connected to +5? 
Here is my code:</p>

<pre class="lang-c prettyprint-override"><code>float tempC;
float reading;

void setup()
{
    Serial.begin(9600);
}

void loop()
{
    reading = analogRead(0);
    tempC = (reading * 0.4882815) + 5;
    Serial.print(tempC);
    delay(1000);
}
</code></pre>

<p>I get hex values and sometime high values. What to do with Aref and AVcc?</p>

<p><strong>EDIT:</strong> I get values like these 
€
Œ</p>
 2926: <p>Check the <code>baud rate</code> of your serial monitor matches what you have set in your setup() function.  In the above code that is 9600.  If the baud rate is incorrect you typically get rubbish output in the serial monitor.</p>

<p><a href="https://i.stack.imgur.com/7oANR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7oANR.png" alt="Serial Monitor set at 9600 baud"></a></p>

<p>You may also want to change the Serial.print(tempC) to</p>

<pre><code>Serial.println(tempC,2);
</code></pre>

<p>To get some decimal places.</p>

<p>As for the circuit ~</p>

<p><a href="https://i.stack.imgur.com/vs7wj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vs7wj.png" alt="Ricardo Sequeria&#39;s example Arduio &amp; LM35"></a></p>

<ul>
<li>You don't need ARef connected. </li>
<li>The LM35 VCC should be connected to Arduino 5V </li>
<li>The LM35 GND to Arduino Gnd (any of them) </li>
<li>Finally LM35 signal (Vout) to Arduino A0.</li>
</ul>
 313: <blockquote>
  <p>clearly it's not flashing every second.</p>
</blockquote>

<p>Is it flashing about every .73 seconds? That would be the period you'd expect if you have a 22.000MHz crystal: period = (16/22 * 1.00 sec). (If so, that is a rather high over-clock rate for the chip but suggests just how hardy they really are.)</p>

<blockquote>
  <p>I haven't bought any 16 MHz crystal. What will I do?</p>
</blockquote>

<p>Buy a 16MHz crystal. That's the right fix. But you might (if I guessed correctly that you have a 22MHz crystal) - <em>might</em> - get away with trying a baud rate of (16/22) times your present baud rate, de-rating it to compensate for the clock rate. Be as precise as you can. You'll need to reprogram the chip with your Arduino board because the chip's bootloader expects a 16MHz clock.</p>

<p>Or, if it's not 22MHz, you could time a number of blinks (50 or 100), calculate the clock rate error, and re-calculate a baud rate the way I did above. Use a lower baud rate to start with; it is likely to be less affected by small timing errors.</p>
