Qual motivo da porta Analogica de entrada do Arduino só le valores variado entre 0 e 255 ?

Olá galera, sou iniciante em arduino e me surgiu a seguinte dúvida  :

Qual motivo da porta Analógica de entrada do Arduino só lê valores variado entre 0 e 255 ?

Exibições: 622

Responder esta

Respostas a este tópico

Qual sketch esta usando?

O conversor ADC do Arduino UNO é de 10 bits. Isto é 1024 variações e não 255. 

2 elevado a 10 = 1024 !

https://www.arduino.cc/en/Main/ArduinoBoardUno

The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and the analogReference() function.

Olá José. Me surgiu a seguinte dúvida  : então esse conversor muda dependendo da placa  ? 

Atualmente uso Arduino mega 2560 .

Att Ewerton

Ewerton , no caso do Arduino Mega, ele tem o mesmo tipo de conversor ADC de 10 bits !

https://www.arduino.cc/en/Main/arduinoBoardMega2560

Arduino/Genuino Mega 2560 has 16 analog inputs, each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and analogReference() function.

Se precisa de maior resolução, como por exemplo conversor ADC de 12 bits (4096 graduações)  , use um Arduino Due :

https://www.arduino.cc/en/Main/ArduinoBoardDue

  • Analog Inputs: pins from A0 to A11 
    The Due has 12 analog inputs, each of which can provide 12 bits of resolution (i.e. 4096 different values). By default, the resolution of the readings is set at 10 bits, for compatibility with other Arduino boards. It is possible to change the resolution of the ADC withanalogReadResolution(). The Due’s analog inputs pins measure from ground to a maximum value of 3.3V. Applying more than 3.3V on the Due’s pins will damage the SAM3X chip. The analogReference() function is ignored on the Due.

E o mais legal, o DUE também tem conversores DAC de 12 bits: 

  • DAC1 and DAC2 
    These pins provides true analog outputs with 12-bits resolution (4096 levels) with the analogWrite() function. These pins can be used to create an audio output using the Audio library.

Acho que você está confundindo os valores do PWM, onde o tutorial diz: 

"The Fading example demonstrates the use of analog output (PWM) to fade an LED."

Porém, o PWM não é exatamente "analógico", e sim uma cadeia de pulsos onde o tempo de HIGH e LOW é controlado numa escala de 0 a 255, criando assim a ilusão ótica, num led, de redućão do brilho. Mas só está reduzindo o tempo que o led fica aceso. Como isso é muito rápido, teu olho não percebe e parece que a luz do led está "fraquinha".

Olhe:

https://www.arduino.cc/en/Tutorial/PWM

Olá Alexandre !

Obrigado pela definição. 

ATt : Ewerton Pontini

Olá Alexandre . 

Em questão ao 1024 bits que seria 2 elevado a 10 trata se em relação a entrada analogica ?

Posso afirmar que : 

a conversão de entrada analógica (Ex A0)é de 2 elevado a 10.

a conversão pwm (Ex ~9)é 2 elevado a 8 .

Att Ewerton Pontini

Olá Alexandre . 

Em questão ao 1024 bits que seria 2 elevado a 10 trata se em relação a entrada analogica ?

Posso afirmar que : 

a conversão de entrada analógica (Ex A0)é de 2 elevado a 10.

a conversão pwm (Ex ~9)é 2 elevado a 8 .

RSS

© 2024   Criado por Marcelo Rodrigues.   Ativado por

Badges  |  Relatar um incidente  |  Termos de serviço