Jewelry Box 2.0

by iquealy in Craft > Jewelry

77 Views, 0 Favorites, 0 Comments

Jewelry Box 2.0

IMG_5177.jpeg
IMG_3597.JPG

A young child has been asking for a secure place to store small items such as toys and accessories. However, their parents do not trust them to have a box with a key and a lock because they are too young and could lose the key. The parents would like a device to give their children a secure place to store their items while being developmentally appropriate. While creating the device, we will use a program such as Adafruit, which creates the primary device to help us open and close the box to keep the items inside. A Circuit Playground Express, a CPX, is an all-in-one design board featuring a processor, sensors, LEDs, and USB. The CPX allows us to pass the coding for the machine through to the box to open and close the lid. Creating a code that will be transmitted to the CPX will allow the motor to be attached to the CPX, which will be set off by a code that will allow the jewelry box to open.


Supplies

CPX

Jewelry Box Base

Jewelry Box Bottom 

Adafruit Circuit Playground Express Basekit

Continuous Rotation Micro Servo

Aligator Clips to Male Wires

Motor arm 

Paper Clips

MU Editor

Hot Glue Gun

Optional:

String

IMG_3588.jpg
IMG_3589.jpg
IMG_3584.jpg

Connecting the Base and Top of the Jewelry Box:

After having both the base of the jewelry box and the top of the jewelry box in two separate pieces, you will need to connect them both. In the back of the bottom of the box, there are the hinges to be connected to the top. Place the top piece over the bottom piece and then get two paper clips.

IMG_3593.jpg
IMG_3585.jpg
IMG_3584.jpg

Use Paperclips to Secure the Base and Top:

Open up the paper clip so it is entirely flat. Then, put the flattened paperclip through the hole on the left side to secure it. Then, repeat on the other side with another paper clip. After the paper clips are through the hole, rebend the ends of the paperclip that are not inside the hinges so they are out of the way. You can secure these downs with hot glue to fully secure the base and the top of the jewelry. If the top of your jewelry box is still not fully secured, you can attach a string to the motor later on that is wrapped around the top of the jewelry box and connected to the arm of the motor.

IMG_3592.jpg
IMG_3590.jpg
IMG_3591.jpg

Attach the Arm to the Motor:

Get your Continuous Rotation Micro Servo, which is the blue motor. On the top of the motor is a white circular, which is where the motor arm is to be attached to. You will have three different motor arms. For this, you have the smallest motor arm. Then, attach the motor arm to the Continuous Rotation Micro Servo.

IMG_3587.jpg

Attach the Motor to the Jewelry Box:

Put the motor in the base of the jewelry box on the front side of the jewelry box. To secure it, you will need to hot glue the base of the motor to the base of the jewelry box. This is when, if you need to use string to secure the top of the jewelry box to the base, you will attach the end to the motor arm.

IMG_3594.jpg

Connect the Circuit Python to the Motor:

We will connect the Circuit Python to the motor through the Aligator Clips to Male Wires. Connect the male wires to the end of the motor that has the wires. We will then connect the alligator clips to the CPX. The picture above will show exactly which wires are used for each. Make sure you are following the colors from the wires attached to the motor and not the male wires since they are not necessarily the same colors.

IMG_3596.JPG

Connect the Circuit Python to the computer:

Now, after properly connecting the wires to the Circuit Python from the motor, we will attach it to the computer. Plug the cord attached to your CPX into the side of your computer.

Screenshot 2024-04-11 at 2.52.08 PM.png
Screenshot 2024-04-11 at 2.51.57 PM.png

Download Adafruit Circuit Playground Express:

https://circuitpython.org/board/circuitplayground_express/

https://circuitpython.org/libraries

Download the necessary functions that correspond with your CPX using the websites above.

Screenshot 2024-04-11 at 2.47.32 PM.png

Download MU Editor:

https://codewith.mu/

Using the website above, follow the steps to download the proper code editor and ensure the code functions properly.

Screenshot 2024-04-11 at 2.50.56 PM.png

Open up MU Editor:

After downloading MU Editor, open it. It may take a minute to open, so give it some time to open.

Screenshot 2024-04-17 at 3.29.19 PM.png

Copy the Code into the MU Editor:

https://docs.google.com/document/d/1uylesDFaqwzi3SrFM6h62GeL0KjMto0DPNJzexqFu3M/edit?usp=sharing

Using the code above copy this into your MU Editor.

Screenshot 2024-04-11 at 3.02.05 PM.png

Check the Code with the Code Checker:

After you have copied the code, go to the top of the screen on your MU Editor and look for the thumbs-up icon that says check under it. Press the icon, and if there are no problems with the code, it will turn green. However, if there is a problem with the code, the icon will turn red and become a thumbs-down. If it does turn red the issue will pop up and

Screenshot 2024-04-11 at 3.00.23 PM.png

Hit Save and Run the code:

After all the code is checked, hit the save button at the top of the MU Editor; this will prompt you to download it as a name. Make sure you download and save it as code.py since this will be the only way it will run. After you complete this, you should be able to run the code correctly. Hint: Remember that the code will take a few seconds to run, so wait, and it will start.

Enjoy your Jewelry Box!

Downloads