What Will I Learn?
At the end of this tutorial:
♦ The readers will be able to create a circuit that will display the function of an SR flip-flop
♦ The readers will be able to know how the circuit works.
♦ Learn to apply the circuit in making electronic projects that needs the function of an SR Flip-flop
Introduction
In this tutorial, we are about to learn and display the characteristics of an SR Flip-flop using LED lights and a buzzer.
So what is RS flip-flop?
RS Flip-flop is commonly used flip-flop also known as Set-Reset flip-flop. It has two inputs, S & R, S is to set the flip-flop and R is to reset the flip-flop. It has two outputs that is complement of one another.
You can read more here
Requirements
Electronic Components
♦ Arduino Uno
♦ Pushbutton
♦ Resistor
♦ Buzzer
♦Transistor
♦ LED
♦ 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 pushbutton, 7 resistors, 2 leds, 1 2 buzzers and 2 transistors.
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).
In this tutorial the input components will be the pushbutton and a resistor. The rest of the components are for the output side.
Now let us construct our circuit diagram. So at input side of our microcontroller is the pushbutton connected in series with a resistor. The pushbutton must be connected to a voltage source. So we will connect it to the 5V output from the arduino and the resistor directed to the ground.
At the output side of our microcontroller, we need two pins for our LED lights. I will use pin 12 & 13 as our output pin. So we connect an amplifier circuit at the two inputs to amplify the signal before connecting to the two LED.
Then the amplified output at the collector terminal of the transistor will be connected to the LED lights. This amplified signal can drive the two LEDs. We can put or connect a resistor before connecting the led to minimize the current flow through the led to avoid damaging the led.
Then for our buzzer, we connect it in parallel with the resistor and led connection. We connect it in series so that same voltage source supplied to the buzzer.
Here is our final circuit diagram.
When the pushbutton is press, the microcontroller will give an output as SET or 1 at pin 12. When it is not pressed, the output is Reset or otherwise 0 at pin 13.
A signal will flow at the input, then the pin 12 is high, so there is an output signal fed to the amplifier circuit. Then the amplified signal at the collector terminal will make the led and buzzer to operate.
As you can see in the figure below, two outputs, that is complement with each other. When q = 1, then the other output will be 0.
The output signal at the collector will flow through the led making it to give lights then also the buzzer will give a sound relative to the input value at the pushbutton.
Part II. Code
Now let us do programming of our Arduino uno.
Click on code to start.
The pushbutton serve as the two inputs (S & R) of the microcontroller.We declare the input and output pins for our microcontroller. Pin 2 is the input pin and pin 12 & 13 as the output pin.
int buttonPin = 2;
int res1Pin = 12;
int res2Pin = 13;
Our two inputs (S & R) will depends on the pushbutton activity. If it is pressed it will give “1” value and if not “0”. So we declare first the initial value of the pushbutton.
int buttonValue = 0;
Now we will set up our loop.
void setup(){
pinMode(buttonPin, INPUT); //set input pin 2
pinMode(res1, OUTPUT); //set output pin 12
pinMode(res2, OUTPUT); //set output pin 13
}
Now we will create a looping to our microcontroller.
void loop(){
if (digitalRead(buttonPin)==LOW){ //when pushbutton is not pressed (S =0)
digitalWrite(res1, HIGH); //give an output at pin 12
digitalWrite(res2, LOW); //no output at pin 13
}
else {
digitalWrite(res1, LOW); //if not, pin 12 has no output
digitalWrite(res2, HIGH); //while pin 13 will have an output
}
}
Here are our arduino codes.
int buttonPin = 2;
int res1Pin = 12;
int res2Pin = 13;
int buttonValue = 0;
void setup(){
pinMode(buttonPin, INPUT);
pinMode(res1, OUTPUT);
pinMode(res2, OUTPUT);
}
void loop(){
if (digitalRead(buttonPin)==LOW){
digitalWrite(res1, HIGH);
digitalWrite(res2, LOW);
}
else {
digitalWrite(res1, LOW);
digitalWrite(res2, HIGH);
}
}
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 SR flip-flop display.
Like the 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]
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
thanks @creon
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
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
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit