# Interior Purse Light

## Overview

https://www.youtube.com/watch?v=7kxZSeXewrQ

Trying to find something in your purse at a dark restaurant or party? What a pain! Make it easy to see what's in your bag with LED sequins, GEMMA, and conductive hook & loop  
  
This beginner level e-textiles project has you sewing with conductive thread and loading a simple Arduino program onto the GEMMA microcontroller. This project is perfect for use with the [GEMMA Sequin Starter Pack](http://www.adafruit.com/product/1850)! Just add [hook & loop](http://www.adafruit.com/product/1324 "Link: http://www.adafruit.com/product/1324").&nbsp;Before you get started, follow the&nbsp;[Gemma M0 guide](../../../../adafruit-gemma-m0/circuitpython-digital-in-out?view=all)&nbsp;or the&nbsp;[Classic Introducing&nbsp;GEMMA guide](../../../../introducing-gemma/introduction)&nbsp;

Info: 

![](https://cdn-learn.adafruit.com/assets/assets/000/016/253/medium800/gemma_interior-purse-light-19.jpg?1398809899)

Gather up the following parts & tools:

- [Gemma M0](https://www.adafruit.com/product/3501)&nbsp;or&nbsp;[GEMMA v2 wearable microcontroller](http://www.adafruit.com/products/1222 "Link: http://www.adafruit.com/products/1222")
- (Optional): build on the:&nbsp;[GEMMA Starter Pack](http://www.adafruit.com/products/1657)&nbsp;or&nbsp;[GEMMA Sequin Starter Pack](http://www.adafruit.com/product/1850 "Link: http://www.adafruit.com/product/1850")
- [Conductive hook & loop](http://www.adafruit.com/product/1324)
- Purse or backpack
- Scissors
- Clear nail polish
- USB cable
- Computer with Adafruit Arduino software

![](https://cdn-learn.adafruit.com/assets/assets/000/016/245/medium800/gemma_interior-purse-light-00.jpg?1398809634)

![](https://cdn-learn.adafruit.com/assets/assets/000/016/244/medium800/gemma_interior-purse-light-20.jpg?1398809433)

# Interior Purse Light

## Circuit Diagram

![](https://cdn-learn.adafruit.com/assets/assets/000/016/243/medium800/gemma_purselight-diagram.jpg?1398809402)

Info: 

Click to enlarge! Five LED sequins are sewn in parallel to GEMMA's D2 and GND pads.  
  
Conductive hook & loop is sewn to GND and D1 pads. In the Arduino program D1's internal pullup resistor is activated.

# Interior Purse Light

## Stitch Sequins

![](https://cdn-learn.adafruit.com/assets/assets/000/016/251/medium800/gemma_interior-purse-light-01.jpg?1398809866)

Clean off your work space and turn your bag inside out. Arrange the components on your bag to get an idea of where you'd like to position everything, referring to the circuit diagram.

Thread a needle with conductive thread and stitch around GND on GEMMA. Tie a knot and continue stitching toward the first sequin. Stitch around its negative pad (marked "-") a few times, then continue down the line, stitching to each sequin.  
  
Tie a knot at the last pixel (we chose pink for extra flair), and cut the thread tail long.

![gemma_interior-purse-light-02.jpg](https://cdn-learn.adafruit.com/assets/assets/000/016/246/medium640/gemma_interior-purse-light-02.jpg?1398809670)

![gemma_interior-purse-light-03.jpg](https://cdn-learn.adafruit.com/assets/assets/000/016/255/medium640/gemma_interior-purse-light-03.jpg?1398810013)

![gemma_interior-purse-light-04.jpg](https://cdn-learn.adafruit.com/assets/assets/000/016/256/medium640/gemma_interior-purse-light-04.jpg?1398810098)

Repeat the last step on the other side of the pixels, stitching them all to D2 on GEMMA.

![gemma_interior-purse-light-05.jpg](https://cdn-learn.adafruit.com/assets/assets/000/016/258/medium640/gemma_interior-purse-light-05.jpg?1398810376)

![gemma_interior-purse-light-06.jpg](https://cdn-learn.adafruit.com/assets/assets/000/016/262/medium640/gemma_interior-purse-light-06.jpg?1398811079)

![gemma_interior-purse-light-07.jpg](https://cdn-learn.adafruit.com/assets/assets/000/016/265/medium640/gemma_interior-purse-light-07.jpg?1398811259)

Pull your thread tails taught and dab on a small amount of clear nail polish-- it should only touch the knot, not the pads of GEMMA or the sequins.  
  
For more tips on working with conductive thread, check out our [Conductive Thread guide](https://learn.adafruit.com/conductive-thread).  
  
When dry, snip the thread tails short.

![gemma_interior-purse-light-09.jpg](https://cdn-learn.adafruit.com/assets/assets/000/016/266/medium640/gemma_interior-purse-light-09.jpg?1398811455)

![gemma_interior-purse-light-10.jpg](https://cdn-learn.adafruit.com/assets/assets/000/016/267/medium640/gemma_interior-purse-light-10.jpg?1398811652)

![](https://cdn-learn.adafruit.com/assets/assets/000/016/269/medium800/gemma_interior-purse-light-11.jpg?1398811796)

Double check you don't have any rogue bits of thread hanging out anywhere, and that any stray bits have been cleaned up.&nbsp;

# Interior Purse Light

## Add Tape

Thread your needle with another length of conductive thread, and stitch to GND on GEMMA again. Tie a knot, then stitch over to one piece of conductive hook & loop.  
  
This stuff can be difficult to sew through, so you may want to have a pair of pliers handy for helping to grasp the needle.  
  
Since the hook&loop will pull at it's mating piece, stitch it very securely to the bag, around all four edges. Then tie it off and cut the tail.

![gemma_interior-purse-light-12.jpg](https://cdn-learn.adafruit.com/assets/assets/000/016/248/medium640/gemma_interior-purse-light-12.jpg?1398809705)

![gemma_interior-purse-light-13.jpg](https://cdn-learn.adafruit.com/assets/assets/000/016/254/medium640/gemma_interior-purse-light-13.jpg?1398810003)

Stitch around pad D1 on GEMMA with a new piece of conductive thread, then stitch all the way around the opening of the bag to the other side. Repeat the hook & loop securing on this side, making sure the two pieces are aligned.

![gemma_interior-purse-light-14.jpg](https://cdn-learn.adafruit.com/assets/assets/000/016/257/medium640/gemma_interior-purse-light-14.jpg?1398810173)

![gemma_interior-purse-light-15.jpg](https://cdn-learn.adafruit.com/assets/assets/000/016/259/medium640/gemma_interior-purse-light-15.jpg?1398810331)

Jump to the [CircuitPython Code](../../../../interior-purse-light/circuitpython-code) or [Arduino Code](../../../../interior-purse-light/arduino-code) section for programming your Gemma.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/016/260/medium800/gemma_interior-purse-light-16.jpg?1398810428)

![](https://cdn-learn.adafruit.com/assets/assets/000/016/263/medium800/gemma_interior-purse-light-17.jpg?1398810698)

Now your bag should light up when it's open! If you can't see into the bag when it's shut, use an alligator clip or piece of wire to connect the two pieces of hook & loop to see if the light shut off. When you've verified the sensor is working properly, you can disconnect the USB cable and connect up a coincell battery pack for taking your project portable!

![](https://cdn-learn.adafruit.com/assets/assets/000/016/264/medium800/gemma_interior-purse-light-18.jpg?1398811200)

# Interior Purse Light

## Arduino Code

Info: 

Grab the modified "Button" example sketch below and load it onto GEMMA:

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

From the&nbsp; **Tools→Board** &nbsp;menu, select&nbsp;the&nbsp;device you are using: **&nbsp;**

- **Adafruit Gemma M0**
- **Adafruit Gemma 8 MHz** &nbsp;

Connect the USB cable between the computer and your device. The original Gemma (8 MHz) need the reset button pressed on the board, then click the upload button (right arrow icon) in the Arduino IDE. You do not need to press the reset on the newer Gemma M0.

# Interior Purse Light

## CircuitPython Code

![](https://cdn-learn.adafruit.com/assets/assets/000/047/503/medium800/adafruit_gemma_gemma-cp.jpg?1508706695)

 **GEMMA&nbsp;M0** &nbsp;boards can&nbsp;run&nbsp; **CircuitPython** &nbsp;— a different approach to programming compared to Arduino sketches. In fact,&nbsp; **CircuitPython comes&nbsp;factory pre-loaded on GEMMA&nbsp;M0**. If you’ve overwritten it with an Arduino sketch, or just want to learn the basics of setting up and using CircuitPython, this is explained in the&nbsp;[**Adafruit GEMMA&nbsp;M0 guide**](../../../../adafruit-gemma-m0/circuitpython-setup-1).

Info: 

Below is CircuitPython code that works&nbsp;similarly (though not exactly the same) as the Arduino sketch shown on a prior page. To use this, plug the GEMMA M0 into USB…it should show up on your computer as a small&nbsp; **flash drive** …then edit the file “ **main.py** ” with your text editor of choice. Select and copy the code below and paste it into that file,&nbsp; **entirely replacing its contents** &nbsp;(don’t mix it in with lingering bits of old code). When you save the file, the code should&nbsp; **start running almost immediately** &nbsp;(if not, see notes at the bottom of this page).

**If GEMMA M0 doesn’t show up as a&nbsp;drive, follow the GEMMA M0 guide link above to prepare the board for CircuitPython.**

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

# Interior Purse Light

## Use It!

![](https://cdn-learn.adafruit.com/assets/assets/000/016/247/medium800/gemma_interior-purse-light-19.jpg?1398809668)

Take your purse to a dark club or party, but always be able to see what's inside! Avoid getting the circuit wet while the battery is connected, and remove the battery pack for laundering.  
  
Depending on your circuit placement, you'll also have to watch out for metal objects that could short your GEMMA. Happy stitching!

![](https://cdn-learn.adafruit.com/assets/assets/000/016/252/medium800/gemma_interior-purse-light-20.jpg?1398809867)


## Related Guides

- [Sewable NeoPixels](https://learn.adafruit.com/flora-rgb-smart-pixels.md)
- [Which CircuitPython Board is Right for You?](https://learn.adafruit.com/choose-your-circuitpython-board.md)
- [Clockwork Goggles](https://learn.adafruit.com/gemma-m0-clockwork-goggles.md)
- [Glowing Fascinator Hat with Gemma M0 and MakeCode](https://learn.adafruit.com/glowing-fascinator-hat-gemma-m0-makecode.md)
- [Interactive Gift Box](https://learn.adafruit.com/interactive-custom-gift-box.md)
- [AdaBox 007](https://learn.adafruit.com/adabox007.md)
- [LED Glowing Slime](https://learn.adafruit.com/led-glowing-slime.md)
- [Spy Theme Playback Device](https://learn.adafruit.com/spy-theme-playback-device.md)
- [Hidden Ink UV Message Reader](https://learn.adafruit.com/hidden-ink-uv-message-reader.md)
- [Twinkly Earwarmer Headband](https://learn.adafruit.com/twinkly-ear-warmer.md)
- [GEMMA M0 Case](https://learn.adafruit.com/gemma-m0-case.md)
- [NeoPixel Fairy Crown](https://learn.adafruit.com/neopixel-fairy-crown.md)
- [LED Noodle Shop Sign](https://learn.adafruit.com/led-noodle-shop-sign.md)
- [Easy LED Jeweled Necklace](https://learn.adafruit.com/led-jeweled-necklace.md)
- [Digi-Key IoT Studio Mini Smart Home](https://learn.adafruit.com/digikey-iot-studio-smart-home.md)
- [Gemma M0 Vibration Sensor Motion Alarm](https://learn.adafruit.com/motion-alarm.md)
