"Bop It" With the Circuit Playground Bluefruit

by AlessanG in Circuits > Microcontrollers

181 Views, 0 Favorites, 0 Comments

"Bop It" With the Circuit Playground Bluefruit

PXL_20230328_201346087.jpg

The finished product of this Instructable is a working copy of the "Bop It" interactive toy by Hasbro. This build includes sensors to record the actions of pressing a button, twisting a potentiometer, flicking a joystick, and making a noise (shouting, clapping, etc.) to mimic the bop it actions of "bop it," "twist it," "flick it," and "shout it," respectively. The CPB has a bit more space for adding more sensors if desired, which would require a different case design. This build is also mobile, using a battery pack to power the device, and has a speaker for better audio quality.

Supplies

Download & Print the 3D Case Files

Screenshot (74).png
Screenshot (75).png
Screenshot (77).png

You can download the files I created for this project on this step. There are three GCODE files that the printer will use: Base, Top, and Stilts. Since the Base and Top take up most of a printing bed for the Prusa Mini, they will all have to be printed separately.

If using a Prusa or similar model, placing the files on a USB drive and plugging it into the printer will be all you need to do. Here are instructions on loading the filament into a Prusa Mini printer.

Soldering the Joystick Onto the Breakout Board

solder board.jpg

The joystick and the breakout board will be separated on arrival. To use the joystick easily, you will have to solder the joystick into the board so that the outputs can be sent through wires, which will be connected in the next step. Place the joystick down into the top of the breakout board, being careful not to bend the pins on the joystick in the process. Flip the board over and solder the 6 connections for the X and Y outputs (these connections are the rows with 3 pins). I also soldered one of the larger "corner" pins just to hold the joystick in better, but this isn't necessary.

Solder Alligator-to-Male Wires to Joystick

solder pins.jpg

Using four of the Alligator-to-Male Pin wires, push the pins up into the XOut, YOut, VCC, and GND holes from the bottom of the board. (We won't be using SEL in this build, but it is an extra input that records when the joystick is pressed down into the board and can be wired for future projects). Solder the pins on the top of the board so they are held in place.

Glue Sensors Onto Case

Screenshot 2023-03-28 144154.jpg

Now with the case printed and the joystick ready, it's time to secure the sensors and battery pack. This image shows where to hot glue (the red strips and dots) and for which sensors the glue is for. Make sure to place the sensors in the proper places, with the pins for the button going through the holes, the 3-pin connector for the potentiometer facing towards the center, and the joystick pins facing towards the center as well. The battery pack should have the on-off switch facing upwards so it is accessible and won't be hidden against the case.

Gluing the Stilts

PXL_20230328_191634534.jpg

In order to access both the top and the bottom for wiring, it is easiest to use hot glue to attach the stilts to the case at this point. Glue a stilt to the bottom of each outside corner of the case. The inside corners will not have stilts in order to better reach and adjust the wiring.

Wiring

clips on cpb.jpg
dual ground.jpg
Button.jpg
speaker.jpg

All of the alligator clips should be connected coming up from the bottom of the CPB; the CPB should also be in its final location (in the middle of the case) as you wire to avoid having to unclip it to move the CPB later. You should position the CPB so that the USB port is facing the button and potentiometer, and the power port should be facing the speaker.

To wire the joystick, place the GND alligator to any ground on the CPB, and place the X and Y alligators to A5 and A6, respectively. The VCC alligator should go to a 3.3v pin (I used the one between A5 and A6).

To wire the potentiometer, connect the 3-Pin STEMMA connector to the potentiometer through the hole in the bottom of the case. The white alligator should connect to A3, the black should connect to any ground (I used the one closest to the potentiometer), and the red should connect to any 3.3v (I used the one in front of the button).

Now we've used 2 of the 3 ground holes, and we need to connect 4 devices to ground. To get around this, I connected the 5th alligator-to-male pin wires to the remaining ground hole; any other devices that need ground can clip to the pin on the end of this wire.

To wire the button, use two alligator-to-alligator wires and connect one to each of the button's pins sticking out from the bottom. One should go to A1 and the other should connect to the pin from the ground alligator we attached earlier.

For the speaker, place one alligator on the top of the audio jack and one on the bottom, as shown in this step's pictures. The alligator on the top should lead to AUDIO, and the alligator on the bottom should lead to the pin on the ground alligator we attached earlier.

Finally, connect the battery pack to the CPB on the end opposite the USB port.

Optionally, you can hot glue the CPB to the case on the resting strip when you are done with the wiring, although this will make it harder to access and update the code. I found that the wiring on both sides kept it in place without having to glue it.

Attach Top

top.jpg

Now to attach the top, simply place it over all of the items and line it up with the bottom. The holes in the top should allow for you to place it easily even when the sensors are all in place. Hot glue the inner and outer corners of the bottom part of the case and press down.

Download Code/Sound Files & Upload to CPB

Download the code.py file, lib folder, and sounds folder from this link.

Now just place all of them on the CPB (overriding any previous ones, so make sure to back those up if you need them!) and you should be good to go!

Press Button to Play

Simply press the button you wired to start the game. The game will begin by running through bop it (pressing the button), twist it (twisting the potentiometer), flick it (flicking the joystick), and shout it (using the on-board microphone to detect a sound). After these four, the actions will come in a random sequence until you either make the wrong action or don't get it done in time. Enjoy!

A link to a gameplay example is found here.