bop-it
2025-03-07
- Learning how to wire up one of the first sensors for the Bop It! game, which is
a TTP223B sensor. Operating Voltage is DC 2.0V - 5.5V and can apparently be
mounted on plastic, glass or metal, and in a wall??). Needs to connect to a digital pin.
- Interestingly (and amazingly!), I was able to test that the sensor could detect
touch through a material (I tried touching it through a cardstock) and it was
detected! This will be really helpful for the eventual Bop It design because
I probably don’t want to expose the electronics but cover them up with some material.
I should test if plastic or some other material would work, to keep the unit protected. Note that the touch also works on either side of the device, so using the flat side might be a good option. :)
- I started doing some research about how to build out an enclosure / box for the
game. I think this is going to be the hardest part. I found TinkerCAD which seems
like a really good, approachable software that will let me design a 3d box which
I can hopefully 3d print using the printer here (hopefully!). I think I’ll
design a box top and a box bottom with holes / openings for the various sensors that
the game will need to expose. So I need to get the game wired up first and take
measurements of the sensors so I know the dimensions of the box!
2025-03-10
- Am working through how to code up the Bop It! game and have learned some things.
First, some of the libraries that I rely on will need to be uploaded to the Pico
device. This can be done with the MicroPico extension I installed last week, but
it’s not enough to just click “run” on the program, the whole project needs to
be uploaded first. Libraries can be copied directly into the project. For the
accelerometer device I have, I am using this repo.
- Things I’ve stolen from the kit that I should replace:
- The joystick
- Male-to-female jumper cables
- MPU6050 with pinout
- Slide switch
- LCD 1602 with an I2C connection
- I figured out some game logic so that I could measure input from the slide
potentiometer, the joystick, and the accelerometer. The game can prompt in the
console that it wants the user to Slide, Shake, Flick, or Touch it, and it mostly
works. The next steps are a bit harder:
- Figure out how to hook up the speaker, which might be tough since the speaker
ideally would be hooked up to the Analog input, but that’s already being taken
by the potentiometer and the joystick. I need to figure out a converter.
- Figure out how to power the game with a battery
- Figure out the mechanics for turning the game off and on. I think I might
do this last.
2025-03-11
Last night, I spent some more time on the Bop It! game, and it was pretty
frustrating. I was attempting to hook up my amp and speaker so that the game can
issue instructions, but that didn’t work so well. The speaker can only really emit
some sort of beep-like sounds (it’s very challenging to play the .wav files I had
created). I think that’s a combo of the Pico’s memory and power and the speaker
itself. This was really frustrating but I was able to reflect on it overnight
and have a slightly different plan. Instead, I’ll hook up an LCD display that
displays the instructions, and include some custom “beeps” to go along with the
game play that indicate the different moves that will be made. I started working
on hooking up the display today and that worked pretty well, although I don’t
love the display I chose. So, I think I’ll buy a new display and then up next
will be figuring out the power source for the game and making the custom beeps
work, and then figuring out how to solder it all together!
Taking a crash course on YouTube on soldering
and some lessons include:
- Get stranded core wire, which is easier to work with. Then tin the wire (solder
the ends together) so it’s easier to work with. Can also connect two wires together.
- To attach a wire to a pin board, first fill the hole with solder, and then slide
the wire in and solder it.
2025-03-12
- Designed a box for the game, with holes for the various sensors. This was
kind of scary, but I think maybe it worked? I used Tinkercad to do the design and
am looking forward to 3d printing it so I can try it out. The initial design is
very simple, and all the sensors will be on the front of the box. The box is
also pretty big but this will give me a sense of how all these pieces fit in the
space, etc.
- Figured out how to get the game working with battery power! This was easier
than I expected. The RPi Pico runs whatever is in main.py on boot, so getting the
battery working was basically as easy as making sure the latest files were
uploaded and then plug in the battery! The battery has an easy connector, too,
so I think that will be my mechanism for turning the game “on” in this first
prototype. I did find that the game didn’t boot automatically when powering the
device with the computer – it turns out the MircoPico VS code extension interrupts
the boot with the REPL, so to get the code to run automatically, I just need to
turn off VS code (or disconnect MicroPico from the device).
- Up next I need to figure out how the speaker works and figure out what devices
I need for the final wiring and which devices I need to replace!
2025-03-13
- Hooked up a Piezo buzzer. I had really been struggling with the speaker set up
that I was trying to make work. I had a small 1 ohm speaker (along with a PAM 8403 amp)
that I was hoping would be able to play wav files but I didn’t really do enough
research ahead of time before settling on that as “my plan” and was sort of disappointed when it
didn’t work exactly the way I expected. IIRC, there was some combination of the
Pico not quite having enough power out of the box to stream the wav files and
the speaker not having the fidelity it needed to play the sounds. I decided I
could use that speaker to play some buzzes / beeps instead to indicate different
move types and to give feedback to the user if they made the wrong move. Then,
I realized I could use a Piezo buzzer for the same effect and could maybe get
away with not having to use an amp for the buzzer, which simplified the design
a bit. I hooked that up and got it working on the breadboard.
- Then, I attempted to start building out the PCB board to make the game a bit
more permanent. This required soldering which I haven’t (really) done before. I
was able to get the Pi Pico and the accelerometer attached to the board somewhat
easily, and then I started wiring up the header pins for various components. This
had mixed results. I was able to confirm that the touch sensor and accelerometer
were hooked up correctly and collecting data, but had some problems with the LCD
display (not receiving power) and the slider (it seems to think it’s connected,
but isn’t registering a change in resistance when sliding the potentiometer). By
that time it was pretty late, I had inhaled a lot of solder fumes (😬) and I was
getting tired. I decided to pick the soldering back up next week, and will probably
need to ask for help to figure out how to both debug the connection and also maybe
clean up some of the bad soldering. A bit frustrating, but still somewhat
encouraging that some of the sensors work!
2025-03-18
Today was all about Bop It! (again). I got some help to debug my crappy soldering
and found that most of my ground connectors weren’t fully connected. The soldering
is such a mess and despite my best efforts, I just kept building up more and
more of a blob of solder. It’s ugly, but at least it’s working for now.
Once I was able to confirm that all the sensors worked, I temporarily taped them
into the first box that I designed. This wasn’t a great box because the holes
were designed a little bit in a slap dash manner. But this gave me the ability to
see what size holes would would and confirm that I could fit everything into
the box. Then I redesigned the box and included a sliding cover. I am currently
in the process of printing the box (it will take another 2 hours!), so I’m looking
forward to seeing what happens. This was a helpful tutorial
for understanding how to design the sliding header.
Finally, I need to figure out a few final things now that some new parts have
arrived:
- Hook up the new buzzer and select sounds for the various inputs
- Hook up the battery and make sure that it successfully powers the game
- Figure out why the sliding potentiometer is still too sensitive, it seems to register a slide even when the slider isn’t sliding
2025-03-20
Today I assembled the Bop It! Game! I put all the items in the box and tried it
out! A few things I discovered:
- Super glue worked well for devices where I could get the surface flush with
the box, specifically the touch sensor and the joystick. Interestingly, though,
it seems like I got a little bit of glue on the joystick itself which seems to
have messed with the joystick readings. The “default” or “empty” mode is now not
very consistent, so I had to make some tweaks in the code to look for readings
above or below a particular threshold instead.
- I had to use electrical tape to hold in the LCD display and the slider. This
isn’t working great but “it’ll do” for now.
- The sliding box cover doesn’t have quite a deep enough groove so I needed to
fortify it a little bit by putting some bumpers under the lid and some hot glue
dots on the outside.
- The buzzer seems to be completely broken, and I’m not really sure why. My
assumption is that it’s due to some bad connections of the pins. I want to get
this working again but honestly I’m kind of tired of soldering so I decided to
take a break.
- I am going to give a presentation about the game today! Slides are here.