Maker.io main logo

LED Reactive Light-Up Hockey Puck in MakeCode

2021-02-02 | By Adafruit Industries

License: See Original Project 3D Printing

Courtesy of Adafruit

Guide by Ruiz Brothers

Overview

In this project, we’re making a 3D printed LED hockey puck.

This was inspired by the DIY indoor hockey project by Yuksel Timez.

This hockey puck lights up and makes chips tunes based on motion!

 

You get a light show each time you hit the hockey puck, so it's still super fun even when you miss a goal.

hockey_1

Either the Circuit Playground Express or the Circuit Playground Bluefruit make this a fun and easy project that uses the built-in motion sensor and NeoPixel LEDs.

The case was 3D printed in NinjaFlex filament which lets you use the buttons to switch between different animations.

With MakeCode for the Circuit Playground Express or MakeCode Maker, we were able to quickly make this demo.

MakeCode an easy to use block-based code editor that's great if you're just getting started.

puck_2

puck_3

clamp_4

Parts

Select either the Circuit Playground Express or the Circuit Playground Bluefruit.

3D Printing

Parts List

Parts List

STL files for 3D printing are oriented to print "as-is" on FDM style machines. Parts are designed to 3D print without any support material. Original design source may be downloaded using the links below.

  • puck-cover.stl
  • puck-btm.stl
  • hockey-blade.stl

Edit Puck Design

Download Puck Stls

Edit Hockey Blade

Download Hockey Blade

Slicing Parts

Hockey Blade

Slice the Blade part with settings for PETG material. The parts were sliced using CURA using the slice settings below.

PETG filament

230c extruder

0.2 layer height

30% gyroid infill

70c heated bed

slice_5

Circuit Playground Puck Case

Slice the Case parts with settings for TPU 98a material. The parts were sliced using CURA using the slice settings below.

TPU 98a filament

230c extruder

0.2 layer height

30% gyroid infill

50c heated bed

slice_6

MakeCode

MakeCode for Adafruit Boards

MakeCode is an easy-to-use block-based programming editor that runs in the Google Chrome web browser. It’s has an intuitive interface and features lots of examples and demos.

makecode_7

LED Hockey Puck Code

If you are using the Circuit Playground Express, which uses https://makecode.adafruit.com, click the button below.

Get the Hockey Puck Code for the Circuit Playground Express

If you are using the Circuit Playground Bluefruit, which uses https://maker.makecode.com/, click the button below.

Get the Hockey Puck Code for Circuit Playground Bluefruit

Pair Device and Upload

Once you have the MakeCode program open, click the edit button on the top right to open it in a new MakeCode project.

The code blocks and simulator will be ready to modify. Let's get the device paired with WebUSB.

  1. Click on the Gear icon, at the top right.
  2. Select Pair Device from the dropdown.
  3. For the Circuit Playground Express, click on CPlay Express and Connect. For the Circuit Playground Bluefruit, click your device and click Pair Device.
  4. Click the big blue Download button to upload the code.

pair_8

pair_9

MakeCode Blocks

blocks_10

on start

if true then

  • while true do show animation (rainbow)

if button B is pressed then

while true do

  • show animation (purple fireball) for 2ms

else if

  • button A is pressed then
    • stop all animations
    • while button A is pressed do
      • show animation (blue chase) for 5000 ms

on button A click

  • stop all animations
  • While button A was pressed do
    • show animation (blue chase color) for 5000 ms

on face down

stop all animations

  • run in parallel
    • show animation (red orange color) for 5000 ms
    • play melody (falling)

on 2g (step)

  • play sound (pew pew)
  • stop all animation
  • show animation (sparkle)

on button A+B click

  • reset

Assemble

Place Lipo Battery

Orient the battery so the wire connections are facing down.

place_12

Align Circuit Playground

The battery port aligns with the flaps on the case.

place_11

Attach screws

Align the flaps on both parts of the case and fasten four M3x12mm screws to each standoff.

attach_13

Plug in Battery

Pull the lid flaps back to plug in and to disconnect the battery to the Circuit Playground.

To close the port opening, push the larger flap behind the shorter flap.

attach_14

Charging the Battery

The battery connector can reach out of case and plug into a USB lipo charger to recharge the battery.

charging_15

Hockey Blade

The hockey blade press fits into a 7/8 diameter dowel.

Use an M3 screw to further secure the blade.

blade_16

blade_17

制造商零件编号 3333
CIRCUIT PLAYGROUND EXPRESS
Adafruit Industries LLC
制造商零件编号 4333
CIRCUIT PLAYGROUND BLUEFRUIT BLE
Adafruit Industries LLC
制造商零件编号 4410
LIPOLY BATTERY CHARGER W/USB C
Adafruit Industries LLC
制造商零件编号 4111
CABLE A PLUG TO MCR B PLUG 3.28'
Adafruit Industries LLC
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum