Imagine you have two electrodes. Imagine you have a potentiometer for moduling an output, i.e. analogWriting in these two electrodes, using a transistor (when output is on, it is PWM signaling the electrodes----It should be as a DC motor speed regulation).
Imagine, that as they are electrodes, there can be two failures over time: they can do a short, or they can open circuit… So, you can do an alarm with an analog read, reading voltage in in these two electrodes, so, you use another analog in port to read these values.
While working without any failure, the analog value of potentiometer, and the analog value of the reading of electrodes, should keep some relation, some linearity…
It doesn’t happen. Values for the analog values of the readings for acting as alarm, are so different, that I can not use them.
So, what does it happen?
PD: If I read with a multimeter, when I turn the potentiometer, the reading in the electrode has all values stables, from 0 to5… But the analog read of Arduino is completely alternating values:…
So, the idea is to have an analog read from a PWM output. So, “is it posible to have an analog read from an output, where the output is a PWM output”?..and of course, values to be stable…
no_hay_linealidad_y_led_no_llega_a_tope.ino (560 Bytes)