Modifications

Sauter à la navigation Sauter à la recherche
190 octets ajoutés ,  3 octobre 2018 à 21:37
Ligne 56 : Ligne 56 :     
== Testing the sensor ==
 
== Testing the sensor ==
In the both case, the measured would be identical.
+
In the both case show here under, the measured temperature would be identical.
   −
However, by default, the Arduino's {{fname|analogRead()}} use a 10 bit coding. So the range of possible value return by {{fname|analogRead()}} is 0 to 1024 (for 0 to 3.3v). This means that the accuracy of reading is 3.3 / 1024 = 0.0032 Volts, so 3.2 mV.
+
{{ambox|text=However, if your project does need a high resolution analog reads then it may be appropriate to explore the "High Resolution Reading" example.}}
 +
 
 +
By default, the Arduino's {{fname|analogRead()}} use a 10 bit coding. So the range of possible value return by {{fname|analogRead()}} is 0 to 1024 (for 0 to 3.3v). This means that the accuracy of reading is 3.3 / 1024 = 0.0032 Volts, so 3.2 mV.
    
As the M0 does have an ADC (''Analog-to-Digital Converter'') with a precision of 12 bits, we could also use the {{fname|analogReadResolution( 12 )}} to upgrade the {{fname|analogRead()}} resolution to 12 bits. In such case, the range of possible value return by {{fname|analogRead()}} is 0 to 4095 (for 0 to 3.3v). As we have a real 12bit ADC, we can rely on that accuracy (it is not a 10 bits ADC storing the data into a 12 bits integer).
 
As the M0 does have an ADC (''Analog-to-Digital Converter'') with a precision of 12 bits, we could also use the {{fname|analogReadResolution( 12 )}} to upgrade the {{fname|analogRead()}} resolution to 12 bits. In such case, the range of possible value return by {{fname|analogRead()}} is 0 to 4095 (for 0 to 3.3v). As we have a real 12bit ADC, we can rely on that accuracy (it is not a 10 bits ADC storing the data into a 12 bits integer).
Ligne 115 : Ligne 117 :  
Which produce the following result on the Serial Monitor
 
Which produce the following result on the Serial Monitor
   −
[[Fichier:ENG-CANSAT-TMP36-60.png]]
+
[[Fichier:ENG-CANSAT-TMP36-60.png|640px]]
    
{{ENG-CANSAT-TRAILER}}
 
{{ENG-CANSAT-TRAILER}}
Ligne 167 : Ligne 169 :  
Which produce the following result on the Serial Monitor
 
Which produce the following result on the Serial Monitor
   −
[[Fichier:ENG-CANSAT-TMP36-70.png]]
+
[[Fichier:ENG-CANSAT-TMP36-70.png|640px]]
    
{{ENG-CANSAT-TRAILER}}
 
{{ENG-CANSAT-TRAILER}}
29 917

modifications

Menu de navigation