Introduction: Recycled Disney Coffee Cup Lamp

About: Boston College Student

Hi there! Excited to meet you and to show you this project!


This guide will show you how to build a coffee cup lamp using an Adafruit Circuit Playground Express and Mu CircuitPython. Let's design our lamp from a recycled cup, conductive tape, and capacitive touchpads to play Disney movie quotes and change the colors of the LEDs!


So get ready to go on an adventure and learn how to DIY this ~savvy~ cup lamp!



Additional Resources

--> Adafruit Circuit Playground Express Guide:

https://learn.adafruit.com/adafruit-circuit-playground-express

--> Code with Mu Tutorial:

https://codewith.mu/en/tutorials/1.1/


Inspiration for this project: https://learn.adafruit.com/adventure-time-coffee-cup-lamp

Supplies

For this project you will need:

(1) Circuit Playground Express

(1) AAA Battery Holder with On/Off Switch and 2 Pin JST

(1) Copper Foil Tape with Conductive Adhesive -- 6mm x 15 meter roll OR (1) Conductive Nylon Fabric Tape -- 5mm Wide x 10 meters long

(1) Regular or Foam Tape

(1) Coffee Cup (Recycled preferably -- help the environment!)

(1) Scissors

(1) Sharpie or black marker

(-) Printed design/characters of your choosing

Step 1: Set Up Your Circuit Playground Express and Code!

To start with, grab your Circuit Playground Express, copper tape, and battery pack. Look at the picture above for a visual reference for the wiring of the components.

The first thing you would want to do is to cut 6 pieces of copper tape and attach the ends to the Circuit Playground Express pads marked (A1, A2, A3, A4, A5, and A6). These will create extensions that will later serve as external buttons.

Next, you would want to attach the battery pack to the JST connector of the Circuit Playground Express. This battery pack can supply ~4.5V which is sufficient to power the CPB. Of course, the CPB can also be powered from USB if you don't mind plugging it into a computer or wall adapter. However, for this project, we will stick with the battery pack for portability.


Step 2: Test Out Your Code!

Mu is a Python code editor for beginner programmers based on feedback given by teachers and learners. Check it out here: https://codewith.mu/en/about


Follow the code below to make sure that each button will light up to a different color and sound! Remember, your sound file should be .wav and below 50 kb.


Code that I had used, feel free to edit and make it your own!

# Angie Saggers

# Make Art Project 1

# Inspiration: https://learn.adafruit.com/adventure-time-coffee-cup-lamp

#import files

import board

import neopixel #lights

import time

import digitalio #buttons

import adafruit_lis3dh

import random

import adafruit_led_animation.color

import analogio #light sensors

import touchio

# import lines needed to play sound files

import busio #speakers

import pwmio

from audiopwmio import PWMAudioOut as AudioOut

from audiocore import WaveFile

from adafruit_led_animation.color import (

  AMBER, #(255, 100, 0)

  AQUA, # (50, 255, 255)

  BLACK, #OFF (0, 0, 0)

  BLUE, # (0, 0, 255)

  CYAN, # (0, 255, 255)

  GOLD, # (255, 222, 30)

  GREEN, # (0, 255, 0)

  JADE, # (0, 255, 40)

  MAGENTA, #(255, 0, 20)

  OLD_LACE, # (253, 245, 230)

  ORANGE, # (255, 40, 0)

  PINK, # (242, 90, 255)

  PURPLE, # (180, 0, 255)

  RED, # (255, 0, 0)

  TEAL, # (0, 255, 120)

  WHITE, # (255, 255, 255)

  YELLOW, # (255, 150, 0)

  RAINBOW # a list of colors to cycle through

  # RAINBOW is RED, ORANGE, YELLOW, GREEN, BLUE, and PURPLE ((255, 0, 0), (255, 40, 0), (255, 150, 0), (0, 255, 0), (0, 0, 255), (180, 0, 255))

)

INDIGO = (63, 0, 255)

VIOLET = (127, 0, 255)

colors = [RED, MAGENTA, ORANGE, YELLOW, GREEN, BLUE, VIOLET]

#set up lights

pixels_pin = board.NEOPIXEL

pixels_num_of_lights = 10

pixels = neopixel.NeoPixel(pixels_pin, pixels_num_of_lights, brightness = 0.5, auto_write=True)

# set up the speaker

speaker = digitalio.DigitalInOut(board.SPEAKER_ENABLE)

speaker.direction = digitalio.Direction.OUTPUT

speaker.value = True

audio = AudioOut(board.SPEAKER)

# set path where sound files can be found

path = "sounds/"

#set up list for disney_sounds

disney_sounds = ["Aladdin.wav","infinity.wav","et.wav", "honor.wav","Luke.wav","Iron.wav","farewell"] #work on!

# set up touchpads -- USE ALL OF THEM

"""

touchpad_A1 = touchio.TouchIn(board.A1)

touchpad_A2 = touchio.TouchIn(board.A2)

touchpad_A3 = touchio.TouchIn(board.A3)

"""

pad = [board.A1, board.A2, board.A3, board.A4, board.A5, board.A6, board.TX] #more efficient

# create an empty list named touchpad_A1

touchpad = []

#loop through all elemends of pad

for i in range(len(pad)):

  touchpad.append(touchio.TouchIn(pad[i]))

def play_sound(filename):

  with open(path + filename, "rb") as wave_file:

    wave = WaveFile(wave_file)

    audio.play(wave)

    while audio.playing:

      pass

while True:

  touched = False

  for i in range(len(touchpad)):

    if touchpad[i].value:

      pixels.fill(colors[i])

      play_sound(disney_sounds[i])

      touched = True

    if touched == False:

      pixels.fill(BLACK)


Step 3: Design & Assemble Your Cup

Now would be the perfect time to grab some scissors and tape!

I personally enjoyed this step the most and love the decorations on my cup.

So, you would want to select and print out background designs and characters to cover the cup frame. Since the cup that I used is see-through, I didn't need to cut any parts out. I recommend that you also use a somewhat see-through material so that the LED lights could be seen easily.

And of course, have fun with it!


Once you have decorated your cup, its time to place the CPB and battery to it. You would want to tape down the CPB to the middle of the coffee cup lid and attach the battery through the opening. Next, you should create 6 "buttons" by cutting the lid to attach the individual copper tapes (definitely see picture above for reference, the best way to do this is to attach the CPB and measure the width of the copper tape). Once you have configured the CPB and the buttons, you are ready to secure the cup!


Step 4: Congrats! Go Enjoy Your Cool DIY Lamp!

Voila! You have officially made a Disney Coffee Cup Lamp!! Time to show it off to your friends, roommates, family, and other Disney enthusiasts!


Here are some ideas to improve your projects (step it up!):

1) Make the lights pulse

2) Change the materials

3) Add in a speaker

4) Use stickers to hold decorations better


Thanks for stopping by! Hope that you're having a great day!