⚡ Electronics & Arduino Hub

Interactive Learning Platform for Electronics and Arduino Programming

Electronics Fundamentals

⚡ Ohm's Law

The fundamental relationship between voltage, current, and resistance in electrical circuits.

V = I × R

Voltage = Current × Resistance

Interactive Demo:





Resistance: 450 Ω

🔋 Voltage & Current

Understanding the flow of electricity and electrical potential difference.

Voltage (V): Electric potential difference - the "pressure" that pushes current through a circuit

Current (I): Flow of electric charge - measured in Amperes (A)

Power (P): P = V × I (Watts)

🔌 Circuit Types

Series vs Parallel circuits and their characteristics.

Series Circuit

Components in a line

Same current everywhere

Voltages add up

Parallel Circuit

Components side by side

Same voltage across each

Currents add up

⚡ Electrical Safety

Essential safety practices when working with electronics.

⚠️ Safety Rules:

  • Always disconnect power before making connections
  • Check polarity on batteries and components
  • Never exceed component voltage/current ratings
  • Use proper tools and work in a clean environment
  • Double-check connections before powering on

Resistor Color Code Calculator

🎨 Interactive Resistor Calculator

Select colors to calculate resistance values and learn the color coding system.

10 kΩ ±5%

💡 Memory Tip: "Big Boys Race Our Young Girls But Violet Generally Wins"

Black, Brown, Red, Orange, Yellow, Green, Blue, Violet, Gray, White (0-9)

Arduino Programming Guide

🤖 Arduino Basics

Arduino Uno has 14 digital pins, 6 analog inputs, and operates at 5V. Perfect for learning electronics!

💡 Blink LED Program

The "Hello World" of Arduino programming.

// Blink LED on pin 13 void setup() { pinMode(13, OUTPUT); } void loop() { digitalWrite(13, HIGH); delay(1000); digitalWrite(13, LOW); delay(1000); }
LED Status:

📊 Serial Communication

Communicate with your computer for debugging and data logging.

// Serial communication example void setup() { Serial.begin(9600); Serial.println("Arduino Ready!"); } void loop() { int sensorValue = analogRead(A0); Serial.print("Sensor: "); Serial.println(sensorValue); delay(500); }
Arduino Ready!
Sensor: 512
Sensor: 498
Sensor: 523

🎛️ Analog vs Digital

Understanding the difference between analog and digital signals.

Digital Pins (0-13)

  • HIGH (5V) or LOW (0V)
  • digitalWrite() & digitalRead()
  • Perfect for LEDs, buttons

Analog Pins (A0-A5)

  • 0-5V range (0-1023 values)
  • analogRead() & analogWrite()
  • Great for sensors

Arduino Projects

🚦 Traffic Light System

Create a realistic traffic light sequence using LEDs.

// Traffic light sequence int redPin = 13, yellowPin = 12, greenPin = 11; void setup() { pinMode(redPin, OUTPUT); pinMode(yellowPin, OUTPUT); pinMode(greenPin, OUTPUT); } void loop() { trafficSequence(); }

🌡️ Temperature Monitor

Read temperature from a sensor and display on serial monitor.

// LM35 temperature sensor void loop() { int reading = analogRead(A0); float voltage = reading * 5.0 / 1024.0; float temp = voltage * 100.0; Serial.print("Temperature: "); Serial.print(temp); Serial.println("°C"); delay(1000); }
Temperature: 23.5°C
Temperature: 23.7°C
Temperature: 23.4°C

🔊 Buzzer Alarm System

Create sound alerts with a piezo buzzer and button input.

// Buzzer alarm with button int buzzerPin = 8, buttonPin = 2; void setup() { pinMode(buzzerPin, OUTPUT); pinMode(buttonPin, INPUT_PULLUP); } void loop() { if(digitalRead(buttonPin) == LOW) { tone(buzzerPin, 1000, 500); delay(600); } }

💡 PWM Dimmer

Control LED brightness using Pulse Width Modulation.

// LED brightness control int ledPin = 9; int brightness = 0; void loop() { for(brightness = 0; brightness <= 255; brightness++) { analogWrite(ledPin, brightness); delay(5); } for(brightness = 255; brightness >= 0; brightness--) { analogWrite(ledPin, brightness); delay(5); } }

Quick Reference Guide

📋 Arduino Functions

Digital I/O

  • pinMode(pin, mode)
  • digitalWrite(pin, value)
  • digitalRead(pin)

Analog I/O

  • analogRead(pin)
  • analogWrite(pin, value)
  • analogReference(type)

Time & Serial

  • delay(ms) - Pause execution
  • millis() - Get current time
  • Serial.begin(baud) - Start serial
  • Serial.println(data) - Print data

🔧 Component Values

Common Resistor Values (Ω)

220, 330, 470, 1K, 2.2K, 4.7K, 10K, 22K, 47K, 100K

LED Forward Voltages

Red: 1.8-2.2V | Green: 2.0-2.4V | Blue: 3.0-3.4V | White: 3.0-3.6V

Standard Capacitor Values (μF)

0.1, 1, 10, 22, 47, 100, 220, 470, 1000

⚡ Voltage Levels

Arduino Uno Specifications

  • Operating Voltage: 5V
  • Input Voltage: 7-12V (recommended)
  • Digital Pin Current: 20mA max
  • Analog Resolution: 10-bit (0-1023)
  • Clock Speed: 16 MHz
  • Flash Memory: 32KB

🐛 Troubleshooting Tips

Common Issues & Solutions

  • Code won't upload: Check COM port & board selection
  • LED not lighting: Check polarity & current limiting resistor
  • Sensor readings erratic: Add pull-up resistors or capacitors
  • Serial monitor blank: Check baud rate matches code
  • Breadboard issues: Check power rails & loose connections

Sensors & Components

🌡️

Temperature Sensors

LM35, DHT22, DS18B20

Measure ambient temperature
💡

Light Sensors

LDR, Photodiode, TSL2561

Detect light intensity
🔊

Sound Sensors

Microphone, Sound detector

Detect sound levels
📏

Distance Sensors

HC-SR04, Sharp IR

Measure distance to objects
🧭

Motion Sensors

PIR, Accelerometer, Gyro

Detect movement & orientation
🌡️

Pressure Sensors

BMP180, BMP280

Measure atmospheric pressure

📏 Ultrasonic Distance Sensor

HC-SR04 sensor for measuring distances up to 4 meters.

// HC-SR04 Ultrasonic Sensor int trigPin = 9, echoPin = 10; void setup() { Serial.begin(9600); pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); } void loop() { long duration, distance; digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); duration = pulseIn(echoPin, HIGH); distance = duration * 0.034 / 2; Serial.print("Distance: "); Serial.print(distance); Serial.println(" cm"); delay(100); }
Distance: 25 cm
Distance: 23 cm
Distance: 28 cm

🌡️ DHT22 Temperature & Humidity

Digital sensor for temperature and humidity readings.

// DHT22 Sensor (requires DHT library) #include "DHT.h" DHT dht(2, DHT22); void setup() { Serial.begin(9600); dht.begin(); } void loop() { float h = dht.readHumidity(); float t = dht.readTemperature(); Serial.print("Humidity: "); Serial.print(h); Serial.print("% Temperature: "); Serial.print(t); Serial.println("°C"); delay(2000); }
Humidity: 65% Temperature: 22.5°C
Humidity: 64% Temperature: 22.7°C

💡 Light Dependent Resistor (LDR)

Simple analog sensor that changes resistance with light levels.

// LDR Light Sensor int ldrPin = A0, ledPin = 13; void setup() { Serial.begin(9600); pinMode(ledPin, OUTPUT); } void loop() { int lightLevel = analogRead(ldrPin); Serial.print("Light Level: "); Serial.println(lightLevel); if(lightLevel < 300) { digitalWrite(ledPin, HIGH); } else { digitalWrite(ledPin, LOW); } delay(500); }
Auto LED:
512