Generate -5V to 5V signal from Arduino
2020-Jun-23, Tuesday 09:48 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
An Arduino microcontroller can generate a square wave on PWM pins to simulate an analog wave. But the wave alternates between 5V and 0V, it doesn't change polarity.
If you have a component that expects an AC signal you need to change the 0V to 5V signal to a -5V to 5V signal.
One simple way to do this is with a SparkFun Transceiver Breakout. Connect the Power pin to either 3.3V or 5V on the Arduino, GND to GND, T2IN to a PWM pin, and T2OUT to your component.
If you have a component that expects an AC signal you need to change the 0V to 5V signal to a -5V to 5V signal.
One simple way to do this is with a SparkFun Transceiver Breakout. Connect the Power pin to either 3.3V or 5V on the Arduino, GND to GND, T2IN to a PWM pin, and T2OUT to your component.
analogWrite()
your required frequency to control your component.
Back of SparkFun Transceiver Breakout with labelled pins visible
Photo by chebe