The Carousel

by btorpey1 in Circuits > Microcontrollers

98 Views, 1 Favorites, 0 Comments

The Carousel

finalimg.jpg

The CPX is the major component of our project because it's a device that allows codes to activate our movement, sound, and lights with the sensors of the A and B buttons. We used the platform Thingiverse to search for all the possibilities that the CPX could perform with Adafruit. We then downloaded all the attachments for 3D printing. After 3D printing all these attachments to create a carousel, we created a device that incorporates sound, movement, and lights. This device uses the Servo Motor, CPX, and battery pack simultaneously to illuminate the beautiful design that is the Carousel.

Supplies

1.png
2.png
3.png
4.png



  • Continuous Rotation Micro Servo FS90R - https://www.adafruit.com/product/2442


3D Printing

5.png
  1. Download the following STL files below.
  2. Import the files into your slicing software and export for printing.
  3. Print the parts at 20% infill. No supports or rafts are necessary.
  4. Print four horses, then one of each remaining part.


Original creators credit:

These files were designed using TinkerCAD

Base, roof, and horses: https://www.thingiverse.com/thing:2841593/files 

Connecting piece: https://www.thingiverse.com/thing:4744133 

Assemble the Roof

6.png
  • Attach the connecting piece to the roof using super glue.


  • Next, glue the horses onto the connecting piece. Each pole should have a horse glued onto it when finished.


Connect the Servo Attachment

7.png
  • Then, connect everything you have assembled so far to the round servo motor attachment. This is done by gluing the bottom of the connecting piece to the attachment.

Assemble the Base

8.png


  • After that, attach the servo motor by placing the servo motor under the base, and centering it under the hole. Then, snap on the attachment, along with everything that is connected to it, onto the top of the servo motor.


  • Make sure to place the battery pack underneath the base, next to the servo motor.


  • Finally, feed the wires of the battery pack and the servo motor through the hole on the side of the base, and then through the hole on the side of the ticket booth. Place the CPX inside the ticket booth and connect the Servo Motor and the battery pack.


Circuit Python and CPX Files

9.png



  • Navigate to the lib folder on your CircuitPY drive and on the library bundle.


  • Copy the two folders adafruit_motor and adafruit_circuitplayground into your CircuitPY lib folder.


  • Your lib folder should look like the one above



The Code

10.png
  • Download code.py below and save it onto your CircuitPY drive.


The code provided has multiple forms of input:

  • When button A is pressed
  • Servo motor rotates clockwise at 20% speed
  • Show clockwise rainbow light animation
  • When button B is pressed
  • Servo motor rotates clockwise at 60% speed
  • Show counter clockwise rainbow light animation
  • When shaken
  • Servo motor rotates clockwise at 10% speed
  • Show sparkle light animation
  • When slide switch is false
  • Servo motor stops
  • Light animations stop

Downloads