
This circuit uses a pushbutton to control a 5V relay, which in turn powers a red LED. The MAHIR 1.mini module provides the necessary 3.7V power supply, and the relay switches the LED on and off based on the pushbutton input.
A 5mm red light-emitting diode (LED) is a compact and efficient electronic component that emits red light when an electric current flows through it. It is widely used in various applications due to its low power consumption, long lifespan, and reliability. Commonly, this LED is used as an indicator in electronic devices, status displays, and decorative lighting.

This circuit uses a pushbutton to control a 5V relay, which in turn powers a red LED. The MAHIR 1.mini module provides the necessary 3.7V power supply, and the relay switches the LED on and off based on the pushbutton input.

This circuit uses an Arduino UNO to control a red LED. The LED is connected to the Arduino's digital pin D2 through a 220-ohm resistor, and the Arduino is programmed to blink the LED on and off every 5 seconds.

This circuit uses a pushbutton to control a 5V relay, which in turn controls the power to a red LED. The MAHIR 1.mini module provides the necessary power and ground connections for the relay.

This circuit consists of a red LED connected to a MAHIR 1.mini power source. The anode of the LED is connected to the 3.7V pin, and the cathode is connected to the GND pin, allowing the LED to light up when powered.
The following are the key technical details of the 5mm red LED:
| Parameter | Value |
|---|---|
| Forward Voltage (Vf) | 1.8V to 2.2V |
| Forward Current (If) | 20mA (typical), 30mA (maximum) |
| Reverse Voltage (Vr) | 5V (maximum) |
| Wavelength | 620nm to 630nm (red light) |
| Viewing Angle | 20° to 30° |
| Power Dissipation | 60mW (maximum) |
| Operating Temperature | -40°C to +85°C |
| Package Size | 5mm (diameter) |
The 5mm red LED has two pins:
| Pin Name | Description |
|---|---|
| Anode (+) | The longer leg of the LED. Connect this to the positive terminal of the circuit. |
| Cathode (-) | The shorter leg of the LED. Connect this to the negative terminal or ground. |
Determine the Resistor Value: To prevent damage to the LED, a current-limiting resistor must be used. The resistor value can be calculated using Ohm's Law: [ R = \frac{V_{supply} - V_f}{I_f} ]
For example, if (V_{supply} = 5V) and (V_f = 2V): [ R = \frac{5V - 2V}{0.02A} = 150\Omega ]
Connect the LED:
Power the Circuit: Apply the appropriate voltage to the circuit. The LED will emit red light.
The 5mm red LED can be easily interfaced with an Arduino UNO. Below is an example circuit and code:
// Example code to blink a 5mm red LED connected to pin 13 of Arduino UNO
// Define the pin where the LED is connected
const int ledPin = 13;
void setup() {
// Set the LED pin as an output
pinMode(ledPin, OUTPUT);
}
void loop() {
// Turn the LED on
digitalWrite(ledPin, HIGH);
delay(1000); // Wait for 1 second
// Turn the LED off
digitalWrite(ledPin, LOW);
delay(1000); // Wait for 1 second
}
LED Does Not Light Up:
Cause: Incorrect polarity.
Solution: Ensure the anode is connected to the positive terminal and the cathode to ground.
Cause: No current-limiting resistor or incorrect resistor value.
Solution: Use a resistor with the correct value as calculated above.
LED is Dim:
LED Burns Out Quickly:
Flickering LED:
Q: Can I connect the LED directly to a 5V power supply?
A: No, you must use a current-limiting resistor to prevent damage to the LED.
Q: What happens if I reverse the polarity of the LED?
A: The LED will not light up, and prolonged reverse voltage may damage it.
Q: Can I use the LED with a 3.3V power supply?
A: Yes, but you still need to calculate and use an appropriate resistor to limit the current.
Q: How do I connect multiple LEDs in a circuit?
A: You can connect LEDs in series or parallel, but ensure each configuration has the correct resistor values to limit current.
This documentation provides all the essential details to use a 5mm red LED effectively in your projects.