Kontrol LED Arduino Uno di Proteus Menggunakan Blynk

1️⃣ Tujuan Praktikum

Setelah praktikum ini, peserta mampu:

  • Mensimulasikan Arduino Uno di Proteus
  • Mengontrol LED secara ON/OFF dari aplikasi Blynk
  • Memahami konsep IoT control berbasis cloud
  • Mengintegrasikan software simulator + mobile app

2️⃣ Dasar Teori Singkat

🔹 Arduino Uno

Arduino Uno adalah board mikrokontroler berbasis ATmega328P yang banyak digunakan untuk pembelajaran dan prototyping IoT.

🔹 Proteus

Proteus adalah software simulasi rangkaian elektronik yang mendukung simulasi Arduino dengan file .hex.

🔹 Blynk

Blynk adalah platform IoT yang memungkinkan kontrol perangkat melalui smartphone menggunakan:

  • Virtual Button
  • Cloud Server
  • Token autentikasi

📌 Catatan Penting
Proteus tidak bisa langsung terhubung ke internet, sehingga komunikasi Blynk dilakukan melalui Serial / Virtual Terminal (simulasi konsep).


3️⃣ Alat dan Bahan

🔧 Software

  • Arduino IDE
  • Proteus 8 Professional
  • Aplikasi Blynk IoT (Android / iOS)

🔩 Komponen di Proteus

  • Arduino Uno
  • LED
  • Resistor 220Ω
  • Virtual Terminal
  • Ground (GND)

4️⃣ Diagram Rangkaian (Proteus)

📌 Koneksi LED

Arduino Uno Komponen
Pin D13 Anoda LED
GND Katoda LED (via resistor 220Ω)

📌 Virtual Terminal

Arduino Virtual Terminal
TX (D1) RX
RX (D0) TX
GND GND

5️⃣ Konfigurasi Blynk

🔹 Buat Template

  1. Buka aplikasi Blynk IoT
    1. Daftar diwebnya Blynk
    2. Buka Email untuk Create Account
    3. Check Inbok Untuk Konfirmasi Setelah Create Account
  2. Create New Template
    1. Login ke Blynk
    2. Click on New Template
    3. Pilih Arduino sebagai  hardware.
    4. Pilih Wi-Fi sebagai tipe koneksi
    5. Buat nama templatenya (misal : bisaioti_blynk).
    6. Save the template.
  3.  Hardware: Arduino Uno(Untuk Mengintegrasikan Proteus dan Blynk maka perlu beberapa file yang harus kita download yaitu:)
    1. Download Blynk Library
      1. silahkan buka github
      2. download blynk library ( https://github.com/blynkkk/blynk-library)
      3. Install Comm0Comm (https://lcgamboa.github.io/picsimlab_docs/stable/Com0comInstallationandConfigurationWindows.html)

        1. Download com0com dan install
    2. Menambahkan Library Blynk Ke Arduino IDE
      1. Open Arduino IDE.
      2. Go to Sketch > Include Library > Add ZIPLibrary
      3. Pilih Librarynya.
      4. Click OPEN
  4. Setting & Konfigurasi Blynk
    1. Klik Devices > New Devices

    2. Copy the Authentication Token

    3. Buka Arduino sketch and paste the token di program
    4. Pastikan sekali lagi token dari blynk sudah benar
    5. Edit Blynk dashboard
    6. Add switch
    7. Configure switch parameters
    8. Create datastream
    9. Virtual pin
    10. Virtual pin v0
    11. Create
    12. Chose V0
    13. Save and apply

6️⃣ Program Arduino

📌 Sketch Arduino

#define BLYNK_TEMPLATE_ID ""
#define BLYNK_TEMPLATE_NAME ""
#define BLYNK_AUTH_TOKEN ""

#include <BlynkSimpleStream.h> // Use this for USB Serial connection
#include <SoftwareSerial.h>

// Create a serial connection (For USB Serial connection with Blynk)
SoftwareSerial DebugSerial(2, 3); // RX, TX

// Define the LED pin
#define LED_PIN 13

// Blynk auth token
char auth[] = "";

void setup() {
pinMode(LED_PIN, OUTPUT); // Set pin 13 as output
Serial.begin(9600); // Start Serial Monitor
Blynk.begin(Serial, auth); // Initialize Blynk using Serial
}

void loop() {
Blynk.run(); // Run Blynk process
}

// Blynk function to control the LED
BLYNK_WRITE(V0) {
int switchState = param.asInt(); // Read switch state from Blynk
digitalWrite(LED_PIN, switchState); // Turn LED on/off
}

📌 Generate File HEX

  1. Arduino IDE → Sketch
  2. Export Compiled Binary
  3. File .hex akan digunakan di Proteus

7️⃣ Langkah Simulasi di Proteus

  1. Buka Proteus → New Project
  2. Menambahkan Komponen di Proteus
    1. Open Proteus 8.
    2. Add an Arduino Uno.
    3. Add a virtual COM port and connect
      • TX (Transmit) of the COM port to RX (Receive) of Arduino.
      • RX (Receive) of the COM port to TX (Transmit) of Arduino.
  3. Konfigurasi Virtual Serial Port
    1. Install, Kemudian pilih komponen
    2. Lounch Setup
    3. Konfigurasi Port
  4. Modifikasi Script Blynk
    1. Open the Blynk script file
    2. Modify the port number to match your virtual COM port (e.g., COM4).
    3. Pastikan server port benar (8080 or 80).
  5. Upload Code ke Arduino
    1. Open Arduino IDE.
    2. Compile and upload your sketch.
    3. Ensure the correct board and port are selected.
  6. Jalankan Proteus dan blynk Script
    1. Right click the blynk-ser.bat and run as admin
    2. Open Proteus.
    3. Click Run Simulation.


 


1️⃣1️⃣ Pengembangan Lanjutan (Opsional)

  • Ganti LED dengan Relay
  • Gunakan ESP32 (real hardware)
  • Tambahkan monitoring status LED
  • Integrasi ke Node-RED Dashboard

 

Related Articles

Leave a Reply