UFO Flying Saucer with Circuit Playground Express

Similar documents
Adabot Operation Game

Slider Crank Mechanism -- from Cardboard and Craft Sticks

CircuitPython Snow Globe

Milk Jug Glow Skull. Created by John Park. Last updated on :28:36 PM UTC

Clockwork Goggles. Created by John Park. Last updated on :03:10 PM UTC

Crickit Carnival Bumper Bot

Bunny Ears with MakeCode

Con Badge with Circuit Playground Express

Stumble-Bot. Created by Dano Wall. Last updated on :04:06 AM UTC

Crawling Baby Sea Turtle Robot

Infinity Mirror Valentine's Candy Box

Sword & Wand Prop Effects with Circuit Playground

Ping Pong Ball Launcher

Hammer Time Mini Golf Hazard with Crickit

CPX Mystery Dreidel. Created by Kathy Ceceri. Last updated on :51:40 PM UTC

Snake Charmer Box. Created by Dano Wall. Last updated on :07:25 PM UTC

Crickit Powered Mini Chair Swing Ride!

NeoPixel Bike Light. Created by Ruiz Brothers. Last updated on :43:46 PM UTC

Neon LED Signs. Created by John Park. Last updated on :11:09 PM UTC

Circuit Playground Express Laser Tag

Pushrod Garage. Created by John Park. Last updated on :07:30 PM UTC

Circuit Playground Yoyo

Circuit Playground Express Head-Tilt Ears

Steven Universe Cosplay Shirt & Gem Created by Erin St Blaine. Last updated on :54:25 PM UTC

The Scream: Interactive Screaming Painting

NeoPixie Dust Bag with Circuit Playground Express

Solar Boost Bag. Created by Becky Stern. Last updated on :44:55 PM UTC

PyPortal NeoPixel Color Picker Created by Kattni Rembor. Last updated on :42:41 PM UTC

Crickit Powered Holiday Diorama

PyPortal View Master Created by Ruiz Brothers. Last updated on :51:28 AM UTC

Mini Golf Course with Circuit Playground and Crickit

3D Printed Camera LED Ring

Paper Airplane Launcher

Wind Blowing Emoji Prop

NeoPixel Basketball Hoop

Crickit Dancing Marionette Kit Created by Dano Wall. Last updated on :03:11 PM UTC

Glowing Smokey Skull. Created by Ruiz Brothers. Last updated on :03:40 PM UTC

Feather Weather Lamp. Created by Ruiz Brothers. Last updated on :54:26 PM UTC

Portable Apple Watch Charger

Trash Panda. Created by Dano Wall. Last updated on :30:46 AM UTC

Crawling Animatronic Hand

Simple LED Unicorn Horn

Bluetooth Controlled NeoPixel Headphones

No-Sew LED Wristband. Created by Kathy Ceceri. Last updated on :23:40 PM UTC

Reindeer Mask with Animated Eyes

NeoPixel Fairy Crown. Created by Erin St Blaine. Last updated on :22:47 AM UTC

Secret Hollow Book Intrusion Detector

Circuit Playground Kaleidoscope

NeoPixel Ring Bangle Bracelet

BLE Light Switch with Feather nrf52840 and Crickit

Mystical LED Halloween Hood

Adafruit Pi Cobbler Kit

CircuitPython Media Dial

NeoPixel Manicure. Created by Sophy Wong. Last updated on :50:38 PM UTC

NeoMatrix 8x8 Word Clock

7 Portable Multitouch Raspberry Pi Tablet

3D Printed LED Goggles

Guardian Shield+ Zelda Breath of the Wild

FPV Mini Display. Created by Ruiz Brothers. Last updated on :00:18 PM UTC

Making Adabot: Part 1

Trinket NeoPixel LED Longboard

7" Portable HDMI Monitor

ISS Pin. Created by Leslie Birch. Last updated on :27:30 PM UTC

Adafruit LED Sequins. Created by Becky Stern. Last updated on :02:00 AM UTC

Audio Prank Gift Box. Created by Becky Stern. Last updated on :46:15 PM UTC

Overwatch Prop Gun: Lucio's Blaster Pt. 3

3D Printed 20w Amplifier Box

3D Printed Case for Adafruit Feather

Easy Sparkle Pocket T-Shirt

LED Eyes. Created by Ruiz Brothers. Last updated on :50:55 AM UTC

Interior Purse Light. Created by Becky Stern. Last updated on :41:08 PM UTC

TSL2561 Luminosity Sensor

Adafruit VL53L0X Time of Flight Micro-LIDAR Distance Sensor Breakout

Unicorn Hat with Moving Ears

LED Breath Stats Mask

Magical Mistletoe. Created by Leslie Birch. Last updated on :45:29 PM UTC

Webcam Cover-Up Lego brick with Adabot Mini Fig

Getting Started with FLORA

Lady Ada's Bento Box. Created by lady ada. Last updated on :55:35 AM UTC

Adafruit APDS9960 breakout

Coffee Detonator: The TNT Plunger Grinder

HalloWing Jump Scare Trap

CircuitPlayground Minecraft Gesture Controller

Celebration Spectacles

DIY Circuit Playground Shields

Adafruit PowerBoost 500 Shield

LED NeoPixel Corset with Circuit Playground Express and

Android GBoard Morse Code Control with Circuit Playground Express

Naughty or Nice Machine

GPS Logging Dog Harness

Joy Featherwing. Created by Dean Miller. Last updated on :03:07 PM UTC

Zelda Thunder Helm. Created by Ruiz Brothers. Last updated on :46:52 PM UTC

Jewel Hair Stick. Created by Leslie Birch. Last updated on :47:17 PM UTC

Adafruit Si7021 Temperature + Humidity Sensor

Trellis 3D Printed Enclosure

Data Logging with Feather and CircuitPython

Fiddy - the FTDI Clip

Introducing Adafruit Trellis

Raspberry Pi Selfie Bot

Adafruit MMA8451 Accelerometer Breakout

Transcription:

UFO Flying Saucer with Circuit Playground Express Created by John Park Last updated on 2018-08-31 08:42:17 PM UTC

Guide Contents Guide Contents Overview Code the UFO with CircuitPython Build the Flying Saucer 2 3 7 10 Adafruit Industries https://learn.adafruit.com/ufo-circuit-playground-express Page 2 of 19

Overview The aliens are coming!! The aliens are coming!! Oh, wow, and they've got a really nifty flying saucer, with lights and otherworldly sounds! Have you ever wanted to make your own prop UFO model with lights and sounds that react to the tilt of the craft? Me too! Plus, you can hang it from a piece of fishing line and make your own sci fi B-movie special effects! Adafruit Industries https://learn.adafruit.com/ufo-circuit-playground-express Page 3 of 19

You can build your own flying saucer using paper plates, or 3D print a model, or even modify a plastic model kit. You'll just need a hole in the bottom for the Circuit Playground Express's NeoPixel LED lights to show, and room for the battery pack inside. You'll also want to get a small, clear plastic drinking cup to use as a tractor beam and stand to display your UFO, as well as some optional sandpaper to scuff up the interior of the cup. Adafruit Industries https://learn.adafruit.com/ufo-circuit-playground-express Page 4 of 19

Adafruit Industries https://learn.adafruit.com/ufo-circuit-playground-express Page 5 of 19

1 x Circuit Playground Express Awesome microcontroller board packed with features! ADD TO CART 1 x 3x AAA Battery Holder With on/off switch ADD TO CART Check out this John Park's Workshop LIVE episode for more info and a flying saucer 3D modeling session! Adafruit Industries https://learn.adafruit.com/ufo-circuit-playground-express Page 6 of 19

Code the UFO with CircuitPython The Circuit Playground Express has all the features you'll need to make a great, reactive light and sound effects pack for your flying saucer. And, coding it all in CircuitPython is straightforward and uses high level commands to make things simple. We'll use the built in accelerometer to measure the orientation of the board, and then use those readings to effect the light colors, the pitch of the sounds, and the speed of the light/sound cycle. For example, we can have it make faster, higher pitched sounds when tilted, and then slow down and lower the tones when the craft is level. This is usually when the aliens do all of their abductions of cows and otherwise peaceful citizens, BTW. The Circuit Playground Express can be used with three different programming methods: CircuitPython, Arduino, and Make:Code. For this project we'll use CircuitPython. Make sure know how to set up your Circuit Playground Express for use with CircuitPython by following this guide (https://adafru.it/afi). Once you've installed the latest version of CircuitPython for Circuit Playground Express from here (https://adafru.it/vlf) and the library bundle from here (https://adafru.it/y8e), (be sure to unzip it and replace the lib folder on your CIRCUITPY drive with the new one from the bundle) you're ready! Now, you're can to add a small CircuitPython script to tell the board what to do! Copy the code from the section below, then paste it into a new document in your favorite code/text editor. With your Circuit Playground Express plugged in, you'll see a drive on your computer called CIRCUITPY. Save the file to this drive as main.py. Adafruit Industries https://learn.adafruit.com/ufo-circuit-playground-express Page 7 of 19

""" UFO Flying Saucer with Circuit Playground Express https://learn.adafruit.com/ufo-circuit-playground-express/ Plays UFO lights and sounds if the board is upside down only, Tilt to change light color, cycle speed, tone pitch """ import time import board from adafruit_circuitplayground.express import cpx def simple_circle(wait, red, green, blue): """timing, color values per channel""" basefreq = int(20 + (green * 0.3)) # tone value derived from rotation for i in range(10): cpx.pixels[i] = ((0, 0, 0)) cpx.start_tone(basefreq + i) # increasing pitch sweep time.sleep(wait) for i in range(10): cpx.pixels[i] = ((red, green, blue)) time.sleep(wait) # Main loop gets x, y and z axis acceleration, prints the values, and turns on # lights if the UFO is upside down, plays tones while True: R = 0 G = 0 B = 0 x, y, z = cpx.acceleration # read the accelerometer values R = 10 * (R + abs(int(x))) # scale up the accel values into color values G = 10 * (G + abs(int(y))) B = 10 * (B + abs(int(z))) # check for upside down state on z axis if z < 0: # any negative number on z axis means it's upside down enough speed = (0.01 * (B * 0.025)) simple_circle(speed, R, G, B) # speed based on tilt,.01 is good start else: # right side up means no colors or sound! cpx.pixels.fill((0, 0, 0)) cpx.stop_tone() Now, try tilting your board. You'll see that it doesn't do anything while it is right side up, with the board facing the ceiling. But once you tilt it beyond 90 degrees to point it toward the ground, the lights will start to cycle and the sound effects will begin to play! Notice how different angles create different colors, sound pitches, and frequency of the effects. Adafruit Industries https://learn.adafruit.com/ufo-circuit-playground-express Page 8 of 19

The "normal" range for play_tone values is usually ~100-2000 -- higher than what we're using here. But these very low values -- in the 20s and 30s -- create a strange glitchy sound that's perfect for a UFO! Now, it's time to package your lights and sounds inside a UFO! Adafruit Industries https://learn.adafruit.com/ufo-circuit-playground-express Page 9 of 19

Build the Flying Saucer You have a few options for making your flying saucer. Paper plates, pie tins, frisbees, hubcaps, and more can be excellent starting points. Cut a hole for the battery connector in the bottom plate Pass the cable through to connect to the Circuit Playground Express's JST battery jack Tape the Circuit Playground Express to the bottom of your saucer Tape the battery box inside the plate Adafruit Industries https://learn.adafruit.com/ufo-circuit-playground-express Page 10 of 19

Cut a hole in the center of the top plate, so you can still access the battery box's on/off switch Connect the plate halves together with tape or staples Cover the hole with the "cockpit" of your UFO, such as a disposable coffee cup lid, and tape it in place with a hinge-like strip of tape Adafruit Industries https://learn.adafruit.com/ufo-circuit-playground-express Page 11 of 19

Adafruit Industries https://learn.adafruit.com/ufo-circuit-playground-express Page 12 of 19

Now, you can test out your UFO! As you rotate and tilt it, you'll hear the different pitches, see the varying light colors, and the overall frequency of the cycle with change! For the tractor beam that's used for farm animal abductions, you can use a clear plastic drinking cup. By Adafruit Industries https://learn.adafruit.com/ufo-circuit-playground-express Page 13 of 19

scuffing up the inside of the cup with some sandpaper, you can create a nice diffusion that will showcase the great lighting effects! Adafruit Industries https://learn.adafruit.com/ufo-circuit-playground-express Page 14 of 19

Land the UFO on your tractor beam to see the great lighting effect! Or, you can 3D print the model linked below. You'll need some 2.5mm nylon screws and nuts to fasten the model halves together. https://adafru.it/a02 https://adafru.it/a02 https://adafru.it/a03 https://adafru.it/a03 Adafruit Industries https://learn.adafruit.com/ufo-circuit-playground-express Page 15 of 19

Depending on your printer, you may be able to print the top and bottom sections intact (as seen in the second image here) or in halves for joining Place the Circuit Playground Express inside the saucer, facing down, and use tape to secure it and the battery pack Assemble the top and bottom, being sure to rotate the upper section before screwing in the screws and nuts to hold it all together if you printed each section in halves There will be a large, obvious seam, but that's part of the fun with this B-grade sci-fi film look! Adafruit Industries https://learn.adafruit.com/ufo-circuit-playground-express Page 16 of 19

Adafruit Industries https://learn.adafruit.com/ufo-circuit-playground-express Page 17 of 19

Adafruit Industries https://learn.adafruit.com/ufo-circuit-playground-express Page 18 of 19

You can also find some excellent plastic model kits at hobby shops and online. Then, you can use your imagination and creativity to modify the model kit to fit your Circuit Playground Express and battery pack. Adafruit Industries Last Updated: 2018-08-31 08:42:16 PM UTC Page 19 of 19