Arduino Nano R4 Built in Operational Amplifier – How to Use
by kevinjpower in Circuits > Arduino
23 Views, 0 Favorites, 0 Comments
Arduino Nano R4 Built in Operational Amplifier – How to Use
The Arduino Nano R4 includes a built in Operational Amplifier (Op Amp) which can be used for various purposes. Ever wondered how to use this built in Op Amp?
This project describes a simple application of the Op Amp
Supplies
Arduino Nano R4
10 kOhm variable resistor
Breadboard and wires
Arduino Nano R4 Operational Amplifier
The Op Amp can provide signal conditioning and amplification capabilities directly on the Nano board without the need for external circuits.
The Op Amp is connected to the following analog pins:
A1 Op Amp + Non-inverting input (+)
A2 Op Amp - Inverting input (-)
A3 Op Amp Out Amplifier output
The complete pin-out for the Nano R4 is included for completeness
When using the Op Amp function in the Nano R4, pins A1, A2 and A3 cannot simultaneously be used as analog inputs. The Op Amp positive supply (Vs+) is connected the 5V DC supply of the Nano R4 and the negative supply (Vs-) is connected to GND.
The OP Amp can be configured as a high speed or low speed version. Specs for the two versions are included in the official documentation for the Nano R4.
The low speed version will use less power.
In the low speed mode, a slew rate of 0.12 V/µs puts the Op Amp behind the classic 741 operational amplifier which has a typical slew rate of 0.5 V/µs. This means that it should not be used for medium to high speed applications.
In high speed mode, the gain-bandwidth product of 1.7 MHz would put the Op Amp in the category of a general operational amplifier, which typically have a gain-bandwidth product of between 1 and 3.
Building a Unity Gain Amplifier As a Incoming Signal Buffer
In the case of a signal that could be influenced by the input impedance of a ADC, it is usual to buffer the signal with a unity gain operational amplifier circuit. This simple circuit is shown, along with the breadboard implementation
Arduino Code
To startup the Op Amp, include the library OPAMP.h and call
where (speed) can be OPAMP_SPEED_LOWSPEED for lower power consumption or OPAMP_SPEED_HIGHSPEED for better performance.
The output from the Op Amp can be read directly from A3 using the analogRead(A3) command. This will convert the voltage at the Op Amp output via the ADC to a binary value dependent on the defined precision.
Downloads
Results
After setting up the circuit and uploading the code to the Nano R4, the serial monitor will display the voltage across the variable resistor RV1. The output will update as you change the variable resistor.