PenguinTutor YouTube Channel

Raspberry Pi Pico LED Reaction Game

Hit the button at the right time to score points.

Raspberry Pi Pico LED Reaction Game with NeoPixels, LCD display and a giant button switch

This is an electronics games where the aim is to hit the giant button when the centre LED is lit up. This features a NeoPixel strip with 44 LEDs, with the lit LED moving from one side to the other and back.

It also includes an enclosure designed in FreeCAD suitable for 3D printing.

Raspberry Pi Pico setup with CircuitPython

The code for this is designed to run on CircuitPython. For more details about setting up CircuitPython on a Raspberry Pi Pico then see the link below:

If you find these kind of videos useful please subscribe to my channel : Click here to subscribe.

Electronic Circuit Breadboard Design

The first version I created was on a breadboard. Below is a complete list of components used. You could substitute some of these components as required.

  • Breadboard Half+ Size
  • Raspberry Pi Pico
  • Hitachi style LCD display with backpack featuring PCF8574 serial to parrallel IC
  • Adafruit I2C bi-directional level-shifter
  • Addressable RGB LED strip (WS2812b or similar) / NeoPixel strip
  • 5v input jack socket
  • External power supply 5V 4A with barrel plug
  • 10cm giant gutton (blue) with LED
  • Arcade button (green) with LED
  • 1N5817 schottky diodoe
  • 2 x 2N7000 N-channel MOSFETs
  • 2 x 470Ω resistors
  • Male-to-male and male-to-female jumper wires
  • Crimp spade connectors
  • 3-pin JST connector
  • Solid core wire (optional)
  • Adafruit Perma-prototype breadboard or stripboard (optional)
  • 3D case and hex screws (if creating enclosure)

These are connected on the breadboard as per the below diagram. This is explained step-by-step in the corresponding video above.

Raspberry Pi Pico LED Reaction Game with NeoPixels, LCD display and a giant button switch. Circuit design on Breadboard.

The power is provided to the Pico through a schottky diode connected to VSYS. For a full explanation about the power connections on the Pico see:

Due to the pull-up resistors included in the LED display a bi-directional level-shifter has been used. This safely converts from the 3.3V GPIO pins to the 5V I2C pins on the LCD display. It also provides a increase from 3.3V to 5V for the NeoPixel strip (advisable, but generally not required). For more details about the problem with I2C and Pull-ups see the link below:

Creating a permanent circuit

To create a more permanant circuit I used an Adafruit perma-proto 1/2 sized breadboard. I used female headers for the Raspberry Pi Pico and level-shifter which will allow for re-use in future projects. The photo below (partial soldering) shows the schottky diode installed underneath the position of the Raspberry Pi Pico, with a wire soldered to it and protected with heatshrink sleeving.

Raspberry Pi Pico LED Reaction Game with NeoPixels, LCD display and a giant button switch. Soldered to a perma-proto breadboard with headers and schottky diode.

The complete board also uses a 3-pin JST connector for the NeoPixel strip, male-to-female headers for the LCD display and crimp spade connectors used to connect to the switches and LEDs.

Raspberry Pi Pico LED Reaction Game with NeoPixels, LCD display and a giant button switch. Soldered to a perma-proto breadboard with power jack, JST connector for and switches.

CircuitPython Code

I've explained how to control various devices in my other pages.

The code then creates a main while True loop, which runs forever. Inside that it waits for the giant button to be pressed and then responds accordingly by updating the LCD display. The play will then either continue or wait on the start button being pressed.

You will also need to install the NeoPixel library and the appropriate LCD / I2C library.

Full details are available on my github page:

Enclosure

I've also designed an enclosure in FreeCAD. The files for the enclosure are included in the github download.

The screws used are hex socket head screws. For the LED display I used M2.5 and for the body I used M4. The walls were printed with larger "wall thickness" than normal (through settings in Cura slicer) to allow a screw thread to be added to the base using a M4 threading tap.

It was a long print, expect to take about 2 days for a full print of both parts. The extra thick walls likely contributed to the print time.

More Information

Future projects

I'm always working on new projects
To find out about the updates please:
Subscribe to the PenguinTutor YouTube Channel
and
Follow @penguintutor on Twitter

Previous Pico Lights automation
Pico Lights automation
Next ESP32 Capacitive Touch
ESP32 Capacitive Touch