Sensor Expansion board - use switches to change patterns?

I will be creating a 20W x 40H SK9822 matrix (progressive wiring) wrapped around a vertical tube…I need to be able to change patterns based upon external events…

Until I saw the PixelBlaze site, my implementation was using Arduino Nano 33 IoT for patterns (8 ea.), which would be switched via logic-level inputs from another device to the Arduino (4 ea.), or dry contacts from a remote controlled wireless relay pack (4 ea.)…

If I were to use a PixelBlaze to create the patterns, could I use a Sensor Expansion board to accept signals for pattern change (at least 4 of them)? I see that the PixelBlaze has a button, but it requires presses to change. I also see there is an Arduino I/F board, but it would be going the wrong way.


Regards, Frank

Hi Frank!

First, I just want to see if I understand what you want to do correctly. Do you want to use a combination of multiple external switches (or remote-controlled relays) to set which pattern is active (e.g. the state of 4 switches selecting one of 16 patterns)? Or was it that there are 4 independent sensors/switches/events and when any is activated, it should advance the pattern to the next one? Or were you saying you want to wire up a switch to advance through 4 different patterns, but the problem is the switch isn’t momentary like the built-in button is?

I’m thinking that all are possible without tapping into the extra IO of the sensor expansion board, but I’d like to understand a little more before I recommend an approach.

There are a total of 5 GPIO inputs and 1 ADC input accessible on Pixelblaze v2+, and the first one (GPIO0) is pre-connected to a momentary pushbutton. Temporary presses will advance the active pattern, and long presses activate WiFi setup mode, which limits GPIO0’s overall applications for general purpose input.

The other four GPIO pins are exposed via pads on the underside and can be read as high or low within patterns. Since you’re driving SK9822s, you’ll have access to all 4 (with WS28xxs, one of these GPIOs is reserved for driving them) So, if you wanted to select a specific pattern based on events or the combined states of these four inputs, you could write the code for several patterns all within one pattern and select which one is rendering based on the results of the four digitalRead()s. In this way you can code closer to what you probably would be doing on an Arduino, such as detecting states, edges or debouncing.

The time when I would then incorporate the expansion board is when I need the 5 additional ADCs, which can also be used to read high/low logic level inputs.

I didn’t follow exactly how the various quantities of Teensies were being connected to various inputs, but if you can say a little more about the specific sensor/switch inputs and their desired effect on pattern selection, I’m sure we can figure something out to help you!

Take care,

Jeff -

Thanks for the attention!

I guess I was a bit vague in initial post… :woozy_face:

I fly high-power model rockets…you can see typical at my web site

Normally of course, we launch during the day…our club here in San Diego has a big annual event, in addition to monthly launches, where special projects are encouraged…I decided to build a rocket for night flying - there is a requirement that they must be lit, so we can see them and be safe (particularly on its way down! :nerd_face:)…

So, the lower section (booster) of the rocket (the bulge) will have a clear 36" Lexan tube…inside the tube will be another “carrier” tube with 20 strips of 40 SK9822 LEDs applied around it’s perimeter, creating a 20W x 40H matrix when the rocket is sitting vertical on the pad awaiting launch…

I plan to have different patterns (scrolls, pulses, whatever) displayed on the matrix when: the rocket launches, when it reaches apogee, when I deploy the main recovery chute, and when it lands, so it will be easier to see for recovery (sometimes the rockets land well away from the site due to flight character and/or wind)…those 4 signals will come via a flight computer/altimeter - they provide switched GND, so will pull an input low on the Arduino Nano 33 IoT, ro ESP32, or, the PixelBlaze…

Prior to launch, while the rocket is sitting on the launch pad, I would like to display interesting/fun patterns for the crowd - rainbow, confetti, etc…thought there are lots of “examples” out there, after seeing how much “trouble” it is to create novel matrix patterns (I am new to the LED matrix deal), I stumbled across the PixelBlaze and thought it would be perfect for the pre-flight patterns…

The flight computer will control launch/in-flight triggers as described above…for the pre-flight stuff, I found a wireless (433 MHz), garage door type remote controller that has 4 channels of relays - that way I can play with what’s displaying during pre-flight away from the flight-ready rocket…

So, in short, 8 patterns, each separately triggered by switched GND…currently, plan is to use Arduino/C++ case-type logic reacting to the triggers to matrix-display via FastLED, NeoMatrix, Adafruit GFX…

Now that you described available inputs on the PixelBlaze/Sensor Expander, it appears I could do this with the PixelBlaze rather than my Arduino, once I get a better handle on the programming side of the web tool, right?

Thanks again for replying, Frank

This is so cool.

I gladly volunteer to do anything from give directional advice, to virtual mentoring / code review, to coding custom patterns for your project.

Now that I understand what you’re doing, I’ll suggest that you could skip the garage door remote, and just select various pre-launch patterns right from your phone. Before you travel to the field, you’ll push and hold the button to reconfigure it into a WiFi access point. Join the network it creates on your phone, load up, and pick from all your custom pre-launch patterns on your phone (or set the sequencer so it auto-advances every x seconds). I choreographed my low budget fireworks show in exactly this way, just tapping the pattern names from my phone’s web browser.

It’ll be important then that you 1) disable the sequencer and 2) select your flight mode pattern before arming.

Your flight mode pattern would listen for the (1? 4?) input(s) from the flight computer to go low and activate each progressive mode from within that one pattern. Now that I know your application there are two possible advantages to the sensor expansion. If countdowns are loud affairs, you could make it sound reactive to everyone yelling countdown numbers. Second, you could maximize energy efficiency by only lighting the sides and top LEDs for recovery assistance, saving battery by keeping the bottom dark.

I really think Pixelblaze is the perfect platform for this, especially once you experience the shortened iteration cycle time. I’ll gladly map your cylindrical matrix for you as well, which is a common challenge for first timers. I assume from your description this is a vertical zig-zag wiring scheme.

Let me know how I can help! I’m an aero enthusiast, was once a GA pilot, and have built around 20 model rockets ranging up to G engines. I’d love to contribute.



Hi Jeff,

Yeah, it has been/should be fun…still waiting on the carrier tube in order to build the matrix (cylindrical) - seems to have gotten lost in the USPS system (no surprise of late!)…in DotStar parlance, it will be DS_MATRIX_TOP+DS_MATRIX_LEFT+DS_MATRIX_COLUMNS+DS_MATRIX_PROGRESSIVE …

The Nano 33 IoT also has WiFi and I have considered that, but my experience so far suggests rather limited range (<200’) for the embedded antenna WiFi modules, so I probably will stick to the other gizmo - it seems to range well beyond 200’…I would like to be able to be at the LCO table with the rocket on the pad and ready to launch…motor will most likely be a K, so need some distance…not elegant, but doesn’t consume much space or power…will test however and see how the Pixelblaze does…

I too am a pilot, though I have not flown in many years…only a couple hundred VFR hours…

I have ordered the Pixelblaze and an Expander, so, once they show up and I get a chance to acquaint myself a bit, I will reach out to you…I really appreciate your off to help, Jeff, and I expect I may need a bunch before this is over! I look forward to this new learning curve (always the best part for me!)…

Best regards, Frank

1 Like