What Will I Learn?
At the end of this tutorial:
♦ The readers will be able to create an automatic alarm system using the force sensitive resistor, buzzer, relay and arduino uno.
♦ The readers will be able to know how the circuit works.
♦ Learn to apply the circuit in the future electronic projects
Introduction
In this tutorial, we will create an automatic alarm system using the force sensitive resistor and a buzzer including relay and arduino uno. The buzzer will give sounds automatically when the force sensitive resistor activates.
You can read more about Force Sensitive Resistor Here
Requirements
Electronic Components
♦ Arduino Uno
♦ Force Sensitive Resistor
♦ Resistor
♦ Transistor
♦ Buzzer
♦ Relay
♦ 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.
Select the electronic components needed for the circuit in the fritzing library. We need 1 arduino uno, 1 Force Sensitive Resisitor, 1 transistor, 1 buzzer, 1 switch and 2 resistors.
Arrange the components before constructing the circuit.
In arranging the components, place all the components for the input side (left side) of the arduino and the components for the output side (right side).
Our input component will be the fsr sensor and at output side we have the amplifier circuit and the buzzer. Our amplifier circuit is compose of 2 resistor and 1 transistor.
Now let us construct our circuit diagram.
At the input side of our circuit, we have the force sensitive resistor sensor. This sensor has two pins, 1 for source voltage, one for the input data signal and for ground terminal. So now, we will connect the fsr sensor to the 5v source from the arduino uno and the other terminal for the analog pin 3 of our microcontroller as you can see in the figure below.
At the output side of our circuit, we need only one output pin that will be connected to our amplifier circuit. You can select which digital output pin do you like, for this tutorial I will use pin 13.
The amplified output from the collector terminal of our amplifier circuit will be fed to the external series circuit compose of the switch and the buzzer.
Now this is our final circuit diagram.
Once our fsr sensor detects force, its resistance will change proportional to the force being applied. If the resistance decreases, it allows current to flow through the pin 3 of our microcontroller that will be serve as the input signal.
Upon receiving the input signal from the fsr sensor, our microcontroller was programmed to give an output signal to pin 13.
This output signal from pin 13 is then fed to the base resistor of our amplifier circuit to be amplified. Once amplified, it will be connected to the switch and buzzer. This signal will triggers the buzzer to give an alarm. The purpose of the switch is to manually on or off the buzzer if the fsr sensor continues to detect forces.
Part II. Code
Now let us do programming of our Arduino uno.
Click on code to start.
The input pin for our microcontroller is the pin 3 and for the output pin is pin 13.
int fsrPin = 3 ; // select the input pin for the fsr sensor
int resPin = 13; // select the pin for the base resistor
int fsrValue = 0// initial value store from our fsr sensor
void setup() {
// declare each Pin as an INPUT:
pinMode(fsrPin, INPUT);
// declare each pin as an OUTPUT:
pinMode(resPin, OUTPUT);
}
void loop() {
// read the fsr and store it in the variable fsrValue:
fsrValue = analogRead(fsrPin);
// if the force sensitive resistor detects force
if (fsrValue >= threshold) {
digitalWrite(resPin, HIGH);
else if
digitalWrite(resPin, LOW);
}
Here are our arduino codes.
int fsrPin = 3 ; // select the input pin for the fsr sensor
int resPin = 13; // select the pin for the base resistor
int fsrValue = 0// initial value store from our fsr sensor
void setup() {
// declare each Pin as an INPUT:
pinMode(fsrPin, INPUT);
// declare each pin as an OUTPUT:
pinMode(resPin, OUTPUT);
}
void loop() {
// read the fsr and store it in the variable fsrValue:
fsrValue = analogRead(fsrPin);
// if the force sensitive resistor detects force
if (fsrValue >= threshold) {
digitalWrite(resPin, HIGH);
else if
digitalWrite(resPin, LOW);
}
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 automatic buzzer alarm using the fsr sensor and a relay like this example below.
Curriculum
Here are my other tutorials for electronic projects.
ELECTRONIC PROJECTS
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]
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