# Programmable 12v Outdoor Cafe Lights

## Overview

https://youtu.be/4eHgcwl7yk0

Cafe-style light strands with edison bulbs are a beautiful way to decorate your patio. They are a fantastic and classy way to light up any outdoor space. Wineries, bistros, and night markets use them to create a cozy, intimately lit space that's warm and inviting to diners, and they look fabulous in backyards of just about any size.

These lights are a programmable, addressable version of the cafe market lights you can find at the hardware store. The Sparkle Motion board gives you so many options for programming. It's designed to work with WLED and xLights so you can control the lights wirelessly from your phone or any web enabled browser. Or use Arduino or CircuitPython code to send your own beautiful custom animations to your lights.

![](https://cdn-learn.adafruit.com/assets/assets/000/130/290/medium800/adafruit_products_hero.jpeg?1717088815)

### Cafe / Patio Light Bulb Strand with NeoPixel RGB LED - 20 Bulbs

[Cafe / Patio Light Bulb Strand with NeoPixel RGB LED - 20 Bulbs](https://www.adafruit.com/product/6058)
For decorating outdoor spaces, these NeoPixel-equipped **&nbsp;Cafe / Patio Light Bulb Strands** each have 20 bulbs with a triple&nbsp;NeoPixel RGB LED inside. They're just like the café lights you see folks string up to add some ambience, but you can control them just...

In Stock
[Buy Now](https://www.adafruit.com/product/6058)
[Related Guides to the Product](https://learn.adafruit.com/products/6058/guides)
![Demo Vid of the RGB Pixel LED Patio lamp string DC12V 0.72W/bulb ,20bulbs/string](https://cdn-shop.adafruit.com/product-videos/640x480/6058-03.jpg)

These are 12v lights with approximately 8 inches of space between each bulb. Each strand has 20 bulbs and they come with waterproof connectors on each end and an additional connector for power injection at the far end.

I plugged 4 strands into a daisy-chain, for a total of 80 lights, without a noticeable voltage drop.&nbsp;

### Cafe / Patio Light Bulb Strand with TM1814 RGBW LED - 20 Bulbs

[Cafe / Patio Light Bulb Strand with TM1814 RGBW LED - 20 Bulbs](https://www.adafruit.com/product/6059)
For decorating outdoor spaces, these TM1814-equipped **&nbsp;Cafe / Patio Light Bulb Strands** each have 20 bulbs with a triple RGBW LED inside. They're just like the café lights you see folks string up to add some ambience, but you can control them as RGBW LEDs&nbsp;to...

In Stock
[Buy Now](https://www.adafruit.com/product/6059)
[Related Guides to the Product](https://learn.adafruit.com/products/6059/guides)
![Demo Vid of the microcontroller to the RGBW Pixel LED Patio lamp string DC12V 0.72W/bulb ,20bulbs/string](https://cdn-shop.adafruit.com/product-videos/640x480/6059-04.jpg)

Adafruit also stocks these in RGBW format! They will perfectly emulate standard cafe lights with a golden yellow / white light color for that classic look (until you bust out the Party Time mode!).

## Additional Parts Needed
The Adafruit Sparkle Motion board is perfect for this project. It will power 12v lights without needing an additional level shifter or power breakout. For up to around 300 lights you can power directly through the board with 12v.&nbsp;

### Adafruit Sparkle Motion - All-In-One WLED and xLights Board

[Adafruit Sparkle Motion - All-In-One WLED and xLights Board](https://www.adafruit.com/product/6100)
The&nbsp; **Adafruit Sparkle Motion&nbsp;** is the flagship in&nbsp;our&nbsp;series of "Sparkle Motion" boards, that are our attempt to make the&nbsp;best small&nbsp;WLED-friendly smart LED driving board in the whole world. Our resident mermaid,&nbsp;<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/6100)
[Related Guides to the Product](https://learn.adafruit.com/products/6100/guides)
![Angled shot of rectangular LED driver PCB with green terminal blocks.](https://cdn-shop.adafruit.com/640x480/6100-07.jpg)

If you're setting up your lights in a location that's further away from your WiFi router, use the Sparkle Motion with wFL External Antenna. This will extend the WiFi range of the board considerably, so even if your WiFi's not great in your back yard, this board will still be able to reach.

### Adafruit Sparkle Motion with wFL External Antenna

[Adafruit Sparkle Motion with wFL External Antenna](https://www.adafruit.com/product/6167)
The&nbsp; **Adafruit Sparkle Motion with wFL Antenna&nbsp;** is the flagship in&nbsp;our&nbsp;series of "Sparkle Motion" boards, that are our attempt to make the&nbsp;best small&nbsp;WLED-friendly smart LED driving board in the whole world. Our resident mermaid,&nbsp;<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/6167)
[Related Guides to the Product](https://learn.adafruit.com/products/6167/guides)
![Angled shot of rectangular LED driver board.](https://cdn-shop.adafruit.com/640x480/6167-00.jpg)

Since this is an outdoor installation, it's a good idea to place the electronics inside a weatherproof box to protect them from the elements. This box is just the right size, and has two cable glands for passing power and data wires.&nbsp;

### Flanged Weatherproof Enclosure With PG-7 Cable Glands

[Flanged Weatherproof Enclosure With PG-7 Cable Glands](https://www.adafruit.com/product/3931)
Whether you're raiding tombs or traversing nuclear fallout wastelands, this is the most heavy-duty enclosure for your project! Weatherproof? Check. Tough&nbsp;polycarbonate cover? Check. Built-in gasket seal? Oh yeah, check.

Store your project safe and sound in this **Flanged...**

In Stock
[Buy Now](https://www.adafruit.com/product/3931)
[Related Guides to the Product](https://learn.adafruit.com/products/3931/guides)
![Angled shot of off-white, rectangle-shaped, flanged enclosure.](https://cdn-shop.adafruit.com/640x480/3931-00.jpg)

### Power Supply

These lights require a 12v power supply. [We have a few in the shop](https://www.adafruit.com/product/352) which are great for indoor installations, but if you're putting these out in the garden it's a good idea to look for an outdoor 12v power supply.

Here's the one I ended up using. It's made for landscape lighting, so it's completely weather-proof, and it has some cool additional features like a built-in timer and an automatic light sensor that turns your lights on at sunset.&nbsp;

[60W Outdoor 12v Power Supply](https://a.co/d/cMGuyy7)

This one is rated for 60W, which is way more than I need for this strand of lights, but since I am planning on adding additional landscape lighting to my yard, I went with a solution that will allow for some expansion.

![adafruit_products_powersupply.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/155/medium640/adafruit_products_powersupply.jpg?1716321267)

I like attaching the board with a JST connector, so if I ever want to remove it to reprogram it or use it for another project, I can just unplug it. This is a little more work at first but saves a lot of time down the road.

You'll also need a tiny flat-head screwdriver to use the screw terminal block on the Sparkle Motion board.

### Part: 3 Pin JST Connector
quantity: 1
3-pin JST SM Plug + Receptacle Cable Set
[3 Pin JST Connector](https://www.adafruit.com/product/1663)

### Part: Tiny Screwdriver
quantity: 1
https://www.adafruit.com/product/424
[Tiny Screwdriver](https://www.adafruit.com/product/424)

## Tools & Additional Materials

- Soldering iron & accessories
- Heat shrink tubing
- [Light socket plug adapter](https://a.co/d/cMGuyy7), in case you don't have a power outlet handy

# Programmable 12v Outdoor Cafe Lights

## Wiring Diagram

![](https://cdn-learn.adafruit.com/assets/assets/000/135/682/medium800/adafruit_products_enclosure2.jpg?1741219802)

Warning: Follow the wire colors above, the red and black are 'twisted' through the gland to make the lines straight

The Sparkle Motion board plugs into the power supply through the onboard 2.1mm socket. The LEDs connect to the first 3 screw terminal ports: look closely for the labels and match the LED G pin to -, the data IN pin to 19, and the +12v pin to +.

# Programmable 12v Outdoor Cafe Lights

## Connecting LEDs

These lights come with connectors that have 3 wires: yellow, blue, and red.

The red wire is +12v, blue is G, and yellow is data. These wires will go through the cable gland on the case and connect to the screw terminal at the base of the board. There are markings on the PCB showing which terminal is which. It's set up with three 3-pin strip connections in mind, and each strip has its own power and ground connection. The GPIO pins are labeled: 19, 22, and 21, and they're in the middle of each block of 3 wires.

We'll use pin 19 for this guide but you can add other lights to your Sparkle Motion on the other pins if you'd like.

The IN end of your light strand is the one with the male connector: it has visible pins inside instead of holes.

### A Word About Connectors

It's possible to direct-wire your LED strips or pixels into the screw terminal, but I find it easier and more convenient to use [3-pin JST connectors](https://www.adafruit.com/product/1663) that can be permanently affixed to the Sparkle Motion board with strain relief so they don't pull out. Then I can simply plug in whatever LED strip or strand I want to use.

LED strips often come with these connectors already attached, but there seems to be no standard for whether the factories attach the male or the female connector on the "in" end. For my own peace of mind, I try to be consistent and always use the male side of the connectors on the microcontrollers, and the female on the "in" end of my LED strip. Data is flowing "out" from the microcontroller and "in" to the strip, so the male/female metaphor makes good sense in this arrangement.&nbsp;

There is also no standard as to which way the color coding is wired on these connectors. Some have a red wire on the left side, some on the right side. Some have no color coding at all. Hooking your strips up "backwards" (accidentally connecting a red wire to a black wire) can damage your board and your LEDs, so it's important to be really careful when you're setting up your connectors. Be as consistent as possible with color coding and throw away any connectors you've got in the drawer that are wired "backwards" from the rest.&nbsp;

## Screw Terminal Connections
Use a tiny [precision flat head screwdriver](https://www.adafruit.com/product/424) to carefully and gently open the ports on the screw terminal. These are pretty easy to break so be gentle. Look carefully at the openings as you turn the screws. When you see a square opening appear, stop turning.

Strip about 1/8" of wire from the 3 connector wires and insert carefully into the screw terminals. Use red for +, the middle wire for data, and the remaining wire for -. Gently tighten the screw until it's snug: about 5 turns -- it shouldn't turn freely, if it does, you've got the wire in the wrong part of the hole so pull it out and try again.

![adafruit_products_screwterminal.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/883/medium640/adafruit_products_screwterminal.jpg?1738093664)

![adafruit_products_connectors_stripped.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/134/884/medium640/adafruit_products_connectors_stripped.jpeg?1738093698)

Cut the connector off your power supply, feed the wires through the cable gland and re-solder so the terminal is on the inside of the box.&nbsp;

If your power supply doesn't come with a 2.1mm connector, [we've got them in stock](https://www.adafruit.com/product/369). Just screw it onto the wires with a tiny phillips head screwdriver.

Connect the female side of the JST connector to your LEDs, making sure the wire order matches the male connector in your screw terminal: +5v should match up to +, data IN to GPIO, and G to G. Plug in your strand and power up the board. The board comes pre-loaded with a rainbow animation so your lights should come on if you've got everything hooked up right.

![](https://cdn-learn.adafruit.com/assets/assets/000/135/683/medium640/adafruit_products_IMG_9260.jpeg?1741224259)

# Programmable 12v Outdoor Cafe Lights

## Software

The Sparkle Motion board is an ESP32 controller and is designed to work seamlessly with WLED and xLights. We've included instructions on how to get these set up and working with that software.&nbsp;

**WLED** is the easiest to install and use, especially if you're a non-coder. You can get pretty colors and animations up and running in minutes, and control them with any smart phone or web browser.&nbsp;

Or, if you prefer to code-your-own animations, the Sparkle Motion is also compatible with **Arduino** and with **CircuitPython**.&nbsp;Here are some guides with sample code that can get you started. You may need to make a few changes to the code samples, but these projects can fairly easily be modified to work on the Sparkle Motion.

- [CircuitPython LED Animations](https://learn.adafruit.com/circuitpython-led-animations)
- [Bubble Table with IR Control](https://learn.adafruit.com/bubble-table-with-led-animations-and-ir-remote-control)
- [Adafruit QT Py and NeoPixel LEDs](https://learn.adafruit.com/qt-py-and-neopixel-leds)
- [Cheerlights Holiday Animations](https://learn.adafruit.com/cheerlights-led-animations)
- [FancyLED Library for CircuitPython](https://learn.adafruit.com/fancyled-library-for-circuitpython)

Or, head to the Arduino Code page for a step-by-step guide to installing a beautiful animation using Arduino.

# Programmable 12v Outdoor Cafe Lights

## WLED Software

## Driver Update

Some versions of our controllers have a new serial chip which needs a driver installed before we can install WLED. Head over to our&nbsp;[How to Install Drivers for WCH USB to Serial Chips](https://learn.adafruit.com/how-to-install-drivers-for-wch-usb-to-serial-chips) tutorial, and download and install the new driver.

If you have an older QT Py with CP2102 USB-to-Serial bridge, [use SiLabs’ driver instead](https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers?tab=downloads).

&nbsp;

## Install WLED

These next steps require a **_Web Serial_-compatible browser**. As of this writing, that means **Google&nbsp;Chrome** , **Microsoft&nbsp;Edge** or **Opera** , or **Firefox** “desktop” browsers. Other browsers (Safari, Explorer and _anything_ mobile) won’t work.

Visit [https://install.wled.me/](https://install.wled.me/)

Plug your microcontroller into your computer with a known good USB cable. Click "Install" and select the port for your board.

Depending on the USB-to-serial bridge chip on the board, you might see one _or two_ serial ports. On Mac, for instance, there might be both “/dev/cu.usbmodem[number]” _and_ “/dev/cu.wchusbserial[number]”. Use the “ **wchusbserial** ” one.

![adafruit_products_Install_WLED.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/287/medium640/adafruit_products_Install_WLED.jpg?1663802069)

After successful installation, enter your WiFi network name and password when prompted. This must be a **2.4 GHz** WiFi network; ESP32 does not support 5 GHz networks. If it can’t connect, then as a fallback WLED will create its own 2.4 GHz WiFi access point.

![led_strips_Install_WLED.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/601/medium640/led_strips_Install_WLED.jpg?1737574345)

If you don't see the "Connect to Wi-Fi" prompt, you'll need to set up your WiFi network using AP (access point) mode.&nbsp;Open up your WiFi settings and look for a WiFi network called&nbsp;`WLED-AP`. Connect to this network&nbsp;using the default password&nbsp;`wled1234`. The WLED interface will pop up in its own browser.

From here, go into Config/Wifi Settings and enter your WiFi credentials near the top. Give your project a name in the mDNS field a little further down the page. Now you can type in "projectname.local" (where "projectname" is your mDNS name) into any web browser on the same wifi network to access your microcontroller.

You can also scan the QR code below to open access point mode.&nbsp;

For more help and troubleshooting tips visit the [Getting Started page on the WLED knowledge base.](https://kno.wled.ge/basics/getting-started/)

![led_strips_install_no_wifi.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/597/medium640/led_strips_install_no_wifi.jpg?1737574050)

![led_strips_WLED_wifi_settings.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/598/medium640/led_strips_WLED_wifi_settings.jpg?1737574103)

![](https://cdn-learn.adafruit.com/assets/assets/000/134/599/medium800/led_strips_WLED-QR-Connect-WB.png?1737574151)

## Setup & Preferences
### WiFi&nbsp;Setup

Head to the **WiFi Setup** screen under Config and create a good URL so you can control your project from any web-enabled device. Call it something you'll remember, that's easy to type into any web browser on your WiFi network in order to connect to your project.

In Safari or Chrome on your phone or computer, type in this web address to access the WLED interface: [http://projectname.local](http://projectname.local)&nbsp; (where "projectname" is whatever you put into this field).

Check out the Additional Settings page for more info on accessing your project. WLED has an "access point mode" that doesn't require a WiFi network for when you're out on the go. It's also helpful to download one of the WLED apps to help manage and organize your projects.

![adafruit_products_wled_config.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/288/medium640/adafruit_products_wled_config.jpg?1663802411)

![led_strips_adafruit_products_WiFi_Settings_generic.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/679/medium640/led_strips_adafruit_products_WiFi_Settings_generic.jpg?1722624553)

### LED Preferences

Next, head to the **LED Preferences** tab under the Config menu.

Scroll down to&nbsp; **Hardware Setup**. Put your total number of LEDs in your whole set up into the "Length" field -- these strands have 20 lights each.

If you're using the RGB version of these lights the settings are as follows:&nbsp;

- Type: WS281x
- mA/LED: 30mA (typ 12v)
- Color Order: RBG
- Length: (put in your total number of lights here)
- Data: 19 (or whatever pin you soldered to)

For the RGBW version:

- Type: TM1914
- mA/LED: 33mA (typ 12v)
- Color Order: GRB
- Length: (put in your total number of lights here)
- Data: 19 (or whatever pin you soldered to)=

![](https://cdn-learn.adafruit.com/assets/assets/000/135/827/medium640/adafruit_products_rgb_version.jpg?1742329883)

![](https://cdn-learn.adafruit.com/assets/assets/000/135/828/medium640/adafruit_products_Cursor_and_LED_Settings.jpg?1742329909)

## Use It
![adafruit_products_WLED_interface.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/394/medium800/adafruit_products_WLED_interface.jpg?1667150591)

Now you can use any computer or handheld device to control your LEDs.&nbsp;

Make sure your device is on the same WiFi network as your board. Navigate to your custom URL (projectname.local/ ) in a web browser. You'll see a color picker above a whole bunch of color palette choices.

Choose a color, choose an effect, and watch your lights animate and glow!

Save your favorite combinations as presets, create playlists, control the speed and intensity of the animations, and lots more. This web app is incredibly intuitive and easy to use.

Head over to the WLED wiki at [https://kno.wled.ge/](https://kno.wled.ge/) to delve into all the particulars.

# Programmable 12v Outdoor Cafe Lights

## WLED Config

Next we'll tell WLED about our physical setup. We'll give our project a name and easy-to-remember URL, and tell the software how many LEDs we have set up on each pin.

### WiFi&nbsp;Setup

Head to the **WiFi Setup** screen under Config. This is where your network credentials live, so you can change them if needed. Scroll down to the mDNS field and create a good URL so you can control your project from any web-enabled device. Call it something you'll remember, that's easy to type into any web browser on your WiFi network in order to connect to your project.&nbsp;

In this example, I'd go to my web browser on my phone, ipad, or computer, and type in "http://projectname.local" to open up the WLED interface on my screen.&nbsp; Your device must be on the same WiFi network as your board.

![adafruit_products_wled_config.jpg](https://cdn-learn.adafruit.com/assets/assets/000/115/288/medium640/adafruit_products_wled_config.jpg?1663802411)

![led_strips_adafruit_products_WiFi_Settings_generic.jpg](https://cdn-learn.adafruit.com/assets/assets/000/131/679/medium640/led_strips_adafruit_products_WiFi_Settings_generic.jpg?1722624553)

### LED Preferences

Next, head to the **LED Preferences** tab under the Config menu.

Scroll down to&nbsp; **Hardware Setup**. The Sparkle Motion board has 4 spots to attach LED strips: the screw terminal uses GPIO 19, 22, and 21 and the through-hole solder pads to the left of the screw terminal is GPIO 23.

WLED allows up to 4 strips to be connected at once. The strips can be of different types, lengths, and color order. Select your LED type, length, and GPIO pin. If you have multiple strips connected, click the + button and enter the additional strips in the same way.&nbsp;

![adafruit_products_05_hardware_setup.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/446/medium640/adafruit_products_05_hardware_setup.jpg?1736806054)

![adafruit_products_07_hardware_2strands.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/447/medium640/adafruit_products_07_hardware_2strands.jpg?1736806282)

Click "save" and if you've done everything correctly, your light strands should come on in a warm, cheerful yellow color. Success! Time to start making pretty light animations.&nbsp;

## Troubleshooting

_If your lights didn't come on, here are a few things to try:_

1. Head back to WLED and check your pinout configuration under LED Preferences. Be sure the pin number is the correct GPIO for the attachment point you used.
2. Check your wiring! Be sure you connected to the IN end of the LED strip. These strips can be inconsistent so this is a pretty common problem. Use an [alligator clip](https://www.adafruit.com/product/1008) to try connecting the data wire on the other end (the power and ground wires should work from either end).
3. Try re-uploading the WLED software.&nbsp;
4. If the lights come on but you can't control them: i.e. you type in "projectname.local" into your browser and it won't connect, make sure you're on the correct WiFi network. If you're on a different network than the one you set up the sofware on, you won't see the WLED connection.
5. If your lights came on in blue or green instead of yellow, your color order is wrong. See below to fix.
6. If only half your lights came on, be sure you've got the correct number in the "length" field under LED preferences.
7. If your lights came on in a variety of weird colors and looking like a 1950s diner interior, you may have the wrong LED strip type selected. RGBW strips and RGB strips are not the same, so be sure you've got the correct strip type or you'll get very odd behavior.
8. If your microcontroller hangs or keeps rebooting, or gets really hot, you may have the power and ground lines switched. Unplug right away and check: this is a fast way to brick your controller.

## Color Order
If your lights have come on in any color other than a warm yellow, there's one more setting to change. LED strips and pixels are not all standardized, and sometimes the red, green, and blue LEDs inside are connected in a different order.&nbsp;

In the main interface window, choose "solid" as your effect and red as your color from the color picker.&nbsp;

If your lights come on in any color other than red, your color order is set incorrectly. This is an easy fix. Head back to the LED settings tab and find the Hardware Setup section (this is where you set up your pin number earlier). Choose BRG from the dropdown, click save, and see if your pixel colors match your color picker now. If not, try another combo until the lights look correct.

![adafruit_products_15_rgb_order1.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/134/448/medium640/adafruit_products_15_rgb_order1.jpeg?1736806444)

![adafruit_products_16_rgb_order2.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/134/449/medium640/adafruit_products_16_rgb_order2.jpeg?1736806608)

# Programmable 12v Outdoor Cafe Lights

## IR Remote Setup

Adding infrared control to your project is easy. WLED comes preprogrammed to use a variety of common IR remote controls, so you can get instant functionality with just a little bit of setup.

The Sparkle Motion board has an onboard IR sensor on pin 32. It's also not too hard to set up your own IR sensor on the stemma port on **GPIO 27,** in case you want a more accessible sensor if your board is hidden inside an enclosure or inconveniently located.&nbsp;

Click the LED Preferences tab and scroll down to Hardware Setup.

Change the IR GPIO pin to **32** and select which remote you're using from the dropdown. I like this [44 key remote](https://a.co/d/goUSZzu) since it gives me quick full-strip color control as well as plenty of customizable buttons to use with my different presets.

![sensors_LED_Settings-2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/126/346/medium640/sensors_LED_Settings-2.jpg?1701219467)

## Remote Usage: 44 Key Remote

Change the brightness or turn the strip on and off with the buttons on the top row.

When you have the "solid" effect selected in WLED, the color buttons near the top of the remote will change the colors, making the pixels act like a "dumb" RGB strip.&nbsp;

On my 44-key remote, there are buttons near the bottom labeled "DIY1", "DIY2" etc. WLED will automatically assign your animation presets to these buttons so you can select your favorite presets or playlists. Simply save the presets you want to the first 6 preset slots and the buttons will pull them up.&nbsp;

Head over to the WLED wiki at [https://kno.wled.ge/](https://kno.wled.ge/) to delve into all the particulars.

## Adding a Wired IR Sensor

Sometimes you want to place your IR sensor further away from your microcontroller to make an easier line-of-sight for the remote control. Here's how to add a wired IR sensor or IR breakout to the Stemma port on the Sparkle Motion board to make this easy. Use&nbsp; **GPIO**  **27** in config.

You'll need an [IR sensor](https://www.adafruit.com/product/157) and a [STEMMA JST 3-pin connector](https://www.adafruit.com/product/3894) with female sockets. Plug the connector into the smaller of the two Stemma ports. Looking at the sensor with the bump facing you:

- White wire on the left
- Black wire in the middle
- Red wire on the right

You can lengthen the wires as needed so your IR sensor ends up right where you want it.&nbsp;

We also have these handy [IR breakout boards available](https://www.adafruit.com/product/5939).

![adafruit_products_ir_sensor.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/134/882/medium640/adafruit_products_ir_sensor.jpeg?1738093552)

# Programmable 12v Outdoor Cafe Lights

## WLED Audioreactive Setup

The Sparkle Motion board comes with an onboard PDM microphone, so adding audio reactivity to your project is easy. Here's how to get it set up.

Click **Config** and then select the **Usermods** tab. Scroll down a bit and you'll find the AudioReacive section.&nbsp;

Click the box to enable, then enter the settings and the Digitalmic section as follows:

- Type: **Generic I2S**
- Pin I2S SD: **25**
- Pin I2S WS: **33**
- Pin&nbsp;I2S SCK: **26**

The other pins are unused.

Reboot your microcontroller for changes to take effect.

![adafruit_products_10_audioreactive.jpg](https://cdn-learn.adafruit.com/assets/assets/000/134/451/medium640/adafruit_products_10_audioreactive.jpg?1736814602)

There are a lot of other settings you can adjust in WLED. I found that the default settings for this mic seem to work perfectly, but you can delve into the particulars at [https://kno.wled.ge/advanced/audio-reactive/](https://kno.wled.ge/advanced/audio-reactive/)

To use audio reactive mode, head back to the main interface and select any effect that has a music note icon next to the name. Make some noise and see how your lights react.

# Programmable 12v Outdoor Cafe Lights

## Arduino Code

This code example uses the FastLED library, and is modified from a sketch called DesignerPalettes by Mark Kriegsman.

It's a great idea to get your software all set up and loaded onto your board right away, to make testing your connections easier later on.

To get the code running you'll need:

1. Arduino IDE (1.8 or newer)
2. Adafruit Board support for QT Py
3. Arduino libraries: FastLED, Adafruit\_NeoPixel

### 1. Arduino IDE

If you’re not using a recent version of the Arduino IDE, this would be a [good time to upgrade](https://www.arduino.cc/en/Main/Software).&nbsp; If this is your first time using Arduino, [head over to this guide to get it installed](../../../../adafruit-arduino-ide-setup/arduino-1-dot-6-x-ide).&nbsp; It's free and fairly simple to get set up.

### 2. Board Support

You'll need to tell the Arduino IDE which board you're using.&nbsp; This takes just a few minutes of setup, and you'll only need to do it once.&nbsp;

[Here is a step-by-step tutorial for setting up QT Py](https://learn.adafruit.com/adafruit-qt-py/arduino-ide-setup)

### 3. Libraries

Both libraries can be installed using the Arduino Library Manager — use **Sketch** → **Include Library** → **Manage Libraries…** and search for all or part of the library’s name, then click “Install.”

Look for:

- `FastLED`
- `Adafruit_NeoPixel`

`Adafruit_NeoPixel` isn’t absolutely required for this project, but it’s handy to have installed in case you have problems with FastLED. Troubleshooting the basics is a little easier with `Adafruit_NeoPixel`.

## Upload the Code

Get the code by clicking "Download Project Zip" in the code listing below. Unzip the code into your Arduino project folder.

Plug your microcontroller into your computer with a USB cable.&nbsp; In the Arduino IDE, go to **File -\> Open** to open the code file. Go to **Tools -\> Boards** and select the name of the board: Adafruit QT PY (SAMD21).&nbsp; Then go to **Tools -\> Port** and select the board there too.&nbsp; (If it's not showing up there, be sure your microcontroller is plugged into your computer via USB).

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Programmable_12v_Outdoor_Cafe_Lights/Programmable_12v_Outdoor_Cafe_Lights.ino

# Programmable 12v Outdoor Cafe Lights

## Creating Color Palettes

http://www.youtube.com/watch?v=7CDgxgyALWQ

 **FastLED Color Palettes**

Using the FastLED library opens up a world of LED coding tools that are fairly easy to use.&nbsp;

There's a fantastic tool called **PaletteKnife** that works great for artist-minded people who think in colors instead of in code, and this project uses it.&nbsp;

Watch the video above for a demo of just how easy this is.

**Want to try PaletteKnife and grab some new color palettes?**  
Here's what you'll _definitely_ need:

1. A basic understanding of how FastLED palettes are used.&nbsp; Check out the FastLED ColorPalette example, as well as FastLED Fire2012WithPalette example, both of which can be found in the&nbsp;[FastLED library](https://github.com/FastLED/FastLED) Examples folder.
2. You'll need Chrome or Safari. &nbsp;PaletteKnife doesn't work with Firefox or IE.
3. You will also need a little patience; it's not terribly slick but it works a dream.

Basically, you browse to the color palette that you want, and click PaletteKnife (a bookmarklet) in your browser. &nbsp;Then you COPY the resulting code, and PASTE it into your FastLED animation source code.&nbsp;

**Full instructions on how to get started with PaletteKnife are here:**  
[http://fastled.io/tools/paletteknife/](http://fastled.io/tools/paletteknife/)

![](https://cdn-learn.adafruit.com/assets/assets/000/031/100/medium800/led_pixels_cpt-city-examples.png?1457733973)

![](https://cdn-learn.adafruit.com/assets/assets/000/031/303/medium800/led_pixels_IMG_6127.jpg?1458071394)

# Programmable 12v Outdoor Cafe Lights

## Electronics Assembly

Solder the headers to the top / front of the QT Py. The easiest way to do this is to place the headers into a solderless breadboard with the short ends up, and set the QT Py on top upside-down, so you're soldering to the back of the board.

![adafruit_products_solder_headers_(1).jpeg](https://cdn-learn.adafruit.com/assets/assets/000/130/158/medium640/adafruit_products_solder_headers_%281%29.jpeg?1716322278)

The QT Py will plug in to the female headers on bottom of the BFF. Be sure the USB port on the QT Py is aligned with the 2.1mm jack. Double check that the pins are lining up correctly -- it's easy to mix this up and you can damage your board if you plug it in backwards.

If you're new to header usage, check out our guide on [how to solder headers.](https://learn.adafruit.com/how-to-solder-headers/overview)

![adafruit_products_stemma_in.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/130/159/medium640/adafruit_products_stemma_in.jpeg?1716322425)

Cut your Stemma connector in half and strip some shielding from the yellow wire. Slip a piece of heat shrink on there.&nbsp;

![adafruit_products_02_strip_yellow.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/130/160/medium640/adafruit_products_02_strip_yellow.jpeg?1716322638)

The light strand has 3 wires: power, ground, and data. The data wire is directional: solder to the IN end and not the OUT end or it won't work.&nbsp;

My lights were helpfully labeled at the factory, but not all lights from all sources will be labeled, and they aren't always standardized. The only way to be sure you're getting it right is to test.&nbsp;

Alligator clips can be very helpful here -- make your connections temporarily and be sure everything works before your solder.

![adafruit_products_alligator-clips.jpg](https://cdn-learn.adafruit.com/assets/assets/000/130/172/medium640/adafruit_products_alligator-clips.jpg?1716323964)

Testing is a little tricky here. We can't just hook the clips to a Circuit Playground Express running known good code, since these lights require 12v power. So we'll need to test with our QT Py and BFF setup.&nbsp;

Connect the red and black alligator clips to wires coming from the screw terminal or 2.1mm jack on the BFF, and the data wire clip to the yellow wire on the stemma. If your lights don't come on, try connecting JUST the data wire to the other end of the strand.

Once I'd figured out which wire was which, I added some color-coding by soldering a red wire to the power (striped) wire on the connector, a yellow wire to the middle (data) wire, and a black wire to the remaining (g) wire. This way, it was easy to keep the wires straight once I got them inside the box.

If your power supply has a 2.1mm or other jack, cut it off. Thread the wires through one of the cable glands from the outside so the bare wire is inside the box.&nbsp;

Slip the 3 wires from your light strand's extra connector through the other cable gland. I attached a female connector to the box, since my IN end on my lights has a male connector.

Connect all the power wires to the BFF, using either the reconnected 2.1mm jack, or a male 2.1mm screw terminal, or the included screw terminals. It doesn't matter which way you connect the wires, just&nbsp; be sure both red wires are going to + and both black wires are going to -.

![adafruit_products_all_connections.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/130/165/medium640/adafruit_products_all_connections.jpeg?1716323186)

Splice the third (middle) wire from your connector to the yellow wire from the Stemma connector and plug it into the QT Py, then plug the QT Py into the BFF.

All wires accounted for? Double check once more that reds are going to + and blacks are going to -, then plug in your light strand and your power supply to light up your strand.

Splice the third (middle) wire from your connector to the yellow wire from the stemma connector and plug it into the QT Py, then plug the QT Py into the BFF.

All wires accounted for? Double check once more that reds are going to + and blacks are going to -, then plug in your light strand and your power supply to light up your strand.

![adafruit_products_box_done.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/130/173/medium640/adafruit_products_box_done.jpeg?1716324706)

## Troubleshooting

If your lights don't come on or act strangely, here are some things to try:

1. Try connecting the data wire to the other end of the strand. The data wire on these lights are directional.
2. Be sure your screw terminal connections are tight and haven't pulled out. Add some zip ties to either side of the cable gland to act as strain relief.
3. Be sure you've uploaded the code successfully, and that the correct data pin is specified.&nbsp;
4. If your lights are on but the colors are unexpected, try changing the color order in the code. Look for a line that shows BRG, RGB, GRB, etc and just mix the letters up and re-upload. This tells the code to look for Blue, then Red, then Green (or whatever order you've specified). This isn't really standardized so can cause the colors to come out wrong.
5. Flickering? Try a different power supply.
6. One light comes on? Your power and ground wires may be reversed.

Once it's all working, tighten the cable glands and close up the box with the included screws. I added some industrial velcro to stick my box to my power supply, and put zip ties on the inside and outside of the cable glands to add additional strain relief.

![](https://cdn-learn.adafruit.com/assets/assets/000/130/174/medium800/adafruit_products_box_sealed.jpeg?1716325085)


## Featured Products

### Cafe / Patio Light Bulb Strand with NeoPixel RGB LED - 20 Bulbs

[Cafe / Patio Light Bulb Strand with NeoPixel RGB LED - 20 Bulbs](https://www.adafruit.com/product/6058)
For decorating outdoor spaces, these NeoPixel-equipped **&nbsp;Cafe / Patio Light Bulb Strands** each have 20 bulbs with a triple&nbsp;NeoPixel RGB LED inside. They're just like the café lights you see folks string up to add some ambience, but you can control them just...

In Stock
[Buy Now](https://www.adafruit.com/product/6058)
[Related Guides to the Product](https://learn.adafruit.com/products/6058/guides)
### Cafe / Patio Light Bulb Strand with TM1814 RGBW LED - 20 Bulbs

[Cafe / Patio Light Bulb Strand with TM1814 RGBW LED - 20 Bulbs](https://www.adafruit.com/product/6059)
For decorating outdoor spaces, these TM1814-equipped **&nbsp;Cafe / Patio Light Bulb Strands** each have 20 bulbs with a triple RGBW LED inside. They're just like the café lights you see folks string up to add some ambience, but you can control them as RGBW LEDs&nbsp;to...

In Stock
[Buy Now](https://www.adafruit.com/product/6059)
[Related Guides to the Product](https://learn.adafruit.com/products/6059/guides)
### Adafruit Sparkle Motion - All-In-One WLED and xLights Board

[Adafruit Sparkle Motion - All-In-One WLED and xLights Board](https://www.adafruit.com/product/6100)
The&nbsp; **Adafruit Sparkle Motion&nbsp;** is the flagship in&nbsp;our&nbsp;series of "Sparkle Motion" boards, that are our attempt to make the&nbsp;best small&nbsp;WLED-friendly smart LED driving board in the whole world. Our resident mermaid,&nbsp;<a...></a...>

Out of Stock
[Buy Now](https://www.adafruit.com/product/6100)
[Related Guides to the Product](https://learn.adafruit.com/products/6100/guides)
### Adafruit Sparkle Motion with wFL External Antenna

[Adafruit Sparkle Motion with wFL External Antenna](https://www.adafruit.com/product/6167)
The&nbsp; **Adafruit Sparkle Motion with wFL Antenna&nbsp;** is the flagship in&nbsp;our&nbsp;series of "Sparkle Motion" boards, that are our attempt to make the&nbsp;best small&nbsp;WLED-friendly smart LED driving board in the whole world. Our resident mermaid,&nbsp;<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/6167)
[Related Guides to the Product](https://learn.adafruit.com/products/6167/guides)
### Flanged Weatherproof Enclosure With PG-7 Cable Glands

[Flanged Weatherproof Enclosure With PG-7 Cable Glands](https://www.adafruit.com/product/3931)
Whether you're raiding tombs or traversing nuclear fallout wastelands, this is the most heavy-duty enclosure for your project! Weatherproof? Check. Tough&nbsp;polycarbonate cover? Check. Built-in gasket seal? Oh yeah, check.

Store your project safe and sound in this **Flanged...**

In Stock
[Buy Now](https://www.adafruit.com/product/3931)
[Related Guides to the Product](https://learn.adafruit.com/products/3931/guides)
### 12V 5A switching power supply

[12V 5A switching power supply](https://www.adafruit.com/product/352)
This is a beefy switching supply, for when you need a lot of power! It can supply 12V DC up to 5 Amps, running from 110V or 220V power (the plug it comes with is for US/Canada/Japan but you can use any plug adapter for your country, or just replace the cable with a standard 'figure-8'...

In Stock
[Buy Now](https://www.adafruit.com/product/352)
[Related Guides to the Product](https://learn.adafruit.com/products/352/guides)
### Precision screwdriver set (6 pieces)

[Precision screwdriver set (6 pieces)](https://www.adafruit.com/product/424)
Break seals! Void warranties! With this handy screwdriver set at your hands, all hardware you touch will open up and reveal their secret innards.  
  
This set contains 6 screwdrivers, 3 Phillips (#1, #0 and #00) and 3 flat (2.4mm, 1.8mm and 1.4mm). These sizes will open up pretty much...

In Stock
[Buy Now](https://www.adafruit.com/product/424)
[Related Guides to the Product](https://learn.adafruit.com/products/424/guides)
### 3-pin JST SM Plug + Receptacle Cable Set

[3-pin JST SM Plug + Receptacle Cable Set](https://www.adafruit.com/product/1663)
These 3-wire cables are 163mm (6.4") long and come as a set. One cable has a JST SM type connector plug on the end. The other cable has a matching JST SM type receptacle connector. They are good for whenever you have 3 wires you want to be able to plug and unplug. We like the solid and...

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

## Related Guides

- [Adafruit Sparkle Motion](https://learn.adafruit.com/adafruit-sparkle-motion.md)
- [Adafruit QT Py SAMD21](https://learn.adafruit.com/adafruit-qt-py.md)
- [Adafruit SHT31-D Temperature & Humidity Sensor Breakout](https://learn.adafruit.com/adafruit-sht31-d-temperature-and-humidity-sensor-breakout.md)
- [Adafruit Proto Doubler PiCowbell](https://learn.adafruit.com/adafruit-proto-doubler-picowbell.md)
- [Adafruit ATWINC1500 WiFi Breakout](https://learn.adafruit.com/adafruit-atwinc1500-wifi-module-breakout.md)
- [Adafruit NeoKey 1x4 QT I2C Breakout](https://learn.adafruit.com/neokey-1x4-qt-i2c.md)
- [Adafruit 2.2" PiTFT HAT - 320x240 Display](https://learn.adafruit.com/adafruit-2-2-pitft-hat-320-240-primary-display-for-raspberry-pi.md)
- [Adafruit ADXL375](https://learn.adafruit.com/adafruit-adxl375.md)
- [Adafruit VL53L4CD Time of Flight Distance Sensor](https://learn.adafruit.com/adafruit-vl53l4cd-time-of-flight-distance-sensor.md)
- [Arduino Lesson 10. Making Sounds](https://learn.adafruit.com/adafruit-arduino-lesson-10-making-sounds.md)
- [Adafruit NeoPXL8 FeatherWing and Library](https://learn.adafruit.com/adafruit-neopxl8-featherwing-and-library.md)
- [Adafruit SPI FLASH Breakouts](https://learn.adafruit.com/adafruit-spi-flash-breakouts.md)
- [Hexpad](https://learn.adafruit.com/hexpad.md)
- [Adafruit SCD-40 and SCD-41](https://learn.adafruit.com/adafruit-scd-40-and-scd-41.md)
- [Adafruit ENS161 MOX Gas Sensor](https://learn.adafruit.com/adafruit-ens161-mox-gas-sensor.md)
- [Multi-tasking the Arduino - Part 1](https://learn.adafruit.com/multi-tasking-the-arduino-part-1.md)
