OC
OceanRemote
Low-code IoT platform
← Back to Course

Installing ESP8266 in Arduino IDE + First Code

🛠️ Installing ESP8266 in Arduino IDE

📋 Step-by-Step Installation:

Step 1: Add Board Manager URL

File → Preferences → Additional Boards Manager URLs:
https://arduino.esp8266.com/stable/package_esp8266com_index.json

Step 2: Install ESP8266 Board

Tools → Board → Boards Manager → Search "ESP8266" → Install "esp8266 by ESP8266 Community"

Step 3: Select Your Board

Tools → Board → ESP8266 → "NodeMCU 1.0 (ESP-12E Module)"
Select correct Port (Tools → Port)

📖 Test with Blink Sketch:

// ESP8266 Blink Sketch
// Built-in LED is usually on GPIO2 (NodeMCU)

#define LED_PIN 2

void setup() {
    pinMode(LED_PIN, OUTPUT);
    Serial.begin(115200);
    Serial.println("ESP8266 Starting...");
}

void loop() {
    digitalWrite(LED_PIN, LOW);   // Turn LED ON (active LOW)
    Serial.println("LED ON");
    delay(1000);
    
    digitalWrite(LED_PIN, HIGH);  // Turn LED OFF
    Serial.println("LED OFF");
    delay(1000);
}
    
💡 Troubleshooting:
  • "Failed to connect" → Press FLASH button while uploading
  • No port found → Install CH340 or CP2102 drivers
  • Compilation errors → Make sure ESP8266 board package is installed
✅ Success!

Your ESP8266 is now ready for IoT projects! The built-in LED should blink every second.

💡 Key Takeaways:
  • Apply these concepts directly to your farm or project.
  • Take notes on important details for the quiz.
  • Use the button below to track your progress.