Joystick - Blynk

This paper presents the design, implementation, and evaluation of a remote joystick interface using the Blynk IoT platform to control microcontroller-based devices (e.g., robots, servos, and motor drivers). We describe hardware selection, firmware architecture, Blynk app configuration, communication considerations, latency and reliability testing, and example applications. Results demonstrate that Blynk provides a rapid, cross-platform method for implementing touch-based joystick control with acceptable responsiveness for low-to-moderate real-time control tasks.

Solution: Wi-Fi control via Blynk cloud servers typically has 100-300ms delay. This is fine for a garden robot but bad for a race car.

| Parameter | Details | |-----------|---------| | Output Range | X: 0 to 1023, Y: 0 to 1023 (default) | | Center point | X=511, Y=511 (approx) | | Data Streams | 2 virtual pins (e.g., V0, V1) | | Mode | Dual axis or single axis | | Return to center | Configurable (spring-loaded style) | blynk joystick

Once you have the basic robot working, you can scale up your projects.

For this guide, let’s assume you are building the "Hello World" of joystick projects: A Pan/Tilt Servo Head. This creates a "spirit camera" that looks where you tell it to. The Schematic:

Ingredients:

The Schematic:


#define BLYNK_PRINT Serial
#include <WiFi.h>
#include <BlynkSimpleEsp32.h>
char auth[] = "YourAuthToken";
char ssid[] = "SSID";
char pass[] = "PASSWORD";
const int analogPinX = 34; // VRx
const int analogPinY = 35; // VRy
const int btnPin = 25;     // SW (optional)
BlynkTimer timer;
void sendJoystick() 
  int rawX = analogRead(analogPinX); // 0-4095 on ESP32
  int rawY = analogRead(analogPinY);
  // Map to -255..255 for joystick widget
  int x = map(rawX, 0, 4095, -255, 255);
  int y = map(rawY, 0, 4095, -255, 255);
  Blynk.virtualWrite(V0, x);
  Blynk.virtualWrite(V1, y);
void setup() 
  Serial.begin(115200);
  pinMode(btnPin, INPUT_PULLUP);
  Blynk.begin(auth, ssid, pass);
  timer.setInterval(100L, sendJoystick); // send every 100ms
void loop() 
  Blynk.run();
  timer.run();

Notes:

De volta ao topo