RGB LED is the abbreviation of ‘’Red Green Blue Light Emitting Diode’’. RGB LED is the most amazing type of LED which has the ability to create millions of different shades of light colors using red, green, and blue colors.
Push buttons are the basic on-off switching buttons most commonly used in less to highly complex electronic devices. Push buttons are able to connect two points whenever they are pressed. Push-button acts as a manually operated control device. When the button is pressed that means the short circuit is achieved between two points. On the other side when the button is not pressed then the open circuit or no connection developed between the points.
The push-button has four legs but we can use only two of them because of their internal structure. We can connect the push button directly with the VCC or 5-volt power supply. After that when we press it then the software will read it as HIGH until we change the state and perform the operation. But when the button is released after that system will get confused and does not able to recognize what is connected in the input. As result, the software will read HIGH or LOW value non-uniformly and assume some noise in this condition, due to which unexpected output will be observed. To avoid this situation it is necessary to connect pull-up or pull-down resistors with the push button.
How to operate LED using a push button (with an internal pull-up resistor):
Arduino has internal pull-up resistors (which means the resistors are connected to power internally). If we do not want to connect an external pull-down resistor then we can use these internal resistors directly with the help of the INPUT_PULLUP argument in pinMode(). This connection effectively inverts the operation of the push button. In this example, as the button is not pressed then the LED will be in one state and as the button is pressed then the LED will be in the off state.
Required Component:
- 1 x Arduino Uno board...............................BUY
- 1 x LED.......................................................BUY
- 1 x push button............................................BUY
- Few jumper wires........................................BUY
- 1 x 220-ohm resistor....................................BUY
Connection diagram:
According to the connection diagram, the one terminal of the pushbutton is connected to the 5-volt power supply and the other terminal is connected with pin 7 of the board and GND. The shorter leg of the LED is connected with the GND and the longer leg is connected with pin 8 along with the 220-ohm resistor.
Code link: Click here
Output:
How to operate LED by push button (with external pull-down resistor):
In this example, as the button is pressed only then the LED will be on and as the button is not pressed then the LED will be off. LED will be “ON” only for the duration for which the button is pressed otherwise it will be off.
Required Component:
- 1 x Arduino Uno board
- 1 x LED
- 1 x push button
- Few jumper wires
- 1 x 220-ohm resistor
- 1 x 1 K ohm resistor
Connection Diagram:
According to the connection diagram, one terminal of the switch is connected to digital pin 7 and the other pin is connected to the 5-volt power supply pin of the Arduino board. The one terminal of the 1 K ohm pull-down resistor is connected with the switch and the other terminal is connected with the GND. The shorter leg of the LED is connected with the GND and the longer leg is connected with the digital pin 8 along with the 220-ohm resistor.
Code Link: Click here
Output:
How to operate buzzer using a push-button with Arduino Uno:
In this example, a buzzer is operated with the help of the push button. As the button is pressed then the buzzer will generate sound and as the button is released then the buzzer will stop immediately. Therefore buzzer will operate only for the duration for which the pushbutton is pressed. I have used the external pull-down resistor along with the push button.
Required Component:
- 1 x Arduino Uno board
- 1 x buzzer
- 1 x push button
- Few jumper wires
- 1 x 1 K ohm resistor
Connection Diagram:
Circuit Description:
A buzzer is a two-terminal (one is shorter leg and another one is longer leg) device. The longer leg of the buzzer is connected with pin 5 of the Arduino board. The shorter leg of the buzzer is connected with the GND terminal of the Arduino Uno board. As we know push button has a fore terminal and we can provide connection only on two of them because of their internal structure. One terminal of the pushbutton is connected with a 1 k ohm pull-down resistor and pin 8 of the Arduino board and another terminal is connected with the 5- volt power supply pin of the Arduino board.
This is excellent information about Side Exit Cable Gripper which is shared by you. This information is meaningful and magnificent for us to increase our knowledge about it. Keep sharing this kind of information. Thank you.
ReplyDeleteWe appreciate you sharing such excellent information with us. You are working so hard, and it shows. Everyone can benefit greatly from this information. Keep going. Thanks. Find out more details about led signs outdoor
ReplyDelete