# Adafruit IO Basics: Schedule Actions

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/095/179/medium800thumb/microcontrollers_ezgif.com-video-to-gif_%2834%29.jpg?1601324909)

 **Add simple scheduling to your projects** with an Adafruit IO schedule action. **Turn on or off** **lamps, fans, solenoids, and other small appliances without the headache of reading and parsing output from real-time-clock (RTC) or obtaining the network time**.&nbsp;

This guide's project is a continuation of the [IoT Power Outlet guide](https://learn.adafruit.com/adafruit-io-a-c-power-relay) where we built an internet-connected electrical outlet with an Adafruit PyPortal and connected it to Adafruit IO. This guide will take the IoT Power Outlet guide one step further by adding some scheduling logic to the outlet to turn a lamp on or off at a specific time or day.

This project is _not only for scheduling and automating lights_ - you may adapt it to control a fish feeder, turn off an interactive art exhibit at night, water your plants at specific times, or schedule anything powered by an A/C outlet.

## What are Adafruit IO Actions?

Adafruit IO **Actions add some lightweight logic to your IoT project without writing extra code**. Actions are a way to do something when a certain situation occurs. This guide focuses on the simplest action type - **schedule actions**.

## What is a scheduled action?

You can configure a scheduled action to **publish a value to a feed** , send an email containing the value of a feed, or even send a webhook message to a URL at a **specific time**.

Scheduled triggers allow&nbsp;_robust_&nbsp;scheduling actions such as sending a value to a feed&nbsp;“At 11:15 AM, only on the 2nd August”, “Every 4 hours”, or “Everyday at 15 minute intervals between 1:00 PM and 2:00 PM”.&nbsp;

They also utilize your Adafruit IO account's local timezone - no complicated date-time math required!

![](https://cdn-learn.adafruit.com/assets/assets/000/136/831/medium640thumb/microcontrollers_chrome_mia0pUpzYN.jpg?1747236304)

## Parts

You will need the following parts to complete this guide

### Adafruit PyPortal - CircuitPython Powered Internet Display

[Adafruit PyPortal - CircuitPython Powered Internet Display](https://www.adafruit.com/product/4116)
 **PyPortal** , our easy-to-use IoT device that allows you to create all the things for the “Internet of Things” in minutes. Make custom touch screen interface GUIs, all open-source, and Python-powered using&nbsp;tinyJSON / APIs to get news, stock, weather, cat photos,...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4116)
[Related Guides to the Product](https://learn.adafruit.com/products/4116/guides)
![Front view of a Adafruit PyPortal - CircuitPython Powered Internet Display with a pyportal logo image on the display. ](https://cdn-shop.adafruit.com/640x480/4116-00.jpeg)

### Controllable Four Outlet Power Relay Module version 2

[Controllable Four Outlet Power Relay Module version 2](https://www.adafruit.com/product/2935)
Say goodbye to hazardous high voltage wiring and create the [Internet of Things](https://www.adafruit.com/categories/342) with safe, reliable power control. The **IoT Power Relay** &nbsp;from&nbsp;[Digital...](http://www.digital-loggers.com/iot.html)

In Stock
[Buy Now](https://www.adafruit.com/product/2935)
[Related Guides to the Product](https://learn.adafruit.com/products/2935/guides)
![Controllable Four Outlet Power Relay Module](https://cdn-shop.adafruit.com/640x480/2935-13.jpg)

### STEMMA JST PH 2mm 3-Pin to Male Header Cable - 200mm

[STEMMA JST PH 2mm 3-Pin to Male Header Cable - 200mm](https://www.adafruit.com/product/3893)
This cable will let you turn a JST PH 3-pin cable port into 3 individual wires with high-quality 0.1" male header plugs on the end. We're carrying these to match up with our Hallowing, for extending and connecting sensors or LEDs - and the wires are even color coded!

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/3893)
[Related Guides to the Product](https://learn.adafruit.com/products/3893/guides)
![Angled shot of STEMMA JST PH 3-Pin to Male Header Cable - 200mm.](https://cdn-shop.adafruit.com/640x480/3893-03.jpg)

### 5V 2.5A Switching Power Supply with 20AWG MicroUSB Cable

[5V 2.5A Switching Power Supply with 20AWG MicroUSB Cable](https://www.adafruit.com/product/1995)
Our all-in-one 5V 2.5 Amp + MicroUSB cable power adapter is the perfect choice for powering single-board computers like Raspberry Pi, BeagleBone, or anything else that's power-hungry!

This adapter was specifically designed to provide 5.25V, not 5V, but we still call it a 5V USB...

In Stock
[Buy Now](https://www.adafruit.com/product/1995)
[Related Guides to the Product](https://learn.adafruit.com/products/1995/guides)
![MicroUSB power supply with bundled cable and U.S. plugs.](https://cdn-shop.adafruit.com/640x480/1995-02.jpg)

### Part: Micro-USB Cable
quantity: 1
USB cable - USB A to Micro-B - 3 foot long
[Micro-USB Cable](https://www.adafruit.com/product/592)

# Adafruit IO Basics: Schedule Actions

## Create an Adafruit IO Action

Warning: Did you complete the IoT Power Outlet guide first? Alternatively see the [No-Code WipperSnapper](https://learn.adafruit.com/adafruit-io-basics-scheduled-triggers/no-code-wippersnapper) page!

**You will not be able to use this guide without completing the the&nbsp;[IoT Power Outlet Guide](https://learn.adafruit.com/adafruit-io-a-c-power-relay).**

**If you have not followed this guide** , navigate to the&nbsp;[IoT Power Outlet Guide's Adafruit IO setup page](https://learn.adafruit.com/adafruit-io-a-c-power-relay/adafruit-io-setup)&nbsp;and come back here when you are done.

## Create a New Action

We'll first create a new action to turn on the lights on a certain day (or time). Log into Adafruit IO and&nbsp;**[navigate to the Adafruit IO Actions page](https://io.adafruit.com/actions)**.

**Click Actions -\> Create a New Action.**

![](https://cdn-learn.adafruit.com/assets/assets/000/136/832/medium800/microcontrollers_j71LDGlWJf.png?1747237541)

A modal dialog should appear, giving you the option of entering a name and description.

Click the **Create** button after filling in the details.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/833/medium800/microcontrollers_image.png?1747237858)

The schedule trigger can be activated based on specific times and dates, such as “Everyday at 9pm” or “At 2:00 PM, on the 2nd August”, or “Every 4 hours”.

Let's turn the lights on every morning at 6:00 AM to wake us up!

Select the **Schedule** trigger block from the **Triggers** category in the toolbox/sidebar, and drag it onto the&nbsp;`Triggers:` section of the main diagram.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/840/medium800thumb/microcontrollers_chrome_H90T5gqZiR-ezgif.com-resize.jpg?1747239852)

Use the **Grey Cog on a Blue Background** to change the Hours section from&nbsp; **Every Hour** to&nbsp; **During Hour 0** , and then change the hour to **6**. Finally change the&nbsp; **Minutes** dropdown to be **0** (zero).

![](https://cdn-learn.adafruit.com/assets/assets/000/136/841/medium800thumb/microcontrollers_chrome_UQwHj8lnNv.jpg?1747239916)

The WipperSnapper Device, or CircuitPython or Arduino code, will turn the outlet on depending on the feed's value at this time. Let's publish the value `1` to the&nbsp;_relay_&nbsp;feed.

Select the **Feeds** category in the toolbox, then drag the&nbsp; **Set Feed** block, second in the list, onto the diagram in the&nbsp;`Actions:` section.

Choose the appropriate feed (`relay`) from the dropdown list of feeds.

Select inside the textbox of the&nbsp; **Set Feed** block and enter the value `1`

It's worth understanding that there are text value blocks and number value blocks, which are treated differently. Luckily all feeds in Adafruit IO are able to be treated as Strings / Text, so I've left the value block as a text one in this case, but be careful when doing maths and comparisons.

![The Action section of the diagram gets populated with a block to set the relay feed to the value of 1](https://cdn-learn.adafruit.com/assets/assets/000/136/853/medium640thumb/microcontrollers_chrome_1HvjP1PYTM.jpg?1747317407)

Make sure your action looks similar to this before proceeding, although I've used the Power Switch feed.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/909/medium800/microcontrollers_chrome_Leqs9N8uSl.png?1747406913)

Now that this action is done, click **Save** , and if asked then choose **Enable and Save**.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/851/medium800thumb/microcontrollers_chrome_BizDz4vXQH.jpg?1747317657)

Warning: New Actions are disabled initially to protect you from the action accidentally firing! 🚀

## Create an Action to Turn the Lights Off

Next, let's turn **off** the lights after 11 PM. To do this, you'll need to create another action.

After filling in the details for the new action, use the blocks to create an action that triggers at 23:00 (11 PM in 24-hour clock) and sends the value `0` (zero) to the relay feed.

After filling in the details for the new action, use the blocks to create an action that triggers at 23:00 (11PM in 24-hour clock) and sends the value `0` (zero) to the relay feed.

Once you've done that then **Enable and Save** the action.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/856/medium640thumb/microcontrollers_chrome_dafVc04sJu.jpg?1747318166)

Before proceeding, make sure your second action looks similar to this:

![](https://cdn-learn.adafruit.com/assets/assets/000/136/910/medium800/microcontrollers_chrome_8TeX2dBBd4.png?1747407141)

## Double-Check Your Actions

Before moving on, make sure your actions page lists both the 6:00AM action and 11:00PM action.

Do this by returning to the [Actions list page](https://io.adafruit.com/actions), also verifying both the actions created are **Enabled**.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/911/medium800/microcontrollers_image.png?1747407422)

# Adafruit IO Basics: Schedule Actions

## Code with CircuitPython

Using CircuitPython is recommended for beginner to intermediate coders. It's more compact, easier to understand, and easy to change and debug.

## Add CircuitPython Libraries

This page assumes your PyPortal is set up with the appropriate CircuitPython libraries and has been connected to the internet.&nbsp;

- If you have not done this, [follow this page to install the correct libraries](https://learn.adafruit.com/adafruit-io-a-c-power-relay/circuitpython-setup). Then, [follow this page to connect the PyPortal to the internet](https://learn.adafruit.com/adafruit-io-a-c-power-relay/internet-connect).

## Add CircuitPython Code

In the embedded code element below, click on the&nbsp; **Download: Project Zip** &nbsp;link, and save the .zip archive file to your computer.

Then,&nbsp; **uncompress the .zip file** , it will unpack to a folder named **Adafruit\_IO\_Scheduled\_Trigger**.

Copy the contents of **Adafruit\_IO\_Scheduled\_Trigger** &nbsp;directory to your PyPortal's&nbsp; **CIRCUITPY** &nbsp;drive.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Adafruit_IO_Schedule_Trigger/code.py

## Settings.toml Setup

Open the&nbsp; **settings.toml** file on your CircuitPython device using Mu or your favorite text editor. You're going to edit this file to enter your WiFi and Adafruit IO credentials.&nbsp;

- **Change** &nbsp;`ssid`&nbsp;to&nbsp; **the name of your WiFi network**
- **Change&nbsp;** `password`&nbsp;to&nbsp; **your WiFi network's password&nbsp;**
- **Change&nbsp;** `your_aio_username`&nbsp;to&nbsp; **your Adafruit IO Username**
- **Change&nbsp;** `your_aio_key`&nbsp;to&nbsp; **your Adafruit IO Key**.

```python
CIRCUITPY_WIFI_SSID = "ssid"
CIRCUITPY_WIFI_PASSWORD = "password"
CIRCUITPY_WEB_API_PASSWORD = "webpassword"
TIMEZONE = "America/New_York", # http://worldtimeapi.org/timezones
ADAFRUIT_AIO_USERNAME = "your_aio_username"
ADAFRUIT_AIO_KEY = "your_aio_key"
```

## Code Usage

The PyPortal should boot up. The code connects the PyPortal to your WiFi network. Then, it connects to Adafruit IO and subscribes to the feed you set up earlier.

This code continuously checks the relay feed for new values.&nbsp;

Every weekday at 8AM, the scheduled action publishes the value "morning" to your relay feed.

When the feed updates with a new value, the `on_battery_msg()` function executes and checks if the value matches the text "1".&nbsp;

If the feed's value matches the text "1", the PyPortal's D3 pin is written high. This turns on the light connected to the outlet.

![](https://cdn-learn.adafruit.com/assets/assets/000/095/148/medium800thumb/microcontrollers_ezgif.com-video-to-gif_%2833%29.jpg?1601316375)

Every evening at 11PM, &nbsp;the scheduled trigger publishes the value "0" to your relay feed. The `on_battery_msg()` will read the new value, check if it matches the text "0", and turns off the outlet.

![](https://cdn-learn.adafruit.com/assets/assets/000/095/153/medium800thumb/microcontrollers_ezgif.com-video-to-gif_%2834%29.jpg?1601316463)

## Troubleshooting
### My appliance is not turning on or off.

First, check your wiring against the [assembly and wiring page](https://learn.adafruit.com/adafruit-io-a-c-power-relay/assembly-and-wiring).

Next, make sure your Adafruit IO feed is named _relay_ and your triggers are set up to send the value **1** and&nbsp; **0** every weekday.

&nbsp;

Then, navigate to your [Feeds page](https://io.adafruit.com/feeds) and click the _relay_ feed. If it's been a day since you set up the triggers, the values _1_ or _0_ should be in the feed's value list. If they're not, check the action set up.

# Adafruit IO Basics: Schedule Actions

## CircuitPython Code Walkthrough

The code sets up the PyPortal's&nbsp; **D3** &nbsp;pin as a DigitalInOut object and set the direction to output.&nbsp;

```python
# Set up a pin for controlling the relay
power_pin = DigitalInOut(board.D3)
power_pin.switch_to_output()
```

The following code block consists of MQTT callback methods. For an explanation of how these methods work,&nbsp;[please see this section of the MQTT in CircuitPython guide](https://learn.adafruit.com/mqtt-in-circuitpython/code-walkthrough#minimqtt-callback-methods-3034067-9).

```python
### Code ###

# Define callback methods which are called when events occur
# pylint: disable=unused-argument, redefined-outer-name
def connected(client, userdata, flags, rc):
    # This function will be called when the client is connected
    # successfully to the broker.
    print("Connected to Adafruit IO!")

def disconnected(client, userdata, rc):
    # This method is called when the client is disconnected
    print("Disconnected from Adafruit IO!")

def subscribe(client, userdata, topic, granted_qos):
    # This method is called when the client subscribes to a new feed.
    print("Subscribed to {0}".format(topic))

def unsubscribe(client, userdata, topic, pid):
    # This method is called when the client unsubscribes from a feed.
    print("Unsubscribed from {0} with PID {1}".format(topic, pid))

def on_message(client, topic, message):
    # Method callled when a client's subscribed feed has a new value.
    print("New message on topic {0}: {1}".format(topic, message))
```

Whenever the&nbsp;_relay_ feed receives new data, the `on_relay_msg` function executes. If the value on the feed is evaluated to be _"1"_, the light is turned on. Alternatively, if the value on the feed is evaluated to be _"0"_, the light is turned off.&nbsp;

```python
def on_relay_msg(client, topic, message):
    # Method called whenever user/feeds/relay has a new value
    if message == "1":
        print("Received 1 - turning outlet ON")
        power_pin.value = True
    elif message == "0":
        print("Received 0 - turning outlet OFF")
        power_pin.value = False
    else:
        print("Unexpected value received on relay feed.")
```

Next, the code connects to the WiFi network and set up a MQTT client to connect to Adafruit IO's MQTT broker with your credentials. An Adafruit IO MQTT client instance is initialized using the MiniMQTT client instance.

```python
# Get pool of sockets and ssl setup from adafruit connection manager
pool = adafruit_connection_manager.get_radio_socketpool(esp)
ssl_context = adafruit_connection_manager.get_radio_ssl_context(esp)

# Initialize a new MQTT Client object
mqtt_client = MQTT.MQTT(
    broker="io.adafruit.com",
    username=aio_username,
    password=aio_key,
    socket_pool=pool,
    ssl_context=ssl_context,
)

# Initialize an Adafruit IO MQTT Client
io = IO_MQTT(mqtt_client)
```

Sets up the callback methods above by connecting them to the client's default callback properties.&nbsp;

```python
# Connect the callback methods defined above to Adafruit IO
io.on_connect = connected
io.on_disconnect = disconnected
io.on_subscribe = subscribe
io.on_unsubscribe = unsubscribe
io.on_message = on_message
```

Connect to the Adafruit IO MQTT broker and subscribe to the relay feed.

```python
# Connect to Adafruit IO
print("Connecting to Adafruit IO...")
io.connect()
```

The `on_relay_msg`&nbsp;method is not a default Adafruit IO callback method, so it's added as a custom callback. This method will execute `on_relay_msg` whenever a new value is obtained by the relay feed.

```python
# Add a callback to the relay feed
client.add_topic_callback(feed_relay, on_relay_msg)
```

Subscribes to all messages on the relay feed and obtains the most recent value of the relay feed.

```python
# Subscribe to all messages on the relay feed
io.subscribe("relay")

# Get the most recent value on the relay feed
io.get("relay")
```

The code within the&nbsp;`while True`&nbsp;loop will check for new messages on the relay feed every 50 milliseconds. If there's an issue with the network connection, the WiFi connection will reset and the MQTT client will reconnect to Adafruit IO.

```python
# Start a blocking loop to check for new messages
while True:
    try:
        io.loop()
    except (ValueError, RuntimeError) as e:
        print("Failed to get data, retrying\n", e)
        wifi.reset()
        io.reconnect()
        continue
    time.sleep(0.5)
```

# Adafruit IO Basics: Schedule Actions

## Code with Arduino

As an alternative to using CircuitPython, more advanced coders may wish to program the project using the Arduino IDE.

## Setup Arduino

You should go through the setup guides associated with your selected set of hardware, and make sure you have internet connectivity with the device before continuing.&nbsp;

- [Adafruit PyPortal Arduino Setup Guide](https://learn.adafruit.com/adafruit-pyportal/setup)

You will need to make sure you have at least&nbsp; **version 3.7.0** &nbsp;of the Adafruit IO Arduino library installed before continuing.

![](https://cdn-learn.adafruit.com/assets/assets/000/095/047/medium800/microcontrollers_Library_Manager.png?1600979614)

For this example you will need to open the&nbsp; **adafruitio\_25\_scheduled\_trigger** &nbsp;example in the&nbsp; **Adafruit IO Arduino** &nbsp;library.

## Configure Sketch

Before uploading the code, you'll need to configure the sketch to include your Adafruit IO account and network credentials.&nbsp;

Click on the **config.h** &nbsp;tab in the sketch. You will need to **set your Adafruit IO username** in the&nbsp;`IO_USERNAME` define, and **set your Adafruit IO key** in the `IO_KEY`&nbsp;define.

![](https://cdn-learn.adafruit.com/assets/assets/000/095/082/medium800/microcontrollers_adafruitio_25_schedule_trigger_-_config_h___Arduino_1_8_13.png?1601058454)

Set your WiFi SSID after the `WIFI_SSID` define and your WiFi password after the `WIFI_PASS` define.

![](https://cdn-learn.adafruit.com/assets/assets/000/095/083/medium800/microcontrollers_adafruitio_25_schedule_trigger_-_config_h___Arduino_1_8_13.png?1601058498)

You will also need to **uncomment the line** :

`#define USE_AIRLIFT`

## Code Usage

Upload the sketch to your board and open the Arduino Serial Monitor. Your board should now connect to Adafruit IO.

```python
Connecting to Adafruit IO....

Adafruit IO connected.
```

This sketch continuously checks the relay feed for new values.&nbsp;

Every weekday at 8AM, the scheduled action publishes the value "morning" to your relay feed.

When the feed updates with a new value, the sketch's `handleMessage()` function executes and checks if the value matches the text "1".&nbsp;

If the feed's value matches the text "1", the PyPortal's D3 pin is written HIGH. This turns on the outlet and your appliance.

![](https://cdn-learn.adafruit.com/assets/assets/000/095/157/medium800thumb/microcontrollers_ezgif.com-video-to-gif_%2834%29.jpg?1601316525)

Every evening at 11PM, &nbsp;the scheduled action publishes the value "0" to your relay feed. The `handleMessage()` will read the new value, check if it matches the text "0", and turns off the outlet.

![](https://cdn-learn.adafruit.com/assets/assets/000/095/156/medium800thumb/microcontrollers_ezgif.com-video-to-gif_%2833%29.jpg?1601316519)

## Troubleshooting
### My appliance is not turning on or off.

First, check your wiring against the [assembly and wiring page](https://learn.adafruit.com/adafruit-io-a-c-power-relay/assembly-and-wiring).

Next, make sure your Adafruit IO feed is named _relay_ and your actions are set up to send the value _0_ and&nbsp;_1&nbsp;_ every weekday.

&nbsp;

Then, navigate to your [Feeds page](https://io.adafruit.com/feeds) and click the _relay_ feed. If it's been a day since you set up the actions, the values _0_ or _1&nbsp;_ should be in the feed's value list. If they're not, check the action set up.

# Adafruit IO Basics: Schedule Actions

## Arduino Code Walkthrough

The code uses the PyPortal's D3 pin to control the relay's power signal.&nbsp;

```python
// Relay is connected to PyPortal's D3 connector
#define RELAY_POWER_PIN 3
```

Next, the code sets up an instance of the relay feed you created in the previous guide.

```python
// Set up the 'relay feed'
AdafruitIO_Feed *relay = io.feed("relay");
```

This chunk of code connects your device to Adafruit IO. It sets up a message handler for the _relay_ feed. Whenever a new value is received on the _relay&nbsp;_feed, the `handleMessage` function will execute.&nbsp;

The code performs a `relay->get()` to obtain the last known value of the relay feed. This line is useful because if you lose connection for any reason, the code will set up the appliance in the correct state when it restarts.

```python
void setup() {

  // start the serial connection
  Serial.begin(115200);

  // wait for serial monitor to open
  while(! Serial);

  Serial.print("Connecting to Adafruit IO");

  // connect to io.adafruit.com
  io.connect();

  // set up a message handler for the 'relay' feed.
  // the handleMessage function (defined below)
  // will be called whenever a message is
  // received from adafruit io
  relay->onMessage(handleMessage);

  // wait for a connection
  while(io.status() < AIO_CONNECTED) {
    Serial.print(".");
    delay(500);
  }

  // we are connected
  Serial.println();
  Serial.println(io.statusText());

  // Get the last known value from the feed
  relay->get();

}
```

Next, we have the main `loop()` function. The first line of the loop function calls `io.run()` - this line will need to be present at the top of the loop in every sketch. It helps keep a device connected to Adafruit IO, and processes any incoming data from the feeds its subscribed to.

```python
void loop() {

  // io.run(); is required for all sketches.
  // it should always be present at the top of your loop
  // function. it keeps the client connected to
  // io.adafruit.com, and processes any incoming data.
  io.run();

}
```

Whenever a new value is received on the _relay_ feed, the `handleMessage` function will execute. This function prints out the new data it received&nbsp;

```python
void handleMessage(AdafruitIO_Data *data) {

  Serial.print("feed received new data <- ");
  Serial.println(data->toChar());
```

Checks if the data received by the feed matches the value published to the morning scheduled action. If there's a match, the signal pin is written `HIGH` which turns on the outlet.

```python
// Check to see if the morning scheduled trigger has executed
  if (strcmp(data->toChar(), "1") == 0) {
      Serial.println("Turning lights ON");
      digitalWrite(RELAY_POWER_PIN, HIGH);
  }
```

If the morning action value was not found, check if the evening action has fired. If the evening action value was found, turn off the outlet.

Any unexpected data received by the _relay_ feed will print an error message.

```python
// Check to see if the evening scheduled action has executed
  else if (strcmp(data->toChar(), "0") == 0) {
      Serial.println("Turning lights OFF");
      digitalWrite(RELAY_POWER_PIN, LOW);
  }
  else {
      Serial.println("Unexpected data received from Adafruit IO");
  }
}
```

# Adafruit IO Basics: Schedule Actions

## No-Code WipperSnapper

![](https://cdn-learn.adafruit.com/assets/assets/000/136/862/medium800/microcontrollers_image.png?1747322965)

[**WipperSnapper**](https://learn.adafruit.com/quickstart-adafruit-io-wippersnapper) is a firmware designed to turn any WiFi-capable board into an Internet-of-Things device **without programming a single line of code**. WipperSnapper connects to&nbsp;[Adafruit IO](https://io.adafruit.com/), a web&nbsp;platform designed ([by Adafruit!](https://www.adafruit.com/about)) to&nbsp;_display_,&nbsp;_respond_, and&nbsp;_interact_&nbsp;with your project's data.

Simply follow the web installer steps to load the WipperSnapper firmware onto your board, add credentials, and plug it into power. Your board will automatically register itself with your Adafruit IO account.

From there, you can add&nbsp;_components_&nbsp;to your board such as buttons, switches, potentiometers, sensors, and more! Components are&nbsp;_dynamically&nbsp;_added to hardware, so you can immediately start interacting, logging, and streaming the data your projects produce without writing code. Each board has pages of docs to help you!

### Quickstart: Adafruit IO WipperSnapper  - Welcome to WipperSnapper

[Quickstart: Adafruit IO WipperSnapper ](https://learn.adafruit.com/quickstart-adafruit-io-wippersnapper)
[Welcome to WipperSnapper](https://learn.adafruit.com/quickstart-adafruit-io-wippersnapper/welcome-to-wippersnapper)
To create a WipperSnapper device on Adafruit IO, goto the [Devices page](https://io.adafruit.com/devices) and click the New Device button (or + option on the board placeholder card).&nbsp;

Select your device from the list, in this case select the **PyPortal** for this example, but any board will work instead.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/872/medium800thumb/microcontrollers_chrome_B906DJGDUw.jpg?1747325580)

Follow the steps in the Web Installer to complete the initial setup:

1. Downloading the UF2 firmware
2. Defining your wifi settings and downloading the secrets.json file
3. Resetting your board into bootloader mode
4. Finally uploading the firmware and copying the `secrets.json` file onto the device.

Your board should reset (or manually reset it), and come online ready to be registered with Adafruit IO.

Info: Adafruit IO requires a page to be open (and ideally active) in your web browser to complete registration

![](https://cdn-learn.adafruit.com/assets/assets/000/136/874/medium800thumb/microcontrollers_chrome_Gm0jTkDSLW.jpg?1747326348)

After registration you'll be taken to the page for your new device. It will have no components registered initially.

Use the New Component button (or Component placeholder row with ' **+**') to load the list of components.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/875/medium800/microcontrollers_image.png?1747326550)

Search for the Powertail component by entering&nbsp;`Power` into the search box, then select the **Power Switch** component. A relay or other digital pin based component would also be suitable to represent it.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/876/medium800thumb/microcontrollers_chrome_o945en574P.jpg?1747326732)

You'll be taken to the&nbsp; **Create Power Switch Component** dialog, where you can **name the component** and configure the associated options like **Pull-up resistors** and which device **Pin** to use.

Enter a name for the component, to help distinguish it from other future ones.

Select the pin you have attached the Stemma cable to,&nbsp; **D3** in this case.

Click&nbsp; **Create Component** to be taken back to the Device Info page.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/877/medium640/microcontrollers_image.png?1747326946)

Your device should show the new component. You can visit the associated **feed page** using the **Graph symbol** at the end of the component card / row, and the **Cog symbol** will take you to update the **component settings**.

![](https://cdn-learn.adafruit.com/assets/assets/000/136/879/medium800/microcontrollers_image.png?1747327340)

Toggle the On / Off option on the device page for the Power component, and the mains socket will turn on.

That's it! Your device should keep checking in with Adafruit IO to see if any new data has arrived.

Now you can go and visit the Actions page, and [setup the Morning and Night actions](https://learn.adafruit.com/adafruit-io-basics-scheduled-triggers/create-an-adafruit-io-action), then confirm that your Actions do as expected when tested.


## Featured Products

### Adafruit PyPortal - CircuitPython Powered Internet Display

[Adafruit PyPortal - CircuitPython Powered Internet Display](https://www.adafruit.com/product/4116)
 **PyPortal** , our easy-to-use IoT device that allows you to create all the things for the “Internet of Things” in minutes. Make custom touch screen interface GUIs, all open-source, and Python-powered using&nbsp;tinyJSON / APIs to get news, stock, weather, cat photos,...

Out of Stock
[Buy Now](https://www.adafruit.com/product/4116)
[Related Guides to the Product](https://learn.adafruit.com/products/4116/guides)
### Controllable Four Outlet Power Relay Module version 2

[Controllable Four Outlet Power Relay Module version 2](https://www.adafruit.com/product/2935)
Say goodbye to hazardous high voltage wiring and create the [Internet of Things](https://www.adafruit.com/categories/342) with safe, reliable power control. The **IoT Power Relay** &nbsp;from&nbsp;[Digital...](http://www.digital-loggers.com/iot.html)

In Stock
[Buy Now](https://www.adafruit.com/product/2935)
[Related Guides to the Product](https://learn.adafruit.com/products/2935/guides)
### STEMMA JST PH 2mm 3-Pin to Male Header Cable - 200mm

[STEMMA JST PH 2mm 3-Pin to Male Header Cable - 200mm](https://www.adafruit.com/product/3893)
This cable will let you turn a JST PH 3-pin cable port into 3 individual wires with high-quality 0.1" male header plugs on the end. We're carrying these to match up with our Hallowing, for extending and connecting sensors or LEDs - and the wires are even color coded!

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/3893)
[Related Guides to the Product](https://learn.adafruit.com/products/3893/guides)
### 5V 2.5A Switching Power Supply with 20AWG MicroUSB Cable

[5V 2.5A Switching Power Supply with 20AWG MicroUSB Cable](https://www.adafruit.com/product/1995)
Our all-in-one 5V 2.5 Amp + MicroUSB cable power adapter is the perfect choice for powering single-board computers like Raspberry Pi, BeagleBone, or anything else that's power-hungry!

This adapter was specifically designed to provide 5.25V, not 5V, but we still call it a 5V USB...

In Stock
[Buy Now](https://www.adafruit.com/product/1995)
[Related Guides to the Product](https://learn.adafruit.com/products/1995/guides)
### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

In Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)
### Adafruit Metro M4 Express AirLift (WiFi) - Lite

[Adafruit Metro M4 Express AirLift (WiFi) - Lite](https://www.adafruit.com/product/4000)
Give your next project a lift with _AirLift_ - our witty name for the ESP32 co-processor that graces this Metro M4. You already know about the&nbsp; **Adafruit Metro M4** &nbsp;featuring the&nbsp; **Microchip ATSAMD51** , with it's 120MHz Cortex M4 with...

In Stock
[Buy Now](https://www.adafruit.com/product/4000)
[Related Guides to the Product](https://learn.adafruit.com/products/4000/guides)
### Adafruit AirLift FeatherWing – ESP32 WiFi Co-Processor

[Adafruit AirLift FeatherWing – ESP32 WiFi Co-Processor](https://www.adafruit.com/product/4264)
Give your Feather project a _lift_ with the Adafruit AirLift FeatherWing - a FeatherWing that lets you use the powerful ESP32 as a WiFi co-processor. You probably have your favorite Feather ([like the Feather M4](https://www.adafruit.com/product/3857)) that comes with its own...

In Stock
[Buy Now](https://www.adafruit.com/product/4264)
[Related Guides to the Product](https://learn.adafruit.com/products/4264/guides)
### Adafruit AirLift Shield - ESP32 WiFi Co-Processor

[Adafruit AirLift Shield - ESP32 WiFi Co-Processor](https://www.adafruit.com/product/4285)
Give your Arduino project a _lift_ with the Adafruit AirLift Shield - a shield that lets you use the powerful ESP32 as a WiFi co-processor. You probably have your favorite Arduino-compatible ([like the Metro M4](https://www.adafruit.com/product/3382) or the classic <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4285)
[Related Guides to the Product](https://learn.adafruit.com/products/4285/guides)

## Related Guides

- [Adafruit HUZZAH32 - ESP32 Feather](https://learn.adafruit.com/adafruit-huzzah32-esp32-feather.md)
- [Adafruit PyPortal - IoT for CircuitPython](https://learn.adafruit.com/adafruit-pyportal.md)
- [Adafruit Metro M4 Express AirLift (WiFi)](https://learn.adafruit.com/adafruit-metro-m4-express-airlift-wifi.md)
- [Adafruit AirLift FeatherWing - ESP32 WiFi Co-Processor](https://learn.adafruit.com/adafruit-airlift-featherwing-esp32-wifi-co-processor-featherwing.md)
- [Adafruit AirLift Shield - ESP32 WiFi Co-Processor](https://learn.adafruit.com/adafruit-airlift-shield-esp32-wifi-co-processor.md)
- [PyPortal LIFX Lighting Controller ](https://learn.adafruit.com/pyportal-lifx-lighting-controller.md)
- [Upgrading AirLift ESP32 Firmware](https://learn.adafruit.com/upgrading-esp32-firmware.md)
- [A Floppy Thumb Drive with a Color File Icon Display](https://learn.adafruit.com/a-floppy-thumb-drive-with-a-color-file-icon-display.md)
- [PyPortal Weekly Countdown Clock](https://learn.adafruit.com/pyportal-countdown-clock.md)
- [PyPortal NASA Image of the Day Viewer](https://learn.adafruit.com/pyportal-nasa-image-of-the-day-viewer.md)
- [Karel The Robot In CircuitPython](https://learn.adafruit.com/karel-the-robot-in-circuitpython.md)
- [PyPortal Winamp MP3 Player](https://learn.adafruit.com/pyportal-winamp-mp3-player.md)
- [AdaBox 011](https://learn.adafruit.com/adabox011.md)
- [Quickstart - Raspberry Pi RP2040 with BLE and CircuitPython](https://learn.adafruit.com/quickstart-raspberry-pi-rp2040-with-ble-and-circuitpython.md)
- [MQTT in CircuitPython](https://learn.adafruit.com/mqtt-in-circuitpython.md)
- [CircuitPython Day 2020 Countdown Clock](https://learn.adafruit.com/circuitpython-day-2020-countdown-clock.md)
- [Electronic History of the Day with PyPortal](https://learn.adafruit.com/electronic-history-of-the-day-with-pyportal.md)
- [PyPortal Astronauts in Space](https://learn.adafruit.com/pyportal-astronauts-in-space.md)
- [Program in Logo on an Apple II](https://learn.adafruit.com/program-logo-on-an-apple-ii.md)
- [Networking in CircuitPython](https://learn.adafruit.com/networking-in-circuitpython.md)
