In the previous Arduino electronics tutorial How to remove DC bias from Signal we showed how to remove dc bias from signal coming out of Arduino Due DAC0. Here we show how to attenuate the signal amplitude of signal coming out of Arduino Due DAC0. To attenuate the signal amplitude we can simply use a passive resistor divider circuit also called voltage divider circuit. We will also illustrate that when a signal passes through voltage divider circuit, not only is the signal attenuated but the dc bias is also removed.
Voltage Divider Circuit
The following circuit diagram shows a voltage divider circuit that can be used to attenuate signal amplitude.
In the circuit above, the resistor R1 and R2 forms the resistor divider circuit that is used as voltage divider. The output voltage Vout is taken from the junction of resistor R1 and R2. As you can see the input signal Vin consist of sine wave signal with amplitude of 2V and frequency of 100Hz with dc bias voltage of 4V. In other words, the sine wave rides on the 4V dc bias voltage.
The magnitude of the output voltage Vout is determined by the resistor values R1 and R2 as follows,
\[V_{out}=\frac{R2}{R1+R2} V_{in}\]
If R1 = R2 = 10KOhm, then the signal at the output Vout will be half of the input Vin. The following shows circuit diagram with 10KOhm resistors for R1 and R2 and the graph showing how the output signal Vout is attenuated to half of the input signal Vin.
One thing to note is that when a signal passes through a voltage divider circuit the signal is not only attenuated but also the dc bias is removed.
Experiment with Arduino
We can verify that the signal is attenuated using voltage divider circuit using Arduino. Here we will use the Arduino Due as a signal generator and Arduino Uno as the signal acquisition device. We will plot the signal on a real time graph. The codes for Arduino Due as signal generator and Arduino Uno for receiving the serial data and the program for plotting the graph is provided in the tutorial Real-Time Serial Graph with P5.js.
The following is the circuit diagram that shows Arduino Due whose DAC0 is connected to the resistor divider circuit of two 10KOhm resistors. The signal from the resistor divider circuit(voltage divider circuit) goes into the Arduino Uno A1 pin.
Before the insertion of the voltage divider circuit, the waveform is shown below.
After the insertion of the voltage divider circuit the waveform is as shown,
As you can see from the graph above, the signal is attenuated and the dc bias is removed.
Video demonstration
The following video demonstrates how to attenuate signal with voltage divider circuit.
So in this tutorial we have shown how to attenuate signal with voltage divider circuit which is helpful to learn when interfacing sensors with Arduino. In the tutorial Arduino UNO sine wave generator we show how we can generate sine wave signal with Arduino UNO.