Adding buttons and a potentiometer to the sensor expansion board

I want to add a couple of buttons (to trigger changing patterns back and forward) and a potentiometer (to control brightness) to the expansion board. This will be mounted in a little controller box hard-wired to the PixelBlaze itself (which is installed in an inaccessible pocket in my wearable.)

Are the inputs on the expansion board pulled high or low by default, and can this be changed? I.e., should I ground the pins when the button is actuated or pull them to 5V? I can’t find where this is covered in the manual, if it is indeed.

Any other tips and tricks for doing this hardware- or software-wise? I know I’m going to have to modify all the patterns I use to get the brightness control to work, but that’s a copy-and-paste job as far as I’m aware.

The Sensor Board analog inputs are analog inputs, and do not pull high or low. They “float” and have a high impedance. You can use an external resistor to pull it high or low for use with a button. They are also 3.3V only, do not give them 5V, instead use the filtered low-noise 3.3V supply on the same header for best results. This is especially important for a potentiometer to reduce noise on the reading.

Then you can convert the analog to a digital boolean value by comparing it with a threshold. For example:

isPressed = analogInputs[0] > 0.5 //assuming a pull-down, with the button connecting it to 3.3V

FWIW, I have a similar set up, and opted to run 4 wires so that I can run the button pin signal to a button near a sensor board with a pot and some other controls. In all, I have GND, 3.3V from the exp header, data from the sensor board, and the button signal.


Ah, sorry, yes of course I misspoke, I meant pulling them up to the positive rail which is 3.3V in this case.

Can you suggest a reasonable pull-down resistor value?

Anything around 1k-100k should do it.

1 Like