Automatic Phone Case With Card Holder by Abby Moriarty, Ben Lapoint, Nate Kobusewski
by amoriarty2 in Workshop > 3D Printing
78 Views, 0 Favorites, 0 Comments
Automatic Phone Case With Card Holder by Abby Moriarty, Ben Lapoint, Nate Kobusewski
- A cell phone case that is capable of holding an Endicott College Gull Card
- CPX attached to the back of the phone
- Code the CPX for when you move your phone in a certain pattern the Gull card moves up for 3 seconds then goes back down.
- Attached is a gear-operated 3D piece to help slide the Gull Card out
Supplies
How to Download the 3D Design
- Make a design on Tinkercad
- Move your cursor to the top right of your screen and click EXPORT
- Next, click on STL as your file type
- Save your new file with a new name so it's easy to find in File Explorer
- Then proceed to MakerBotCloudPrint and go to the top left of your screen to click on Import your file
- Click on your printer type and you are all set to print
Code
- Copy and paste code into circuit python
- Name file code.py
- Save to CPX
[Copy Code Below]
import time
import board
import pwmio
from adafruit_motor import servo
from adafruit_circuitplayground import cp
pwm = pwmio.PWMOut(board.A2, duty_cycle=2 ** 15, frequency=50)
my_servo = servo.Servo(pwm)
cp.pixels.brightness = 1
while True:
if cp.button_a:
cp.pixels[0] = (200, 0, 0)
cp.pixels[1] = (0, 200, 0)
cp.pixels[2] = (200, 0, 0)
cp.pixels[3] = (0, 200, 0)
cp.pixels[4] = (200, 0, 0)
cp.pixels[5] = (0, 200, 0)
cp.pixels[6] = (200, 0, 0)
cp.pixels[7] = (0, 200, 0)
cp.pixels[8] = (200, 0, 0)
cp.pixels[9] = (0, 200, 0)
for angle in range(0, 89, 90):
my_servo.angle = 90
time.sleep(5)
for angle in range(90, 0, -90):
my_servo.angle = 0
time.sleep(1)
cp.play_tone(262, 1)
cp.play_tone(294, 1)
if cp.button_b:
cp.pixels[0] = (0, 200, 200)
cp.pixels[1] = (250, 35, 0)
cp.pixels[2] = (0, 200, 200)
cp.pixels[3] = (250, 35, 0)
cp.pixels[4] = (0, 200, 200)
cp.pixels[5] = (250, 35, 0)
cp.pixels[6] = (0, 200, 200)
cp.pixels[7] = (250, 35, 0)
cp.pixels[8] = (0, 200, 200)
cp.pixels[9] = (250, 35, 0)
for angle in range(0, 89, 90):
my_servo.angle = 90
time.sleep(5)
for angle in range(90, 0, -90):
my_servo.angle = 0
time.sleep(1)
cp.play_tone(250, 2)
cp.play_tone(272, 2)
Connect the Servo Motor
- Attach the black clip with the orange wire to the brown servo wire
- Attach the red clip with the red wire to the red servo wire
- Attach the white clip with the white wire to the yellow servo wire
Next
- Attach the white clip to the CPX hole labeled "A2"
- Attach the black clip to the CPX hole labeled "GND"
- Attach the red clip to the CPX hole labeled "VOUT"
Assemble Final Project
Attach CPX holder to card holder
Attach card holder to phone hold
Glue green piece to side of phone case
Screw gear to servo motor