Electronic Project 13: Amplification of signal using Op-amp & Arduino Uno
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.
- Open the fritzing software and click on schematic.
- 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.
- Arrange the components before constructing the circuit.
- 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.
Then the input of our microcontroller will be the output of the op-amp which we will feed to the analog pin A2.
The output of our microcontroller will be connected to the base resistor of the transistor. This output signal will be amplified.
The amplified output at the collector terminal of the transistor is being fed to the speaker.
Connect the 5V supply to the piezo speaker and to the collector terminal of the transistor.
Now our final circuit will look like this.
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.
Once it is amplified, it will flow through the input pin A2 of the arduino uno.
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.
The amplified output from the collector terminal is connected to the speaker. Then the speaker will produce sound relative to its input signal.
Part II. Code
Now let us do programming of our Arduino uno.
Click on code to start
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;
Initial value of the output of the op-amp and the output value at pin 13.
Int opPinState = 0;
void setup(){
pinMode(resistorPin, OUTPUT);
}
void loop(){
opPinState = analogRead(opPin);
analogWrite(resistorPin,opPinState/4);
delay(100);
}
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.
Arrange each component in the breadboard before connecting.
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
Application
The readers can create their own amplifier for sound system.
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
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
thank you @fuzeh
Hey @rfece143 I am @utopian-io. I have just upvoted you!
Achievements
Suggestions
Get Noticed!
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
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