Building a TWANG32

ESP32 Programming

The first step is to program your ESP32. The kit I sell on Tindie requires the use of the NodeMCU-32s. It needs to match this footprint and pinout. Note: Some version of my kits include a pre-programmed ESP32.

Arduino IDE Setup

You need to compile and upload the firmware using the Arduino IDE. Get the latest version here. You need to add some additional software.

  • Install Arduino Core for ESP32. This gets the files require to program an ESP32 There are instructions here.
  • Install FastLED Library. The FastLED library is used to control the LED strip. Go to this page and download the latest version as a zip file. In the Arduino IDE select the SketchInclude LibraryAdd Zip Library. Then select the zip file you just downloaded.
  • Install RunningMedian Library: This library is used to filter (reduce noise) the accelerometer sensor using a 5 point median filter. You can get the library here.
  • Download the TWANG32 Sketch Source files. All of the files should be placed in a folder called TWANG32.

Programming

Open the TWANG32.ino sketch in the Arduino IDE you will see this near the beginning of the file…

// what type of LED Strip....uncomment only one
#define USE_APA102
//#define USE_NEOPIXEL

You need to uncomment (remove //) in front of the line for the strip type you have. In the case above the program will compile for the APA102 type strips. Make sure only one of the #define lines is uncommented.

Open the settings.h file in the same folder as TWANG32.ino. Change the #define NUM_LEDS  144 to the LED count you plan to use. This sets the default number of LEDs in your strip.

Next to the following steps to compile and upload the firmware. This could take several minutes to compile.

  • Under the ToolsBoards menu, select the NodeMCU-32S board
  • Connect the ESP32 to your computer.
  • Select the correct com port from the ToolsPort menu.
  • Click on the Upload button.

Install the ESP32 in the PCB.

The ESP32 should be installed with the USB connector aligned with the edge of the PCB. See the image below.

Print the plastic parts

The STL files are here. If you don’t have a printed, reply in the comments and I can get you some for a reasonable price.

All of the files can be printed in high speed mode. No fine details are required. They can all be printed with no support, except for the cover which has a small pocket on the bed side. I use PLA with 2 perimeters and 20% in fill. All of the screws self tap into the plastic.

Note: I made a recent change to eliminate the use of hot glue, some of the pictures are from earlier versions.

Attach the Adhesive Rubber Feet to the Chassis.

Attach the feet into the pockets on the bottom of the chassis.

Install the PCB into the chassis.

The PCB mounts directly on the bosses on the bottom of the chassis. Use flat head M3 x 12mm screw installed inserted the chassis bottom, through the PCB and into M3 x 12mm plastic spacers. Spacers are easier to use than nuts because they are easier to hold during installation.

Assemble Joystick.

Place clamp ring over door spring. It is important to do this first because it is difficult to do later. Next screw on the the lower part of the knob.

Slide the accelerometer module wires through the lower knob and spring. Push the accelerometer module into the pocket. I have recently made changes to remove the need for hot glue. This uses M3 x 10mm (button or pan head) to hold on the cap. I use a little piece of anti-static foam (in kits) to hold the MPU-6050 accelerometer module down. If you don’t have the foam use 2 dots of hot glue in the corners with the mounting holes.

 

Attach the cap. Align the hollow arrow side of the cap with the little notch at the top of the lower knob. This hollow arrow will show you which side points forward in a later step.

Attach the metal cap to the bottom of the spring. This cap allows the spring end to sit flat on the cover. It should be screwed on about as much as shown in the image.

Attach the joystick to the cover. Make sure the hollow arrow is pointed forward (the closer edge). Before it is fully tightened twang it a few times. This will relax  the spring so you can see if it still points forward. Do this a few times and adjust to make sure it points forward. It does not need to be perfect… +/- a few degrees is OK.

Attach the speaker using M3 x 10mm screws.  If you angle the wires a little, it makes the wiring a little easier later.

 

Attach the LED cable. Your LED strip should have come with a mating connector. Some types have 3 wires and some have 4. Mate it to the LED strip. See what colors do what functions by looking at the strip labels. The strips have an arrow pointing the ways go from zero up.  Most strips have connectors on both ends. Us the connector on the base of arrow side.

All LED strips should have a + and -. These could be labeled 5V and Gnd. Do not rely on the traditional red+ and black- wire coloring. The strips are often not wired that way. Attach the wires to the terminal block. I like to add a cable tie behind the wall to act as a strain relief. I also label my wires, but you need a heat shrink printer for that.

Attach the rest of the wires from the cover. Attach the speaker connector and the accelerometer wires.

Attach the cover.

At this point you should be able to power up and play.

 

 

 

 

 

 

 

 

 

 

 

 

 

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Yahoo! Buzz
  • Twitter
  • Google Bookmarks
  1. No Comments

*