Introduction: Control LED From Internet Using Raspberry Pi Pico W | Step by Step Guide
We are going to make remote controlled LED, which can be controlled from anywhere in world. For this project we are using DWEET.IO website, which is free to use and best for beginners.
The Raspberry Pi Pico W, a microcontroller with built-in Wi-Fi, opens a lot of possibilities for IoT projects, including the ability to control devices from anywhere in the world. In this tutorial, we will learn how to control an LED over the internet using a Raspberry Pi Pico W.
Supplies
- Raspberry Pi Pico W
- LED (Light Emitting Diode)
- 220-ohm resistor
- Breadboard and jumper wires
- Micro USB cable for programming
- Thonny IDE installed on your computer
Step 1: Setting Up the Hardware
- Connect the LED to the Raspberry Pi Pico W: Insert the LED into the breadboard. Connect the long leg (anode) of the LED to GPIO 0 of the Pico W through a 220-ohm resistor. Then, connect the short leg (cathode) directly to one of the ground (GND) pins on the Pico W.
- Power Up: Connect your Raspberry Pi Pico W to your computer using a Micro USB cable. The device should power up immediately.
Step 2: Installing MicroPython
To control the Pico W from the internet, we'll use MicroPython, a lean and efficient version of Python designed for microcontrollers.
- Download the latest MicroPython firmware for the Raspberry Pi Pico W from the official website.
- Install the firmware using the Thonny IDE. Go to Tools > Options > Interpreter, select MicroPython (Raspberry Pi Pico), and follow the prompts to install the firmware.
Checkout this Getting Started Guide: How To Get Started with Raspberry Pi Pico
Step 3: Create Thing on DWEET.IO
Step 4: Grab the Thing URL From DWEET.IO
- Click on GET request
- Provide the created thing name in the parameter "led_control"
- Click on Try it out!
- Grab the request URL https://dweet.io:443/get/latest/dweet/for/led_control
Step 5: Download the Code and Run
- Download the code remote_controlled_led.py
- Open Thonny IDE and open the downloaded code
- Provide your SSID and PASSWORD in code
- Check if request URL for the thing is the same which you copied
- Run the application
- LED should be turned on as Value = 1 we have set
- Change the value on dweet.io e.g. "value" : 0 to turn off
Step 6: Support
If I have provided a real value for you, consider buying me a coffee☕