# Your First Power Switch Relay Project - Circuit Playground Smart Plug

## Overview

https://youtu.be/xzCllfr2dRk

Control All the Things in your house with a Circuit Playground Express and a Power Switch Relay. This little power supply is a toggle-able "Smart Plug" that you can use for all kinds of home automation applications.

This relay controller has one plug that's always on (for powering your Circuit Playground).

The other plugs are where it gets interesting. There are two plugs that are normally OFF and one that is normally ON. Activating the relay with the Circuit Playground turns the "on" plug to OFF, and the two "off" plugs to ON. Simple and elegant, yes?

![sensors_2935-17.jpg](https://cdn-learn.adafruit.com/assets/assets/000/090/397/medium640/sensors_2935-17.jpg?1586978141)

Where it gets really interesting is when you combine this functionality with the inputs and triggers on with the Circuit Playground Express. You can toggle the switches so many ways:&nbsp;

- Move, tilt, or shake the Circuit Playground
- Make a loud sound (like a DIY version of "The Clapper!")
- A change in ambient light
- A change in ambient temperature
- Capacitive touch pads, and things attached to them
- Circuit Playground's onboard buttons

You can also create timers or combinations of triggers to toggle the outlets. It's safe to use with higher voltage devices like lamps or heaters, too. The sky is the limit.

Info: 

![](https://cdn-learn.adafruit.com/assets/assets/000/090/262/medium800/makecode_powerswitch.jpg?1586559551)

## Parts
### Circuit Playground Express

[Circuit Playground Express](https://www.adafruit.com/product/3333)
 **Circuit Playground Express** is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and made it even better! Not only did we pack even more sensors in, we also made it even easier to...

In Stock
[Buy Now](https://www.adafruit.com/product/3333)
[Related Guides to the Product](https://learn.adafruit.com/products/3333/guides)
![A Black woman's manicured hand holds a round microcontroller with lit up LEDs.](https://cdn-shop.adafruit.com/640x480/3333-05.jpg)

### 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)

### 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)

### Bolt-On Kit for Circuit Playground, micro:bit, Flora or Gemma

[Bolt-On Kit for Circuit Playground, micro:bit, Flora or Gemma](https://www.adafruit.com/product/4103)
You have a [Circuit Playground Express](https://www.adafruit.com/product/3333), and want to connect some wires to it for adding LEDs or sensors or speakers? You can use our nice alligator clips, but they are a little bulky. If you aren't quite ready to solder to your Playground,...

In Stock
[Buy Now](https://www.adafruit.com/product/4103)
[Related Guides to the Product](https://learn.adafruit.com/products/4103/guides)
![Close up angled shot of a LED strip attached and powered by a circuit playground. ](https://cdn-shop.adafruit.com/640x480/4103-06.jpg)

### You'll Also Need

- A small flat-head screwdriver
- A small phillips-head screwdriver OR soldering iron (if you're not using the bolt-on kit)

### A Note about On/Off Switched Devices

This power relay turns its outlets on and off -- that's all it does. We were trying this with various things around the house, and discovered that a lot of modern electronic devices don't come on automatically when their power plug is activated. If it's got an on/off switch, it often requires a button press to come to life, and this relay won't press the "on" button for you, it'll simply feed power. So keep that in mind when you're planning your project.

### Power Switch Relay Features:

- A single input signal to switch four outlets:&nbsp; **1 always on + 1 normally on + 2 normally off.**
- Universal control voltage 3-60VDC or 12-120VAC, or connect directly to a 12V, 48VDC, or even 120VAC circuit.
- Optical isolation, relay, hysteresis and de-bounce protection for added safety.
- A large MOV used to clamp surges for clean 90-140 AVC power.
- Durable SPDT control relay rated at 30/40A. More than 400k operations at 12A or 2million+ at 5A.
- A 12A thermal safety circuit breaker switch prevents overloads.
- Standard 19" C13 detachable cord included.
- Mounting tabs
- This power relay is professionally built and tested.

- [Next Page](https://learn.adafruit.com/beginner-first-project-power-switch-relay-circuit-playground-smart-plug/assembly.md)

## Featured Products

### Circuit Playground Express

[Circuit Playground Express](https://www.adafruit.com/product/3333)
 **Circuit Playground Express** is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and made it even better! Not only did we pack even more sensors in, we also made it even easier to...

In Stock
[Buy Now](https://www.adafruit.com/product/3333)
[Related Guides to the Product](https://learn.adafruit.com/products/3333/guides)
### Bolt-On Kit for Circuit Playground, micro:bit, Flora or Gemma

[Bolt-On Kit for Circuit Playground, micro:bit, Flora or Gemma](https://www.adafruit.com/product/4103)
You have a [Circuit Playground Express](https://www.adafruit.com/product/3333), and want to connect some wires to it for adding LEDs or sensors or speakers? You can use our nice alligator clips, but they are a little bulky. If you aren't quite ready to solder to your Playground,...

In Stock
[Buy Now](https://www.adafruit.com/product/4103)
[Related Guides to the Product](https://learn.adafruit.com/products/4103/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)
### Pink and Purple Braided USB A to Micro B Cable - 2 meter long

[Pink and Purple Braided USB A to Micro B Cable - 2 meter long](https://www.adafruit.com/product/4148)
This cable is&nbsp;super-fashionable&nbsp;with a woven pink and purple Blinka-like pattern!

First let's talk about the cover and over-molding. We got these in custom colors, and if you&nbsp;_have_&nbsp;to have visible cables, then you might as well have the nicest fabric-bound...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/4148)
[Related Guides to the Product](https://learn.adafruit.com/products/4148/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)

## Related Guides

- [Adafruit Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express.md)
- [Circuit Playground Express TV Zapper](https://learn.adafruit.com/circuitpython-tv-zapper-with-circuit-playground-express.md)
- [Hello World of Robotics with Crickit](https://learn.adafruit.com/hello-world-of-robotics-with-crickit.md)
- [LEGO Head Lamp with Audio](https://learn.adafruit.com/lego-head-lamp-with-audio.md)
- [Glue Stick Light Pipe Sculpture](https://learn.adafruit.com/glue-stick-archway.md)
- [CircuitPython Sin Complicaciones para la Circuit Playground Express y la Bluefruit](https://learn.adafruit.com/circuitpython-sin-complicaciones-para-la-circuit-playground-express.md)
- [CircuitPython Hardware: SD Cards](https://learn.adafruit.com/micropython-hardware-sd-cards.md)
- [Using the Android CircuitPython Editor](https://learn.adafruit.com/using-the-android-circuitpython-editor.md)
- [Infrared Transmit and Receive on Circuit Playground Express in C++](https://learn.adafruit.com/infrared-transmit-and-receive-on-circuit-playground-express-in-c-plus-plus-2.md)
- [What is Web MIDI & BLE MIDI?](https://learn.adafruit.com/web-ble-midi.md)
- [Color Spinner Camera Ring Light ](https://learn.adafruit.com/camera-ring-light-with-cpx.md)
- [LED Shoji Lamp](https://learn.adafruit.com/led-shoji-lamp.md)
- [Circuit Playground Bike Glove](https://learn.adafruit.com/circuit-playground-bike-glove.md)
- [Circuit Playground Express Serial Communications](https://learn.adafruit.com/circuit-playground-express-serial-communications.md)
- [LEGO Compatible Crickit Rover](https://learn.adafruit.com/lego-compatible-crickit-rover.md)
- [Halloween Monsters with CRICKIT and Circuit Playground Express](https://learn.adafruit.com/halloween-monsters-with-crickit.md)
