An IoT enabled device that allows remote control of an LED light via the internet is being developed as part of this full-stack project. A Node.js backend and a React.js frontend are used in the system's construction, with an Arduino Nano serving as the main hardware component. By facilitating communication between the Arduino and the client interface, the backend server allows any internet-connected device to manage the LED's on/off status in real time. This configuration offers an easy-to-use interface for remote device administration and shows how IoT hardware may be seamlessly integrated with contemporary web technologies.
- Arduino Nano/UNO
- 5mm LED Light (1 piece)
- 220ohm resistor (1 piece)
- Micro USB Cable for Arduino Nano
- Mini breadboard
- Jumper wire
- Arduino IDE
- Node.js
Circuit connection is as follows:
- D2 pin(Arduino nano) to resister
- Resister to Anode Pin (LED)
- Cathode Pin (Led) to GND Pin (Arduino Nano)
Step-1 : Clone the repository First you need to clone the repository in your local machine.
git clone https://github.com/km-saifullah/iot-controlled-led.git
Step-2: Navigate to the toggle-led directory
cd toggle-led
Step-3: Upload the Arduino code into your Arduino
- Connect your Arduino board with your pc/laptop using the USB cable
- Open the Arduino IDE
- Select your Arduino board from the board section
- Choose the write port from the port option
Step-4 : Navigate to the client directory and run the client
cd client
npm install
npm run dev
Step-5: Start the fontend in your browser
http://localhost:5173
Step-6: Navigate to the server directory and run the server
cd server
npm install
Step-7: Change the code in the server.js file a bit
const port = new SerialPort({ path: "/dev/ttyUSB0", baudRate: 9600 });
Here, you need to replace the /dev/ttyUSB0 with your device port.
- Open your browser and hit this link
http://localhost:5173
- Turn on and off the led by pressing the button
Happy Coding...✌️✌️