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

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

Paper Airplane Launcher

Mini Golf Course with Circuit Playground and Crickit

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

Crawling Baby Sea Turtle Robot

Slider Crank Mechanism -- from Cardboard and Craft Sticks

Crawling Animatronic Hand

Ping Pong Ball Launcher

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

Hammer Time Mini Golf Hazard with Crickit

Crickit Carnival Bumper Bot

Adabot Operation Game

Crickit Powered Mini Chair Swing Ride!

Android GBoard Morse Code Control with Circuit Playground Express

The Scream: Interactive Screaming Painting

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

Crickit Powered Holiday Diorama

Infinity Mirror Valentine's Candy Box

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

BLE Light Switch with Feather nrf52840 and Crickit

Circuit Playground Express Head-Tilt Ears

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

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

Reindeer Mask with Animated Eyes

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

UFO Flying Saucer with Circuit Playground Express

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

Wind Blowing Emoji Prop

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

Con Badge with Circuit Playground Express

Bunny Ears with MakeCode

Making Adabot: Part 1

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

HalloWing Jump Scare Trap

Trellis 3D Printed Enclosure

Data Logging with Feather and CircuitPython

Portable Apple Watch Charger

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

Easy Sparkle Pocket T-Shirt

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

DIY Circuit Playground Shields

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

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

Adafruit PowerBoost 500 Shield

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

Circuit Playground Express Laser Tag

CircuitPython Snow Globe

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

Spinning Disc Step Sequencer

Trinket NeoPixel LED Longboard

Guardian Shield+ Zelda Breath of the Wild

LED Lightbox. Created by Sam Clippinger. Last updated on :50:00 AM UTC

Circuit Playground Yoyo

i2c/spi LCD Backpack Created by lady ada Last updated on :11:04 PM UTC

Tent Lantern. Created by Timothy Reese. Last updated on :17:25 AM UTC

Punk LED Collar. Created by Becky Stern. Last updated on :02:45 PM EST

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

Sword & Wand Prop Effects with Circuit Playground

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

Adafruit Capacitive Touch Sensor Breakouts

NeoPixel Ring Bangle Bracelet

Simple LED Unicorn Horn

Adafruit TPL5110 Power Timer Breakout

FLORA TV-B-Gone. Created by Becky Stern. Last updated on :32:57 PM UTC

Prophet 600 GliGli mod

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

Glowing Star Chuck Taylor Sneakers

GPS Logging Dog Harness

DIY Wireless DDR Dance Pad with Bluefruit EZ-Key

3D Printed 20w Amplifier Box

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

Unicorn Hat with Moving Ears

Modifying Servos for Continuous Rotation

Mad Science Test Tube Rack

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

PrecisionCut Hair Clipper

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

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

Boomy The Boombox. Created by Ruiz Brothers. Last updated on :52:13 PM UTC

Qi Wireless Recharging Battery Case

TRON Bag. Created by Becky Stern

NeoPixie Dust Bag with Circuit Playground Express

Adafruit VL53L0X Time of Flight Micro-LIDAR Distance Sensor Breakout

NeoMatrix 8x8 Word Clock

Phone-Activated Talking Dog Collar

Naughty or Nice Machine

3D Printed Google AIY Voice Kit

'Sup Brows. Created by Kate Hartman. Last updated on :52:04 PM UTC

Secret Hollow Book Intrusion Detector

Adafruit GPIO Expander Bonnet for Raspberry Pi Created by Kattni Rembor. Last updated on :12:47 PM UTC

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

Beard Trimmer. 10,000 prize draw. Register online for MB4850. EXTRA year guarantee FREE rewards gallery

Fiddy - the FTDI Clip

Raspberry Pi Selfie Bot

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

Luminous LED Flowers. Created by Becky Stern. Last updated on :47:44 PM UTC

Beard Trimmer. 10,000 prize draw. Register online for MB4130. EXTRA year guarantee FREE rewards gallery

EXTENSION ARM INSTRUCTIONS

Fiddy - the FTDI Clip

Adafruit DRV2605 Haptic Controller Breakout

Transcription:

Stumble-Bot Created by Dano Wall Last updated on 2018-09-06 05:04:06 AM UTC

Guide Contents Guide Contents Overview Simply Stumbling We Have the Technology Other Supplies Leg Assembly Front Legs Back Legs Build It! Front servo Back servo Glue motors in place Attach the Legs Trim the Legs Connect Everything Prepare your battery pack Attach Servos The Code Synchronized Servos Uploading Troubleshooting Calibrating the Legs Digital Calibration Analog Calibration Finishing Touches Happy Stumbling! Exploring further 2 3 3 3 4 6 7 10 14 14 15 17 18 20 22 22 24 28 28 28 31 32 32 34 36 37 37 Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 2 of 37

Overview Simply Stumbling Here is a fun robot you can build with a cardboard box. Stumble-bot moves using servo controlled legs controlled by the Adafruit Crickit (https://adafru.it/bld) A Creative Robotics & Interactive Construction Kit. The design of this walking robot has the advantage of being very simple. As a result, it requires relatively few parts. We Have the Technology Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 3 of 37

This project pairs CRICKIT and Circuit Playground Express with two servo motors. 1 x Circuit Playground Express Circuit Playground Express is the perfect introduction to electronics and programming ADD TO CART 1 x Adafruit CRICKIT for Circuit Playground Express Creative Robotics and Interactive Construction Kit is an add-on to our popular Circuit Playground Express that lets you #MakeRobotFriend using CircuitPython OUT OF STOCK 1 x USB cable - A/MicroB - 3ft Standard A to micro-b USB cable ADD TO CART 1 x TowerPro SG-5010 Servo High-torque standard servo can rotate approximately 180 degrees (90 in each direction) ADD TO CART 1 x Micro servo This little servo can rotate approximately 180 degrees (90 in each direction). Works just like standard servos you're used to but smaller. ADD TO CART 1 x 3 x AA Battery Holder with On/Off Switch This battery holder connects 3 AA batteries together in series for powering all kinds of projects. ADD TO CART 1 x Male DC Power adapter - 2.1mm plug to screw terminal block If you need to connect a battery pack or wired power supply to a board that has a DC jack - this adapter will come in very handy! ADD TO CART 1 x Alkaline AA batteries - 3 pack These batteries are good quality at a good price, and work fantastic with any of the kits or projects that use AAs. ADD TO CART Other Supplies In addition to the electronics, you will need the following essentials: A flat box Scissors (or X-acto knife) Double sided tape (https://adafru.it/bjh) Hot glue Screwdriver Optionally, you may want to include popsicle sticks and some googly eyes along with the rest of your supplies. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 4 of 37

Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 5 of 37

Leg Assembly The top portion of the box will become the legs. Trace out rough outlines of the legs on top of the box. The front legs will be made from three pieces of cardboard glued together. The back legs can be made from a simple U-shaped piece of cardboard. Cut out a big square around the legs you've outlined using scissors or an X-acto knife. Once you've extracted the top piece of cardboard, follow the lines to cut out the leg parts. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 6 of 37

WARNING! BURN HAZARD! Hot glue is very sticky and it's easy to accidentally burn your fingertips. Be careful when using it. Front Legs Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 7 of 37

The front legs will pull our bot forward, so they need to be strong. Add a line of hot glue about 1/8" from the edge. Squash leg into the middle of the line of hot glue. Hold it in place for about 30 seconds, being careful to keep it at 90 degrees! Add a thin line of hot glue along each edge to provide more support. Do the same for the other side. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 8 of 37

Now we'll add a popsicle stick to strengthen the leg. You may also use a thin piece of wood or some stiff cardboard. Make a line of hot glue along one outside edge of the cardboard. Press popsicle stick down. Use hot glue or double sided tape to fasten servo hub to the top of the leg assembly. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 9 of 37

Back Legs The back legs will pivot back and forth, coordinating our bot's steps. You may want to trim the corners off each back foot at this point. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 10 of 37

Mark the center point where the servo hub will attach Use hot glue to add a popsicle stick (or bamboo skewer or similar). This will strengthen the cardboard leg. Use double sided tape to stick the servo hub to the finished leg. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 11 of 37

Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 12 of 37

Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 13 of 37

Build It! We will mount our two servo motors so they're pointing perpendicular to each other. Front servo Please be careful with paper cutting knives and scissors. The larger of the two servos, the SG-5010, will be used to power the front legs. Trace the outline of the servo housing on the bottom of the box, about an inch from the front edge. Carefully cut out this hole using a cardboard knife or an X-acto blade. Feed the wires through the hole from the bottom. Press the servo housing into the hole. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 14 of 37

Back servo Use a pencil to trace the outline of the smaller servo motor on the back edge of the box. IMPORTANT: Position the servo so the central rotation point is directly in the middle. Cut out this hole with a cardboard knife or x-acto blade. Press fit your servo motor into this hole. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 15 of 37

Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 16 of 37

Glue motors in place DANGER! BURN WARNING! Hot glue is very sticky and it's easy to accidentally burn your fingertips. Be careful when using it. Use dabs of hot glue around both servos to hold them firmly in place. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 17 of 37

Attach the Legs IMPORTANT! Rotate the servos back and forth to see where their extents are (how far they move in each direction until they stop). Move the servo with a horn Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 18 of 37

attached gently in both directions until it stops. When done, pick the rough middle of the 180 degree pivot range. Mount the legs in the middle, so they are free to rotate about 90 degrees in each direction. Mount servo hubs onto the motors. Use the provided screws to fasten the legs firmly to the servo horn. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 19 of 37

Trim the Legs The front legs may need to be trimmed down so the robot sits about level. Trim the corners off each front foot to prevent the edges from getting caught on small obstacles as it stumbles along. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 20 of 37

Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 21 of 37

Connect Everything Prepare your battery pack If your battery pack doesn't have a 2.1mm DC jack attached already, you'll need to add one. Three AA alkaline batteries are recommended to power CRICKIT. Alkaline batteries have a 1.5V max voltage, so 3 of them in series provides a steady 4.5V output. Perfect for CRICKIT! If your battery pack already has a DC jack attached, you can skip this step. Remove batteries before hacking on your battery pack! Snip the JST connector off your battery pack. We won't be needing this. Strip about 1/4" insulation off the end of the red and black wires. Screw these wires into DC terminal block. OPTIONAL: Peel back and remove the belt clip from back of the battery pack. This will make it easier to mount into your box. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 22 of 37

Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 23 of 37

Attach Servos Connect servos to your CRICKIT board. Be sure the yellow wire faces the edge of the CRICKIT board and the brown/black wire faces the Circuit Playground Express. Connect your DC plug to the power jack on your CRICKIT board. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 24 of 37

Use double sided tape to stick your battery pack to the inside of the box and CRICKIT on top of that. Connect Circuit Playground Express to your computer with micro USB cable. Make sure the battery pack and Crickit switches are set to "ON"! Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 25 of 37

Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 26 of 37

Once everything is connected you're ready to move on to The Code! Let's stumble onwards! Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 27 of 37

The Code Synchronized Servos We will use the Mu Python editor to upload the CircuitPython code to Circuit Playground Express and control both servos simultaneously. If you've not used CircuitPython before, set up and try it out with the Circuit Playground Express by following our installation/tutorial pages for the product (https://adafru.it/biv), learning about CircuitPython (https://adafru.it/alp) and reading our CircuitPython on Circuit Playground Express guide (https://adafru.it/bub) If you have not used Mu before, follow this guide on how to install it (https://adafru.it/ano) For a quick primer on using CircuitPython and Crickit, it is recommended to read through this learn guide (https://adafru.it/bl0). Uploading Make sure you've connected the Circuit Playground Express to your computer and have Mu open and connected to your board. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 28 of 37

Copy and paste the code below into your Mu editor. Save this code to your CIRCUITPY drive in your computer's file exploration program. # Stumble bot, coded in CircuitPython # Using an Adafruit Circuit Playground Express, Crickit, and 2 servos # Dano Wall, Mike Barela for Adafruit Industries, MIT License, May, 2018 # import time import board from digitalio import DigitalInOut, Direction, Pull from adafruit_crickit import crickit led = DigitalInOut(board.D13) led.direction = Direction.OUTPUT # Set up Red LED button_a = DigitalInOut(board.BUTTON_A) # Set up switch A button_a.direction = Direction.INPUT button_a.pull = Pull.DOWN # Create servos list servos = [crickit.servo_1, crickit.servo_2] # TowerPro servos like 500/2500 pulsewidths servos[0].set_pulse_width_range(min_pulse=500, max_pulse=2500) servos[1].set_pulse_width_range(min_pulse=500, max_pulse=2500) # starting angle, middle servos[1].angle = 90 servos[0].angle = 90 def servo_front(direction): if direction > 0: index = 50 while index <= 100: servos[1].angle = index time.sleep(0.040) Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 29 of 37

index = index + 2 if direction < 0: index = 100 while index >= 50: servos[1].angle = index time.sleep(0.040) index = index - 2 time.sleep(0.002) def servo_back(direction): if direction > 0: index = 60 while index <= 90: servos[0].angle = index time.sleep(0.040) index = index + 4 if direction < 0: index = 100 while index >= 50: servos[0].angle = index time.sleep(0.040) index = index - 4 time.sleep(0.020) print("its Stumble Bot Time") while True: if button_a.value: # If button A is pressed, start bot led.value = True # Turn on LED 13 to show we're gone! for i in range(5): print("back 1") servo_back(1) time.sleep(0.100) print("front 1") servo_front(1) time.sleep(0.100) print("back 2") servo_back(-1) time.sleep(0.100) print("front 2") servo_front(-1) time.sleep(0.100) led.value = False # end if # end while Click the A button on the Circuit Playground to see it move! Make sure the file saved to CIRCUITPY is named "code.py", this will allow it to run automatically when your CPX is powered on. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 30 of 37

Troubleshooting Problem: My servos aren't turning! Solution: Check that the switches on both CRICKIT and your battery pack are set to "ON". Problem: My Circuit Playground Express isn't recognized by Mu! Solution: Make sure your board is set up as a CIRCUITPY device. If it is showing up at "CPLAYBOOT" on your computer, you can follow the steps in this guide (https://adafru.it/afi) to get it back into CIRCUITPY mode. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 31 of 37

Calibrating the Legs You may notice that the movement of either or both of your robot's legs is not symmetrical. There are two ways to go about calibrating the position of the legs so that your robot's gait is smooth(ish). Choose your preferred method below. Digital Calibration While connected to your computer, you can use Mu to quickly dial in the numbers for each servo. In Mu, click on the REPL icon and watch the printout at the bottom of the program to see which leg movement is related to which block of code. It may be helpful to label each leg something like "Front 1", "Back 1", "Front 2", "Back 2", to help keep track of each of them. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 32 of 37

Change the numbers in index = 50 and while index <= 100 to alter the swing of each leg. The front legs should alternate about 40 degrees back and forth. The back legs swing about 30 degrees up and down. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 33 of 37

Analog Calibration Alternatively, if you prefer a more hands-on method, you can skip the programming side of things and simply remove the legs and reposition them as needed. This method can take some time to get exactly right, but works well if you aren't able to connect to a computer and update the code.py file. Calibrated legs should move equally in both directions. Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 34 of 37

Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 35 of 37

Finishing Touches If you find your robot sliding around, adding a thin line of hot glue or other grippy substance to the toes of the front legs can help give it traction. Googly eyes and other decorations are a fun way of personalizing your Stumble-bot. You can use markers or crayons to add personal touches. Some pipe cleaners can easily give your robot a more alien appearance! Adafruit Industries https://learn.adafruit.com/stumble-bot-with-circuit-playground-and-crickit Page 36 of 37

Happy Stumbling! Exploring further If you enjoy CircuitPython and want to continue learning you can find lots more CircuitPython projects on the Adafruit Learn System (https://adafru.it/bqp). Adafruit Industries Last Updated: 2018-09-06 05:04:05 AM UTC Page 37 of 37