# MUNNY Glowing Friend with Bluetooth Control!

## Overview

https://youtu.be/6sZIqa5Ponk

![](https://cdn-learn.adafruit.com/assets/assets/000/064/916/medium800/leds_IMG_6143_2k.jpg?1541132703)

MUNNY DIY is a designer toy figure designed to be modified. So, instead of simply painting him to change his appearance, let's fill him with electronics so he can glow all the colors of the rainbow at the touch of a wireless button!

We'll use the [Adafruit Prop-Maker Wing](https://www.adafruit.com/product/3988) paired with a [Feather M0 Bluefruit LE board](https://www.adafruit.com/product/2995) to drive a [3W RGB LED](https://www.adafruit.com/product/2530). Communications will come from the free Adafruit Bluefruit Connect app on your iOS or Android device!

## Parts
### Part: Adafruit Prop-Maker 
quantity: 1
FeatherWing
[Adafruit Prop-Maker ](https://www.adafruit.com/product/3988)

### Part: Adafruit Feather M0 Bluefruit LE
quantity: 1
Bluetooth LE microcontroller of the future
[Adafruit Feather M0 Bluefruit LE](https://www.adafruit.com/product/2995)

### Part: 3W RGB LED
quantity: 1
Common Anode
[3W RGB LED](https://www.adafruit.com/product/2530)

### Part: Lithium Ion Cylindrical Battery
quantity: 1
3.7v 2200mAh
[Lithium Ion Cylindrical Battery](https://www.adafruit.com/product/1781)

### Part: SPDT Toggle Switch
quantity: 1
Mini Panel Mount 
[SPDT Toggle Switch](https://www.adafruit.com/product/3221)

### Part: Premium Male/Female Raw Jumper Wires
quantity: 1
 40 x 6"
[Premium Male/Female Raw Jumper Wires](https://www.adafruit.com/product/3633)

### Part: Small Single Row Wire Housing Pack
quantity: 1
for DIY Jumper Cables
[Small Single Row Wire Housing Pack](https://www.adafruit.com/product/3145)

### Part:  Panel Mount Extension USB Cable
quantity: 1
Micro B Male to Micro B Female
[ Panel Mount Extension USB Cable](https://www.adafruit.com/product/3258)

### Part: 5V 2.5A Switching Power Supply
quantity: 1
with 20AWG MicroUSB Cable
[5V 2.5A Switching Power Supply](https://www.adafruit.com/product/1995)

### Part: USB Patterned Fabric Cable
quantity: 1
A/MicroB
[USB Patterned Fabric Cable](https://www.adafruit.com/product/2008)

### Part: Break-away 0.1" 36-pin strip right-angle male header
quantity: 1
10 pack
[Break-away 0.1" 36-pin strip right-angle male header](https://www.adafruit.com/product/1540)

### Part: Short Feather Male Headers
quantity: 1
12-pin and 16-pin set
[Short Feather Male Headers](https://www.adafruit.com/product/3002)

### Part: Short Feather Female Headers
quantity: 1
12-pin and 16-pin set
[Short Feather Female Headers](https://www.adafruit.com/product/2940)

### Part: Multi-Colored Heat Shrink Pack
quantity: 1
3/32" + 1/8" + 3/16" Diameters
[Multi-Colored Heat Shrink Pack](https://www.adafruit.com/product/1649)

## Materials

You'll need to get a plain white urban vinyl toy, such as our good friend [MUNNY from Kid Robot](https://www.kidrobot.com/collections/munny). For this guide I used the 7" version. You could use the smaller 4" version, but you would need to leave some of the parts outside the guy!

![](https://cdn-learn.adafruit.com/assets/assets/000/065/061/medium800/leds_IMG_5951_2k.jpg?1541138056)

A quick search for the term **blank vinyl figure** &nbsp;yields all sorts of fun figures that would look great filled with colored light!

![](https://cdn-learn.adafruit.com/assets/assets/000/064/913/medium800/leds_blankVinyl.png?1541116190)

## Tools

The only tool required to operate on your vinyl figure is a hobby knife. Optionally, a heat gun or hair dryer will allow you to soften the vinyl and make it much easier to cut.

For the circuit, you'll need a soldering iron and solder, wire cutters, and wire strippers.

Warning: 

# MUNNY Glowing Friend with Bluetooth Control!

## Build the Circuit

![](https://cdn-learn.adafruit.com/assets/assets/000/064/914/medium800/leds_munny_fritz_A.png?1541116491)

This diagram shows how the circuit will be laid out. The RGB LED and on/off switch will be connected to the Prop-Maker Wing using header pins and shrouded ("DuPont") connectors. We'll have the Prop-Maker Wing plugged into the Feather M0 Bluefruit, and the battery plugged into the Feather.

## Feather Headers

To keep a low profile when fitting the electronics into our MUNNY figure, we'll use low-profile headers to connect the Prop-Maker Wing to the Feather M0 Bluefruit board.

Start by soldering the female headers to the Feather and the male headers to the Prop-Maker Wing as shown below.

![](https://cdn-learn.adafruit.com/assets/assets/000/064/922/medium800/leds_IMG_5986_2k.jpg?1541134458)

![](https://cdn-learn.adafruit.com/assets/assets/000/064/923/medium800/leds_IMG_5995_2k.jpg?1541134467)

![](https://cdn-learn.adafruit.com/assets/assets/000/064/926/medium800/leds_IMG_5997_2k.jpg?1541134806)

## 3W LED Wiring

We'll use a set of four jumper wires to connect the LED to the board. The Prop-Maker Wing has a common anode RGB LED driver (triple MOSFET action!) and four breakout pads. We'll connect right-angle header pins to the board, and use a single-row wire housing on female jumper wires to make the connect to the LED.

Start by connecting the four wires as shown into the housing. I'm using:

- **yellow** for **+ voltage**
- **orange** for **R**
- **green** for **G**
- **blue** for **B**

![](https://cdn-learn.adafruit.com/assets/assets/000/064/931/medium800/leds_IMG_5999_2k.jpg?1541134819)

The wire crimp connectors click satisfyingly into place! **Note how the yellow wire is routed to the far left.**

![](https://cdn-learn.adafruit.com/assets/assets/000/064/948/medium800/leds_IMG_6003_2k.jpg?1541134892)

Trim, strip, and tin the other end of the wires as shown in preparation for soldering to the LED.

Next, tin the four pads on the LED and then solder the wires to the corresponding pads.

![](https://cdn-learn.adafruit.com/assets/assets/000/064/984/medium800/leds_IMG_6028_2k.jpg?1541135070)

## LED Headers

Snap off a 4-pin section of right-angled header pins. To get a good placement, insert them into the LED cable housing, fit them onto the Prop-Maker Wing, and tape it in place.

![](https://cdn-learn.adafruit.com/assets/assets/000/064/992/medium800/leds_IMG_6029_2k.jpg?1541135135)

Flip the board over and solder the four pins in place.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/015/medium800/leds_IMG_6040_2k.jpg?1541135373)

## On / Off Switch Header

We'll use this same technique to make a low profile connection for the On / Off switch to the En(able) and GND pins on the Prop-Maker Wing. We'll connect these to the underside of the board.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/017/medium800/leds_IMG_6044_2k.jpg?1541135458)

![](https://cdn-learn.adafruit.com/assets/assets/000/065/028/medium800/leds_IMG_6054_2k.jpg?1541135548)

## Button Wiring

The toggle switch is a SPDT (single pole, dual throw) which means we can connect one wire to the center terminal and the other to either outside terminal. Cut, strip, and tin the two wires, then add some heat shrink tubing (optional), and solder the wires to the switch as shown.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/035/medium800/leds_IMG_6057_2k.jpg?1541135761)

## Plug and Play

You can now plug in the LED cable and on/off switch to the Prop-Maker Wing, and then fit it onto the Feather M0 Bluefruit board.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/052/medium800/leds_IMG_6086_2k.jpg?1541135983)

Next, let's program the Feather!

# MUNNY Glowing Friend with Bluetooth Control!

## Code in Arduino

Here we'll code the board in Arduino to change colors using the [Bluefruit app on iOS](https://itunes.apple.com/app/adafruit-bluefruit-le-connect/id830125974?mt=8) and [Android](https://play.google.com/store/apps/details?id=com.adafruit.bluefruit.le.connect), as well as to react to tilting your MUNNY to change to a random color.

There's a lot of info to digest on the Feather M0 Bluefruit LE, so [check out the guide here](https://learn.adafruit.com/adafruit-feather-m0-bluefruit-le/overview) if you have questions.

First, [get set up with Arduino IDE as detailed here](https://learn.adafruit.com/adafruit-feather-m0-bluefruit-le/setup).

Next, [follow these instructions](https://learn.adafruit.com/adafruit-feather-m0-bluefruit-le/installing-ble-library) on getting the proper libraries installed. In this code we use the following libraries:

- **Adafruit\_BLE**
- **Adafruit\_Bluefruit\_SPI**
- **Adafruit\_BluefruitLE\_UART**
- **Adafruit\_LIS3DH**

The first three come from installing the **Adafruit BluefruitLE nRF51** library.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/113/medium800/leds_nrflib.png?1541167479)

The other library to install is **Adafruit LIS3DH** , which is for the accelerometer built onto the Prop-Maker Wing.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/114/medium800/leds_accellib.png?1541167590)

Once you've updated the board definitions as shown, you'll be able to select **Adafruit Feather M0** as your board for compiling and uploading.

Before you continue, make sure you can plug in your Feather over USB and upload the Blink sketch found in Arduino IDE menu **Examples \> 01.Basics \> Blink**

If everything is set up properly, the Feather should now be blinking the onboard LED every second.

Once that's working, try running the Bluefruit example sketch, [as detailed here.](https://learn.adafruit.com/adafruit-feather-m0-bluefruit-le/installing-ble-library#run-first-example-8-5)

## MUNNY Code

Next, we'll get the **Munny\_Lamp.ino** code to upload to the Feather. First, download the [Adafruit\_Learning\_Systems\_Guides repo here](https://github.com/adafruit/Adafruit_Learning_System_Guides/archive/master.zip).

You'll need to unzip the file and then navigate it to get to the **Munny\_Lamp** directory. Move this directory it to your Arduino sketches directory.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/125/medium800/leds_munny_dir.png?1541176011)

Inside of the **Arduino IDE** , open the **Munny\_Lamp.ino** sketch.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/115/medium800/leds_lampino.png?1541169011)

Note how Arduino automatically opens the associated **BluefruitConfig.h** file and the **packetParser.cpp** file. You won't need to worry about these, but they do need to be there for everything to function!

Upload the code to your Feather M0 Bluefruit LE now, so we can try out the remote color changing and tilt functions!

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

## Testing

The LED will light up blue upon startup. The Feather is now waiting for you to connect to it with the Bluefruit app.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/116/medium800/leds_IMG_6087_2k.jpg?1541169647)

## Connect

Launch the app and after a moment you'll see a list of BLE devices to which you can connect. Click the ' **Connect**' button next to the **Adafruit Bluefruit LE** device.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/117/medium800/leds_IMG_6092_2k.jpg?1541169787)

## Controller

Now that you're connected, you can click on the ' **Controller**' module.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/118/medium800/leds_IMG_6093_2k.jpg?1541169842)

## Color Picker

There are a number of choices in the **Controller** module, we'll use the ' **Color Picker'**.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/119/medium800/leds_IMG_6094_2k.jpg?1541169898)

## Color Wheel

Now, you can pick on any color in the color wheel! Press ' **Send selected color**' when you want to change the RGB LED color _wirelessly through the air!!_

![](https://cdn-learn.adafruit.com/assets/assets/000/065/121/medium800/leds_IMG_6098_2k.jpg?1541170011)

![](https://cdn-learn.adafruit.com/assets/assets/000/065/120/medium800/leds_IMG_6097_2k.jpg?1541169996)

Info: 

# MUNNY Glowing Friend with Bluetooth Control!

## Code with CircuitPython

You can also code your glowing friend with CircuitPython!

[CircuitPython](https://github.com/adafruit/circuitpython) is designed to simplify experimentation and education on low-cost microcontrollers. It makes it easier than ever to get prototyping by requiring no upfront desktop software downloads. Simply copy and edit files on the `CIRCUITPY` drive to iterate.

Are you new to using CircuitPython? No worries,&nbsp;[there is a full getting started guide here](https://learn.adafruit.com/welcome-to-circuitpython).

Adafruit suggests using the Mu editor to edit your code and have an interactive REPL in CircuitPython.&nbsp;[You can learn about Mu and its installation in this tutorial](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor).

Follow this guide for instructions on installing the latest release version of CircuitPython for the **Feather M0 Adalogger**.

Info: 

[CircuitPython Release](https://learn.adafruit.com/welcome-to-circuitpython/installing-circuitpython)
## Libraries

You'll also need to add the following libraries for this project. [Follow this guide](https://learn.adafruit.com/adafruit-hallowing/circuitpython-libraries) on adding libraries. The ones you'll need are:

- **adafruit\_bus\_device**
- **adafruit\_lis3dh**

Download the latest adafruit-circuitpython-bundle .zip file as linked in the guide. Then,&nbsp; unzip the file and drag those libraries to the **lib** folder on your Feather.

## Code

Here is the code we'll use. Copy it and then paste in Mu. Save it to your Feather as **code.py**

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

## Testing

Once you've saved the code.py file to the board, the LED will light up! For info on testing it with the Bluefruit App, head back to the previous page in this guide, to the section on Testing.

# MUNNY Glowing Friend with Bluetooth Control!

## Mod Your MUNNY

![](https://cdn-learn.adafruit.com/assets/assets/000/065/062/medium800/leds_IMG_5954_2k.jpg?1541138104)

Now we've got to stuff the electronics into MUNNY! This procedure will vary depending on the vinyl figure you have. You could mount the Feather like a cool backpack, and run the LED inside the body, for example. Or you can try to get everything inside as shown here. One member of our community even suggested using a reed switch and magnet to enable hidden interface options!

![](https://cdn-learn.adafruit.com/assets/assets/000/065/065/medium800/leds_IMG_5977_2k.jpg?1541138718)

These are the mods I did:

- Remove the head
- Heat the neck with a heatgun, then slice the center open with a hobby knife
- Repeat for the neck socket in the head
- Head and cut open a square in the left leg to insert the USB panel mount
- Heat and slice a flap opening into the right foot to insert the electronics

Warning: 

![](https://cdn-learn.adafruit.com/assets/assets/000/065/064/medium800/leds_IMG_5982_2k.jpg?1541138699)

![](https://cdn-learn.adafruit.com/assets/assets/000/065/066/medium800/leds_IMG_6090_2k.jpg?1541138858)

## Insert Electronics

It's a bit like building a ship in a bottle, but now you will insert the battery into the head, the panel mount through the leg, and connect and feed in the Feather and LED assembly! The video slide show will give you a good idea how to proceed.

https://youtu.be/ZLCmiG_prP0

Before putting the head back on, it's a good idea to test that everything is working!

![](https://cdn-learn.adafruit.com/assets/assets/000/064/917/medium800/leds_IMG_6126_2k.jpg?1541132744)

## Action

Now you can feed the USB cable and battery into MUNNY's head and close it up. I decided to have him hold onto his own on/off switch.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/079/medium800/leds_IMG_6141_2k.jpg?1541139186)

Turn on the switch, and then connect to the Feather using the Adafruit Bluefruit app. You can change his colors any time you like!

![](https://cdn-learn.adafruit.com/assets/assets/000/065/089/medium800/leds_IMG_6136_2k.jpg?1541139262)

![](https://cdn-learn.adafruit.com/assets/assets/000/065/096/medium800/leds_IMG_6174_2k.jpg?1541139335)

![](https://cdn-learn.adafruit.com/assets/assets/000/065/095/medium800/leds_IMG_6170_2k.jpg?1541139318)

![](https://cdn-learn.adafruit.com/assets/assets/000/065/094/medium800/leds_IMG_6163_2k.jpg?1541139292)

## Tilt Action

MUNNY also has a secret mode! You can tip him upside down to randomize his color!!

This uses the accelerometer built right onto the Prop-Maker Wing to detect tilt, and it then picks random color values every half second.

Tip him back upright to stop the madness.

![](https://cdn-learn.adafruit.com/assets/assets/000/065/122/medium800thumb/leds_munny_tilt.jpg?1541170485)

## Recharge

You can bring your little glowing friend with you and use the battery for power. When it's time to recharge, simply plug in the USB power supply into his heel port!

![](https://cdn-learn.adafruit.com/assets/assets/000/065/123/medium800/leds_IMG_6234_2k.jpg?1541171569)

![](https://cdn-learn.adafruit.com/assets/assets/000/065/124/medium800/leds_IMG_6236_2k.jpg?1541171577)


## Featured Products

### Adafruit Prop-Maker FeatherWing

[Adafruit Prop-Maker FeatherWing](https://www.adafruit.com/product/3988)
The Adafruit Feather series gives you lots of options for a small, portable, rechargeable microcontroller board. Perfect for fitting into your next prop build! This FeatherWing will unlock the prop-maker inside all of us, with tons of stuff packed in to make sabers & swords, props, toys,...

In Stock
[Buy Now](https://www.adafruit.com/product/3988)
[Related Guides to the Product](https://learn.adafruit.com/products/3988/guides)
### Adafruit Feather M0 Bluefruit LE

[Adafruit Feather M0 Bluefruit LE](https://www.adafruit.com/product/2995)
Feather is the new development board from Adafruit, and like its namesake, it is thin, light, and lets you fly! We designed Feather to be a new standard for portable microcontroller cores.

This is the&nbsp; **Adafruit Feather M0 Bluefruit LE** &nbsp;- our take on an...

In Stock
[Buy Now](https://www.adafruit.com/product/2995)
[Related Guides to the Product](https://learn.adafruit.com/products/2995/guides)
### 3W RGB LED - Common Anode

[3W RGB LED - Common Anode](https://www.adafruit.com/product/2530)
Better grab your sunglasses, your sunscreen, and a bucket hat&nbsp;because this 3W RGB LED is so bright it's like like taking a beach vacation ON THE SUN. &nbsp;Maybe that's an exaggeration, but these are...

In Stock
[Buy Now](https://www.adafruit.com/product/2530)
[Related Guides to the Product](https://learn.adafruit.com/products/2530/guides)
### Lithium Ion Cylindrical Battery - 3.7v 2200mAh

[Lithium Ion Cylindrical Battery - 3.7v 2200mAh](https://www.adafruit.com/product/1781)
Need a big battery for your project? This lithium-ion battery contains a 2200mAh and a protection circuit that provides over-voltage, under-voltage, and over-current protection. Yet, it is slim and easy to fit into many project cases.  
  
This cell can provide 2 **C** of...

In Stock
[Buy Now](https://www.adafruit.com/product/1781)
[Related Guides to the Product](https://learn.adafruit.com/products/1781/guides)
### Mini Panel Mount SPDT Toggle Switch

[Mini Panel Mount SPDT Toggle Switch](https://www.adafruit.com/product/3221)
This or that, one or the other, perhaps or perhaps not! So hard to make decisions these days without feeling like you're just going back and forth constantly. Deciding whether or not to use this mini toggle switch? That's the easiest decision you'll make all day!

This...

In Stock
[Buy Now](https://www.adafruit.com/product/3221)
[Related Guides to the Product](https://learn.adafruit.com/products/3221/guides)
### Premium Male/Female Raw Jumper Wires - 40 x 6"

[Premium Male/Female Raw Jumper Wires - 40 x 6"](https://www.adafruit.com/product/3633)
Our **Raw Male/Female Jumper Wires** are perfect for making a custom jumper wire sets for wire harnesses or jumpering between headers on PCBs. These premium jumpers are a little over 6", almost 8" (about 200mm) long and come in a 'strip' of 40 (5 pieces of the ten rainbow...

In Stock
[Buy Now](https://www.adafruit.com/product/3633)
[Related Guides to the Product](https://learn.adafruit.com/products/3633/guides)
### Small Single Row Wire Housing Pack for DIY Jumper Cables

[Small Single Row Wire Housing Pack for DIY Jumper Cables](https://www.adafruit.com/product/3145)
Are you frustrated by the lack of customization options for your jumper wires? Look no further!

Compatible with both male and female wires, these fully customizable wire housings bring DIY to a new level, giving you...

In Stock
[Buy Now](https://www.adafruit.com/product/3145)
[Related Guides to the Product](https://learn.adafruit.com/products/3145/guides)
### Break-away 0.1" 36-pin strip right-angle male header (10 pack)

[Break-away 0.1" 36-pin strip right-angle male header (10 pack)](https://www.adafruit.com/product/1540)
Breakaway header is like the duct tape of electronics. Its great for connecting things together, soldering to perf-boards, fits into any breadboard, etc. We go through these guys real fast, and thought that given how handy they are, we'd offer them in a pack of ten!  
  
Each pack...

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

## Related Guides

- [Adafruit Feather M0 Bluefruit LE](https://learn.adafruit.com/adafruit-feather-m0-bluefruit-le.md)
- [Adafruit Prop-Maker FeatherWing](https://learn.adafruit.com/adafruit-prop-maker-featherwing.md)
- [MicroPython for SAMD21](https://learn.adafruit.com/micropython-for-samd21.md)
- [Adafruit IO Time Tracking Cube](https://learn.adafruit.com/time-tracking-cube.md)
- [MicroPython Displays: Drawing Text](https://learn.adafruit.com/micropython-displays-drawing-text.md)
- [NeoTrellis Sound Board](https://learn.adafruit.com/neotrellis-soundboard.md)
- [Debugging the SAMD21 with GDB](https://learn.adafruit.com/debugging-the-samd21-with-gdb.md)
- [Prop-Maker Keyblade](https://learn.adafruit.com/propmaker-keyblade.md)
- [What is Web MIDI & BLE MIDI?](https://learn.adafruit.com/web-ble-midi.md)
- [MicroPython Basics: How to Load MicroPython on a Board](https://learn.adafruit.com/micropython-basics-how-to-load-micropython-on-a-board.md)
- [Zelda Master Sword](https://learn.adafruit.com/zelda-master-sword.md)
- [CircuitPython Hardware: PCA9685 PWM & Servo Driver](https://learn.adafruit.com/micropython-hardware-pca9685-pwm-and-servo-driver.md)
- [DIY Darksaber Build - 3D Print with PropMaker FeatherWing and BLE](https://learn.adafruit.com/ble-darksaber-propmaker.md)
- [Talking Musical NeoPixel Clock with Infrared, BLE and Touch Controls](https://learn.adafruit.com/talking-musical-neo-pixel-clock-with-infrared-ble-and-touch-controls.md)
- [Using ATSAMD21 SERCOM for more SPI, I2C and Serial ports](https://learn.adafruit.com/using-atsamd21-sercom-to-add-more-spi-i2c-serial-ports.md)
- [Lucio Blaster 2020 - CircuitPython for Advanced Prop Making](https://learn.adafruit.com/lucio-blaster-2020-circuitpython-advanced-prop-making.md)
- [Wearable Continuous Temperature Monitor with Adafruit IO](https://learn.adafruit.com/wearable-temperature-monitor.md)
