Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Resistors are one of the most fundamental and widely used components in electronics. They play a crucial role in controlling the flow of current, voltage division, and signal conditioning. Understanding resistors and their properties is essential for any electronics enthusiast or engineer.
Project: Creating a Voltage Divider Circuit
In this project, we will create a simple voltage divider circuit using resistors. The objective is to divide a given input voltage into a desired output voltage using resistors of specific values.
To build this circuit, we will need the following components:
Examples:
Example 1: Calculating the Output Voltage
int Vin = 5; // Input voltage
int R1 = 1000; // Resistance of R1 (1kΩ)
int R2 = 2000; // Resistance of R2 (2kΩ)
void setup() {
Serial.begin(9600);
}
void loop() {
float Vout = (Vin * R2) / (R1 + R2); // Calculate the output voltage
Serial.print("Output Voltage: ");
Serial.print(Vout);
Serial.println("V");
delay(1000);
}
Explanation:
Example 2: LED Brightness Control
int Vin = 5; // Input voltage
int R1 = 1000; // Resistance of R1 (1kΩ)
int R2 = 2000; // Resistance of R2 (2kΩ)
int ledPin = 9; // Pin connected to the LED
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
float Vout = (Vin * R2) / (R1 + R2); // Calculate the output voltage
analogWrite(ledPin, Vout * 255 / Vin); // Control LED brightness using PWM
delay(100);
}
Explanation: