Control LED From Internet Using Raspberry Pi Pico W | Step by Step Guide

by rajivcodelab in Circuits > Raspberry Pi

227 Views, 3 Favorites, 0 Comments

Control LED From Internet Using Raspberry Pi Pico W | Step by Step Guide

How to Control LED from the Internet using Raspberry Pi Pico W | Dweet.IO

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

Setting Up the Hardware

Pin Connection.png
  • 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.


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


Create Thing on DWEET.IO

How to Control LED from Internet using Raspberry Pi Pico W - Create Things.png
  • Go to dweet.io website and click on Play
  • Click on create a dweet for a thing
  • Provide the thing name as "led_control"
  • In the content provide


Grab the Thing URL From DWEET.IO

How to Control LED from Internet using Raspberry Pi Pico W - Get the URL.png


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

Support

bmc_qr.png

If I have provided a real value for you, consider buying me a coffee