Hi Newbie here. But i have been trying to build a controller for a modular synth involving piezo disks. the concept is that i will code the Arduino to send out a given PWM voltage when the piezo displacement reaches a given threshold, which will then go through a LPF to give me a true DC voltage. I was just wondering if theoretically this is possible and if to send out a PWM signal all i need to do is connect the digital pin output to the input of my LPF and use the AnalogWrite with a value between 0 to 255, or does analogWrite need a power source. Any help is hugely appreciated thanks y'all :)
does analogWrite need a power source.
No but it needs a filter.
people talked about using a 741 op amp on the old post in this forum about this. what comes to my mind is a rectifier diode https://en.wikipedia.org/wiki/Rectifier A rectifier is an electrical device that converts alternating current (AC), which periodically reverses direction, to direct current (DC), which flows in only one direction. but if you had a trigger input on the modular synth, the pwm pulses themselves would be oscillations of the trigger. If what you are trying to do is make a cv signal of varying voltage and not just a 5v on /off trigger other people have used r2r ladders as dacs or real dacs for this purpose http://forum.arduino.cc/index.php?topic=7468.0 I would suggest doing this http://www.circuitstoday.com/frequency-to-voltage-converter-using-lm331 http://www.ti.com/product/LM331 The LMx31 family of voltage-to-frequency converters are ideally suited for use in simple low-cost circuits for analog-to-digital conversion, precision frequency-to-voltage conversion, long-term integration, linear frequency modulation or demodulation, and many other functions.
A 741 op-amp requires at least 12V to run it so it is not at all suitable for use with an Arduino, use an amp that will work off 5V, their are plenty about.
You do not need a diode period.
While you can make a ladder D/A any one you can make is not going to be very accurate and certainly not better than the 8 bit resolution you get with a PWM signal.