Electronic Project 13: Amplification of signal using Op-amp & Arduino Uno

in #utopian-io8 years ago (edited)

What Will I Learn?

At the end of this tutorial:
The readers will be able to create an amplifier circuit to amplify signal to a certain signal level like a real amplifiers used in a sound system.

Requirements

**Electronic Components **
♦ Arduino Uno
♦ Speaker
♦ Resistor
♦ Piezo speaker
♦ Transistor
♦ Op-amp
♦ Breadboard
♦ Connecting wires

Software
♦ Fritzing application

Difficulty

♦ Advance

Tutorial Contents

Using the fritzing software, we will create our circuit diagram, arduino codes and prototype using the breadboard

Part I. Schematic Diagram
So first let us construct our circuit diagram.

  1. Open the fritzing software and click on schematic.
    image.png
  2. Select the electronic components needed for the circuit in the fritzing library. We need 1 arduino uno, 1 piezo speaker, 3 resistors, 1 battery, 1 transistor, and 1 op-amp.
    image.png
  3. Arrange the components before constructing the circuit.
    image.png
  4. Now let us construct our circuit diagram. The input of our circuit will be piezo speaker in which it is connected to the non-inverting terminal or our op-amp.
    image.png
    Then the input of our microcontroller will be the output of the op-amp which we will feed to the analog pin A2.
    image.png
    The output of our microcontroller will be connected to the base resistor of the transistor. This output signal will be amplified.
    image.png
    The amplified output at the collector terminal of the transistor is being fed to the speaker.
    image.png
    Connect the 5V supply to the piezo speaker and to the collector terminal of the transistor.
    image.png

Now our final circuit will look like this.
image.png
The input of our op-amp is the piezo speaker. The moment it detects sounds, a current will flow and this signal is then fed to the non-inverting input of the op-amp to be amplified.
image.png
Once it is amplified, it will flow through the input pin A2 of the arduino uno.
image.png
The arduino uno is programmed to give output at pin 9. This output is then fed to the input base resistor of the transistor to be amplified once again.
image.png
The amplified output from the collector terminal is connected to the speaker. Then the speaker will produce sound relative to its input signal.
image.png

Part II. Code
Now let us do programming of our Arduino uno.
Click on code to start
image.png
The input of our arduino is coming from the amplified output of the op-amp. Then the output will be at the transistor base resistor. So we declare the pin input and pin output.

int opPin= 2;
int resistorPin = 9;

image.png

Initial value of the output of the op-amp and the output value at pin 13.

Int opPinState = 0;

image.png

void setup(){
pinMode(resistorPin, OUTPUT);
}
void loop(){
opPinState = analogRead(opPin);
analogWrite(resistorPin,opPinState/4); 
delay(100);                                                         
}

image.png

Here are the arduino codes.

int opPin= 2; 
int resistorPin = 9;   
Int opPinState = 0; 
void setup(){ 
pinMode(resistorPin, OUTPUT); 
} 
void loop(){ 
opPinState = analogRead(opPin); 
analogWrite(resistorPin,opPinState/4); 
delay(100);                                                          
} 

Part III. Breadboard
Click on the breadboard.
image.png
Arrange each component in the breadboard before connecting.

image.png
Now connect each component if you don’t know how to connect using breadboard just read my previous tutorial about how to construct a circuit in the breadboard
image.png

Application

The readers can create their own amplifier for sound system.

link source

Curriculum

Here are my other tutorials for electronic projects.

**ELECTRONIC PROJECTS **

Tutorial 1
Tutorial 2
Tutorial 3
Tutorial 4
Tutorial 5
Tutorial 6
Tutorial 7
Tutorial 8
Tutorial 9
Tutorial 10
Tutorial 11
Tutorial 12



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @rfece143 I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Suggestions

  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!

Get Noticed!

  • Did you know project owners can manually vote with their own voting power or by voting power delegated to their projects? Ask the project owner to review your contributions!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.13
TRX 0.34
JST 0.034
BTC 113882.99
ETH 4406.16
SBD 0.86