Introduction: Jewelry Box 2.0

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

Step 1:

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.

Step 2:

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.

Step 3:

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.

Step 4:

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.

Step 5:

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.

Step 6:

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.

Step 7:

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.

Step 8:

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.

Step 9:

Open up MU Editor:

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

Step 10:

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.

Step 11:

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

Step 12:

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.

Step 13:

Enjoy your Jewelry Box!