Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Installing a Switch
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Installing a Switch

by BijanA on Mon Apr 27, 2020 6:30 pm

I have a Trinket M0 attached to a 16 LED NeoPixel. GND, 3V, D0 (Trinket M0) are connected to Ground, Power, Data-In (NeoPixel).

I have a SPST that goes between the 3V output on Trinket and Power Input on NeoPixel. The circuit is fine when the switch is in the on position, but when I turn it off, I get an error message in serial console that "You are in safe mode: something unanticipated happened. The microcontroller's power dipped."

The Trinket is plugged in via Micro-USB to the wall so I don't mind if the switch just turns off the LEDs or the entire Trinket but what is the best way to wire the switch to this?

BijanA
 
Posts: 4
Joined: Wed Mar 18, 2015 2:26 am

Re: Installing a Switch

by dastels on Mon Apr 27, 2020 8:04 pm

The Propmaker Wing does something similar. https://cdn-learn.adafruit.com/assets/assets/000/069/243/original/adafruit_products_Prop_Maker_FeatherWing_Sch.png?1547249389. See the power/enable circuit in the top left.

The bounce in a mechanical switch may be causing the problem as the current demands from the strip will jitter. Using that circuit with a debounced switch should work.

Hmm... you might try adding a moderately sized capacitor (maybe 1 microFarad... you could start there and experiment) to the Trinket side of the switch.

Dave

dastels
 
Posts: 3023
Joined: Tue Oct 20, 2015 3:22 pm

Please be positive and constructive with your questions and comments.