Skip to content

anshu2k24/WebArduinoServo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Remote Arduino Servo Control via Node.js and VS Code Port Forwarding 💡

Control your Arduino-connected servo from anywhere using a Node.js server and VS Code’s port forwarding.

Features

  • Real-time servo control via Socket.IO
  • Node.js backend connected to Arduino via USB
  • Access your server remotely through VS Code port forwarding [Public]
  • Simple setup, no extra cloud cost
image

Prerequisites

  • Arduino Uno + servo [PWM digital pin ~9 for signals] connected to your laptop via USB
  • Node.js installed on your laptop
  • VS Code with Port Forwarding enabled

Setup and kick off

  1. Connect Arduino and Upload Servo Code

    • The servo script is saved within the [servoscript\servoscript.ino]
    • Upload the script onto arduino uno
    • Test it through the Serial port with commands ("l","r","c")
  2. Install serialport

    npm i socket.io serialport

    or just do

    npm i
  3. Start Node.js Server

    node server.js
  4. Forward the Server Port in VS Code

    • Open VS Code
    • Use the port forwarding feature
    • Forward your local server port (e.g., 3000) to a public port
  5. Access Your Server Remotely - Open the forwarded URL in your phone or any remote device to control your servo.

Security Considerations

  • This setup exposes your server over the internet — do not expose sensitive ports or services.
  • Add authentication in your Node.js app to restrict access if you plan to share your URL.

Boom 💣

Thats all we need to control the servo from anywhere! Have Fun.. 😜😁

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors