Introduction: PCB & 3D Case for STEM Game Platform

In response to requests, I have created a PCB board layout and produced Gerber files for the STEM-Game Platform. Additionally I have produced 3D printed cases for the PCB based builds.

The PCB board supports 2 locations for attaching 4-button sub-modules and 2 for 8-LED sub modules. This is done to make the PCB adaptable for both un-enclosed applications and a variety of enclosures. It also could optionally support discrete 3mm LEDs plus resistors for each of eight.

Supplies

Step 1: The Minimum Build

This requires only 5 elements (listed in the preceding section). This is recommended as a first build and for junior DIYers.

The parts can be found on Ebay or AliExpress (which I prefer).

The piezo can be 9 or 10 mm and must not be an active buzzer but a passive sounder. 

Nothing else needs to be placed on the PCB. To use it you simply power it up via a USB power cable.

The five components in the first image have their pins plugged into appropriate holes in the PCB and soldered. Note that the common pin on the sub-modules must be connected to one of the end spots of the associated PCB header connector locations.

I have a unit like this which I use almost daily for Morse Code training; plugging it into my PC front panel USB. This setup works out especially well due to the main output (other than the sound of dit Dahs) is a text monitor window, with very large font for my poor eyes, on my PC screen.


Optional Components

The 150 ohm resistor on the board along with a little bit of software allows getting three level volume, utilizing 2 pin digital control, out of a piezo sounder (not counting 0 vol.). The optional electrolytic capacitor is to reduce system cross-talk noise.

Step 2: Basic Portable 3D Print Encased Build

The remaining PCB parts indicated on the PCB and listed below, are for the support of portable battery operation, along with trickle charging while connected to USB power (so as not to over charge, the USB 5v supply used must be within specs <=5.25v) .

This build used these additional parts:

     Perhaps a couple of short lengths of wire.

     Optionally female pin headers used as ext. connectors.

     Optional speaker (+ optionally a 10uf ceramic 106 capacitor).

     Very optional a 100-220uf electrolytic cap (C1).

If used a speaker needs to be 20mm or less and preferably 32R Ohms.

The separate sub-modules can be attached in one of 8 orientations (theoretically), towards and over the micro-controller or going away from it, on either top or button side of the PCB, for each of 2 connectors (2*2*2=8). This helps allow for the use of various dimensioned construct boxes. When buttons or LEDs are mounted on the back side, the ordered array of pin numbers in the software needs to be reversed, via the appropriate code section in the .h file (unless you want to operate and think and count right to left as opposed to left to right).

When sub-modules extend out over the micro-controller, header-pin sockets for the mounting of the modules may be needed, or some sort of spacers, to raise them up.

Note that on the board there are two dashed lines indicating where one might want to cut the board down to size or alternately to separate out the individual LEDs as a makeshift sub-module (to be interconnected by wires and/or resistors).

Step 3: Differences in Button Modules.

You can use any of the button modules pictured or make your own on a perf board with larger buttons.

You will find on eBay, some red buttons which are very short, some black ones that are quite long, and medium height black ones that are just right for this project, as assembled with the STEM_Box_Prj1 case I used. These all often ship with the header pins on the wrong side. If you can get them to put them on the other side or leave them loose. You’ll have to cut them off &/or unsolder them and put header pins on the underside. 

As the red button variety is very short , I had to trim the already short header pins, on the top side, so that the buttons would protrude out of the box enough (noted they are trimmed off in the photo). If you were going to use round holes, in your construction box, with just the button stem sticking out, you would use the buttons with the long push stems.

Step 4: Attach Parts to the PCB

I did a compact build to go into the 3D box I made. First I cut the PCB board down by removing the section for the optional support of individual LEDs (not ventured into here & now).

I mounted the button & LED modules on the back, but first cut the Nano header pins short so as not to hit the underside of the sub-modules.

When mounting the button and LED modules on the bottom side of the PCB, be sure to solder on all the parts going on the up side of the PCB first (minimum: MCU board + Piezo).

You can see I used (between the PCB and sub-modules) a cutting from a ⅛” thick sheet of plastic foam, I received as padding in a package sent to me. This helps prevent flexing of the button module during vigorous game play. 

Step 5: Putting the Enclosure Together

If you have made the 3D printed box from the STEM Box Prj1.stl and STEM Lid.stl files …

Review the 3D image ( STEM box Lid ). Make sure the lid’s hinges are narrower at the top, seen as little cut aways in the image. Cut away excess material as needed from all 6 hinge parts. Put the lid on top of the box with the front clasp connected (closed position) then firmly press rear hinges together (snap). I have had materials other than PLA, PLA+ or ABS break off a hinge piece on me here. It may be wise to soak in very hot water first.

You should be able to drop the PCB and its four attached components right into the box, with the buttons slightly poking out their access hole. You may want to use one dab of hot glue, at the base of the PCB, to keep everything lined up, and keep the USB connector sticking out the other end.

Step 6: For a Fully Stand Alone Unit Put All the Parts on the PCB

Connect only 2 of the 3 pins of the on/off switch to the PCB. If you connect all three the device will always be on. Connect the two on the side you want to use as the ON position. Note that this is affected by the orientation in which you’ll use the device. For the construction with the 3D printed box I made, I attached the two farthest from the near corner, such that with the device setting with the lights and buttons on top, the switch slides left to right to turn on.

Cut the mounting ear(s) off the switch as needed. With the switch and prototype PCB I used, one ear overlapped the optional external connection access hole. So it should be cut back some. You may want to use a little hot glue for extra mounting strength (once your assembly is finished). But be sure not to let glue flow into the inside of the switch or it won't function.

Step 7: Procedure to Place Assemble in the Box:

Getting the assembled PCB into the 3D printed box. (I printed my 3D box with PLA+, 0.20 layer height, 100% infill)

Once you have all that you are going to have placed and soldered onto the PCB, except protruding external connectors, you can situate your assembly into the 3D box. 

1. Stick the tail end of the PCB into the box, with the switch near the opening for it and the board at about a 45 degree angle crossing the box (see photos).

2. Manage the switch lever into its hole while straightening the bottom edge of the board to go straight across the box. At this point the USB end will need to be starting to lean down towards its home to be.

3. Lower the USB end into place. Pushing the PCB past place holding nodules on the side walls. While the buttons slide into the opening for them.

4. Tolerances are tight. If in your case too tight, you may have to do some box (or holding nodule) trimming with a fine file or an Exacto knife.

I soldered my LED module on a little crooked and off center, so I had to shave it's board’s outer edge down.

If desired you can remove the insides by reversing the actions. In step 3 you need to press the USB connector away from the side wall and its place holding nodules.

To remove the assembly from the box, Make sure only the on/off switch is protruding through any of the side wall. Press back on the USB connector and tilt it up. 

The red wire, you may notice, by my on/off switch is due to a missing trace on my pre-release PCB. Although, It should be noted that when you do attach the switch with lengths of wire the assembly can be easier.

Step 8: Optional Speaker

The Piezo is fine for beep, boop and buzz game noises, but to be able to identify music notes a speaker does much better. With an optional speaker, for louder and clearer tones, you are advised to have a 10uf (106) capacitor wired in series with it. Further you're advised to glue the edge of the speaker against the inside (~sealed) having drilled ~4 holes of say 3/32” for sound wave propagation out. Opposing speaker holes were 6 or 7 mm apart. Still close enough to be covered by one finger for muting. In support of good low volume operation replace the 150R on the PCB with a 270R.

Initially, I could not find, from eBay, any speakers smaller than 20mm across and thin that would produce much sound. The one in the photo is taken from cheap drug store $9 headphones (not modern in ear canal buds). It is likely 32 ohms which should (due to limited available current) and does do better than the very small 4-8 ohms speakers I tried.

With the optional speaker the sound exits out the bottom, so I added tiny stick on rubber feet.

Step 9: Optional External Pin Connectors

You can attach external pin connectors through the side openings. Noting if ever there is need or desire for disassembly they would have to be detached and removed first.

In the front, I am attaching two 2-pin external connector sockets, one for gnd+Btn1 and one for gnd+Btn4. They will be used to connect hand held buttons for the fast pace two player games. I don’t foresee needing to break out Btn2 & 3.

The lines brought out on the EXT_CONN1 are for what ever added functionality you may desire and dream up.

For “Telekinesis” and “PKE_Meter” as well as some real world randomness input, populate a 1N4001 reverse biased diode next to EXT_CONN1 on the PCB.

For the “Affinity_Meter” to function, you have to provide sensor-connecters for the subject to hold or at least touch. With a Nano build: Bring out GND and A0. This can be done with wires, via plug connectors, or with a 1N4001 providing contacts on the side of the box (see image). With an RP2040 build: As internal pull-ups don’t work well with the ADC lines, you need to attach a 56K resistor between lines A6 & A7 and provide contacts for GND and A6.

I plan to bring out the side, an antenna-sensor made of two wires and a reverse biased diode (1N4001). This is used by the Affinity_Meter & will serve for the PKE_Meter applet, for example. For me, I don’t need other exterior analog connections nor a plug for connect/disconnecting. But if desired one could manage attaching a full set of external pin connectors, for maximum future flexibility.

I am waiting to receive a new 4 button module before finalizing my assembly; as the one I have has crooked buttons and is already worn with perhaps 10,000s of presses.

Step 10: Advanced Build Variations

These PCB boards can lend themselves to a variety of builds; in dimensions and components used. Notably individual LEDs. For an overview of a couple of alternative builds, check out this document: STEM_PCB_3D_builds

Step 11: Compatible Software Suites

Platforms built with these PCBs are compatible with the software in all four of these Instructables:

Mini-STEM-LED-Game-Platform

STEM-Game-Platform-Lesson-Plan

Morse-Code-Trainer

40-Games-for-the-Mini-STEM-LED-Game-Platform


There are three new sketches to go along with these new builds.

STEM_Starter made up of basic functions and games along with outlines for students’ expansion.

Best_Games 20+ of the best inline LED games (just fits into the 32K bytes of Nano’s program storage)

Mega_Games 50+ Games/activities. RP2040 holds them all at once. With the Nano you'll need to pick your favorites.

In these sketches you must ensure that the type MCU build you did is the one described in the non commented section near the top of the hardware platform .h file (e.g. Mini_STEM_Platform.h).

You’ll find functional documentation (manuals, summaries and cheat-sheets) for the games and activities included. BTW: The .odt files are Open Document Text files.

As I can't upload and place .zip files or folders here, keeping the files organized by sketch, I will add a separate step for each and you'll need to download each file individually (of a sketch interesting you) putting them into folders appropriately named.

Step 12: STEM_Starter Sketch Files

This sketch is intended for those who want to develop the skill to create games or applets for use with the mini STEM platform as well as for general educational purposes.

Check out the guideline in "STEM_Game_Primer.odt".

Step 13: Best_Games Sketch Files

This sketch consists of a selection of the "Best" games (~20), all of which will fit into an Arduino Nano (32K program memory). The games were taken from the Mega_Games sketch, with some of them being abridged to reduce memory requirements.

Step 14: Mega_Games Sketch Files

This sketch packs the maximum fun potential into your mini STEM platform, it consists of over 50 games and activities.

When used with an Arduino Nano, an array ('games') of pointers is used to a select games, which can be edited to your liking. Only the games in the array get compiled, and the compiler will let you know if you have selected too much to fit in your MCU.

When used with an RP2040 based mini STEM platform, all the games & activities will be made available !