Skip to content

Commit

Permalink
Merge pull request #2240 from tah997/patch-6
Browse files Browse the repository at this point in the history
Grammar fixed and improvements to style opamp.md
  • Loading branch information
karlsoderby authored Oct 21, 2024
2 parents f613894 + a795c5e commit 1bf15e7
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ In this article, you will learn:

- [Arduino UNO R4 WiFi](https://store.arduino.cc/uno-r4-wifi)
- resistors
- Jumper wires
- jumper wires


## Operational Amplifier (OPAMP)
Expand Down Expand Up @@ -55,33 +55,33 @@ A voltage amplifier, as the name suggests, amplifies the voltage. A simple 2x am

***The amplified output signal should not go above ~4.7 V, otherwise clipping will appear and you can damage the board***

Below is a capture of an oscilloscope in which an approx. 2 V square wave (green, channel 2) is amplified to a 4 V square wave (yellow, channel 1) with the circuit shown below. The input signal was generated by a function generation (and shared GND was connected).
Below is a capture of an oscilloscope in which an approx. 2 V square wave (green, channel 2) is amplified to a 4 V square wave (yellow, channel 1) with the circuit shown below. The input signal was generated by a function generator (and shared GND was connected).

![Oscilloscope measurements](./assets/amp_screenshot.png)

But let's say you want to amplify the voltage signal 4x instead of 2x. The amplification of an OPAMP mainly depends on the chosen resistor values. Take a look at the formula below:

![Calculate resistor value](./assets/calc.png)

**Av** = Amplified Voltage (V)
**Av** = Amplified voltage (V)

**R1** = Resistor connected to Ground (Ω)
**R1** = Resistor connected to GND (Ω)

**R2** = Feedback resistor (Ω)

We know we want to amplify the voltage times four so:

**Av** = 4 V

Now, we need to figure out what resistors to choose. Because we only can solve for one unknown value we choose a predefined value for one of the resistors, e.g. 10k Ω for R1.
Now, we need to figure out what resistors to choose. Because we can only solve for one unknown value, we choose a predefined value for one of the resistors, e.g. 10k Ω for R1.

**R1** = 10k Ω

Your formula should now look like this:

![Add values to the formula](./assets/numCalc.png)

That leaves R2 as the only unknown variable. Now, Subtract one from both sides and multiply by ten, which leaves us with:
That leaves R2 as the only unknown variable. Now, subtract one from both sides. Next, multiply both sides by ten thousand (10k), which leaves us with:

**R2 = 30k Ω**

Expand All @@ -93,7 +93,7 @@ Your formula should now look like this:

## Code

To start up the opamp, simply include the library and call `OPAMP.begin(speed)`. As the optional `speed` argument to this function, can choose either `OPAMP_SPEED_LOWSPEED` as the low-speed (lower power) mode or `OPAMP_SPEED_HIGHSPEED` as the high-speed, high-power mode.
To start up the opamp, simply include the library and call `OPAMP.begin(speed)`. As the optional `speed` argument to this function can choose either `OPAMP_SPEED_LOWSPEED` as the low-speed (lower power) mode or `OPAMP_SPEED_HIGHSPEED` as the high-speed, high-power mode.

```arduino
#include <OPAMP.h>
Expand All @@ -104,4 +104,4 @@ void setup () {
void loop() {}
```
```

0 comments on commit 1bf15e7

Please sign in to comment.