analog out to analog in

Hi everybody
I have a simple ( and maybe silly)question:
can I send analog output from one pws pin in an arduino to an analog input on another arduino without anything in btw?
thank you in advance

Not really, you can connect the pins, but analog input would report alternately the values 0 and 1023 (or values close to them). This is because the analog out uses pwm, quickly shifting between value 0V and 5V, so the average value over a longer time (10-20 milliseconds) is the value written to analogOut() .

You can place a low pass RC filter, a resistor and a capacitor, betwen the output and the input. This works but you cannot send very fast information.

If you can provide some further details on what you are trying to accomplish, we may be able to offer some solutions that don’t require too much extra circuitry or code.

Off the top of my head, you could do two things that might give you a suitable result in many cases:

  1. A simple RC filter between the pins
  2. In-code averaging of input samples.

Reply if you’d like any details on either of those.

The other problem is that the analogue in is 10 bits resolution, that is the numbers change from 0 to 1203 where as the PWM output has only 8 bit resolution, numbers change from 0 to 255.

You could feed the PWM output from one system to a digital input of the other, then you could use the pulse function to measure what is coming in.
However there are much better ways of transferring data between two system, look at I2C using the wire library, make on a master and the other a slave and transfer the numbers digitally.

thank you so much for your replys
its quite a simple experiment actually , im just trying to create something like a chain reaction btw several arduinos .
I have a a sound file in my computer and send the fft anallysis to the first arduino , I scale it btw 0 and 255 and now i want to send different values to different pwm pins (3 in total) in the arduino connected to the computer and then send from this to other arduinos as well.

For this kind of application, try it :slight_smile: