analogRead of analogWrite

Is there any problem doing analogRead of analogWritePin? I'm new on this and i realy realy don't want to damage my arduino. Does arduino have inside resistors that activates on and off? How much current does it flow through it when 5v is connected to digitalread? Are there any tips how to use it properly without doing someting bad to it?

AnalogWrite does not provides an analog signal but a digital signal with a variable duty cycle.

To obtain an analog Signal you must use à low pass filter .

Therefore a measure with analogRead risk nothing but will give an invalid value depending the signal is High or low when the ADC samples.

In spite of the similar names analogRead() and analogWrite() have nothing to do with each other.

analogRead() only works on the analog pins (A0 to A5 on the Uno).

analogWrite() causes a Pulse-Width-Modulated signal to appear on the PWM pins (3, 5, 6, 9, 10 and 11 on the Uno).

This means that analogRead() does not work on the pins that analogWrite() uses, and vice versa.

No harm will come to the Arduino if you apply 5v to any of the digital or analog pins as long as they have been set with pinMode(ppp, INPUT) - where ppp is the pin number. The voltage must be at least 0v and at most 5v to avoid damage.


What i was trying to do is to connect a pin which has pwm function to an analogpin input pin then to measure it. I don't see any problem, do you?

No, there is no problem, but don't expect the values you get to make much sense for duty cycles other than 0 and 100 %

Now i understand where's the problem. :D And how about reading the RMS value of that pin?

Apply a filter to get the average value. See:- There is no RMS value to measure because you do not have an AC signal just a pulsed DC signal.

Why RMS? You have no negative components.

Besides, you know what duty cycle you wrote.