Posts

Ir sensor using Arduino

An IR sensor project with Arduino Uno can be used for obstacle detection, line following, or remote control applications. Here's a simple guide: Components Needed - Arduino Uno - IR Sensor Module (e.g., VL53L0X or simple IR sensor) - Breadboard and jumper wires - LED (optional) Circuit Setup 1. Connect the IR sensor module to the Arduino:     - VCC to 5V pin     - GND to GND pin     - Signal pin to a digital pin (e.g., pin 2) Code For simple IR sensor: const int irPin = 2; void setup() {   pinMode(irPin, INPUT);   Serial.begin(9600); } void loop() {   int irValue = digitalRead(irPin);   Serial.println(irValue);   delay(100); } For obstacle detection with LED: const int irPin = 2; const int ledPin = 13; void setup() {   pinMode(irPin, INPUT);   pinMode(ledPin, OUTPUT); } void loop() {   int irValue = digitalRead(irPin);   if (irValue == LOW) {     digitalWrite(ledPin, HIGH); // Obstacle detected   }...

potentiometer controlled led using Arduino Uno

A potentiometer-controlled LED project is a great way to learn about analog inputs and PWM (Pulse Width Modulation) with Arduino. Here's a guide: Components Needed - Arduino Board (e.g., Arduino Uno) - LED - Potentiometer (10k-ohm or suitable) - Resistor (220-ohm or suitable for your LED) - Breadboard and jumper wires Circuit Setup 1. Connect the LED to a PWM-capable digital pin on the Arduino (e.g., pin 9). 2. Connect the potentiometer to analog input pins on the Arduino:     - VCC to 5V pin     - GND to GND pin     - Signal pin to an analog input pin (e.g., A0) Code const int potPin = A0; const int ledPin = 9; void setup() {   pinMode(ledPin, OUTPUT); } void loop() {   int potValue = analogRead(potPin);   int brightness = map(potValue, 0, 1023, 0, 255);   analogWrite(ledPin, brightness);   delay(50); } How it Works 1. The potentiometer's analog value is read by the Arduino. 2. The `map()` function converts the analog value (0-1023...

Button controlled led using Arduino Uno

A button-controlled LED project is a simple yet useful Arduino project. Here's a guide to get you started: Components Needed - Arduino Board (e.g., Arduino Uno) - LED - Pushbutton Switch - Resistor (220-ohm or suitable for your LED) - Breadboard and jumper wires Circuit Setup 1. Connect the LED to a digital pin on the Arduino (e.g., pin 13). 2. Connect the pushbutton switch to a digital pin on the Arduino (e.g., pin 2). 3. Connect the LED's cathode (short leg) to a resistor, and then connect the other end of the resistor to a GND pin on the Arduino. Code const int buttonPin = 2; const int ledPin = 13; void setup() {   pinMode(buttonPin, INPUT);   pinMode(ledPin, OUTPUT); } void loop() {   int buttonState = digitalRead(buttonPin);   if (buttonState == HIGH) {     digitalWrite(ledPin, HIGH);   } else {     digitalWrite(ledPin, LOW);   } } How it Works 1. The pushbutton switch is connected to a digital pin on the Arduino. 2. When the button...

Temperature sensor using Arduino Uno

A temperature sensor project with Arduino can be useful for monitoring temperature in various applications. Here's a simple guide: Components Needed - Arduino Board (e.g., Arduino Uno) - Temperature Sensor (e.g., LM35 or DS18B20) - Breadboard and jumper wires Circuit Setup 1. Connect the temperature sensor to the Arduino:     - VCC to 5V pin     - GND to GND pin     - Signal pin to an analog input pin (e.g., A0) Code For LM35: const int tempPin = A0; void setup() {   Serial.begin(9600); } void loop() {   int tempValue = analogRead(tempPin);   float temperature = (tempValue * 5.0 / 1024.0) * 100;   Serial.print("Temperature: ");   Serial.print(temperature);   Serial.println("°C");   delay(1000); } For DS18B20: #include <OneWire.h> #include <DallasTemperature.h> const int tempPin = 2; OneWire oneWire(tempPin); DallasTemperature sensors(&oneWire); void setup() {   Serial.begin(9600);   sensors.begin(...

Traffic light using Arduino Uno

Here's a simple guide to create a traffic light project using Arduino: Components Needed - Arduino Board (e.g., Arduino Uno) - 3 LEDs (Red, Yellow, Green) - 3 Resistors (220-ohm or suitable for your LEDs) - Breadboard and jumper wires Circuit Setup 1. Connect the LEDs to digital pins on the Arduino:     - Red LED to pin 9     - Yellow LED to pin 10     - Green LED to pin 11 2. Connect each LED's cathode (short leg) to a resistor, and then connect the other end of the resistor to a GND pin on the Arduino. Code const int redPin = 9; const int yellowPin = 10; const int greenPin = 11; void setup() {   pinMode(redPin, OUTPUT);   pinMode(yellowPin, OUTPUT);   pinMode(greenPin, OUTPUT); } void loop() {   // Red light   digitalWrite(redPin, HIGH);   digitalWrite(yellowPin, LOW);   digitalWrite(greenPin, LOW);   delay(5000); // Wait 5 seconds   // Green light   digitalWrite(redPin, LOW);   digitalWrite(yellowPin...

Blink led light using Arduino r3

Here's a simple guide to get you started with a blinking LED project using Arduino: Components Needed - Arduino Board (e.g., Arduino Uno) - LED - Resistor (220-ohm or suitable for your LED) - Breadboard and jumper wires Circuit Setup 1. Connect the LED's anode (long leg) to a digital pin on the Arduino (e.g., pin 13). 2. Connect the LED's cathode (short leg) to one end of the resistor. 3. Connect the other end of the resistor to a GND pin on the Arduino. Code void setup() {   pinMode(13, OUTPUT); // Set pin 13 as output } void loop() {   digitalWrite(13, HIGH); // Turn LED on   delay(1000); // Wait 1 second   digitalWrite(13, LOW); // Turn LED off   delay(1000); // Wait 1 second } How it Works 1. The `setup()` function sets the LED pin as an output. 2. The `loop()` function repeatedly turns the LED on and off with a 1-second delay between each state change. Upload and Enjoy! Upload the code to your Arduino board, and the LED should start blinking! 😊 Do you have...