why does my rocker switch only work when put on voltage leg?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- zackboston
- Posts: 129
- Joined: Mon Feb 25, 2013 12:47 pm
why does my rocker switch only work when put on voltage leg?
I usually put my switches inline between the ground wire on the neopixel and the ground pin on the trinket. This time, the youth wanted a rocker switch instead of the usual slide switch. When we installed the rocker switch in line between the ground on the neopixel strip and the ground pin on the trinket, the neopixels lit up correctly when the switch was on. However when the switch was turned off, the neopixels did not turn off. Instead, a random dim selection of neopixels lit up in different colors. It never turned off.
I know the code is OK because I've used it a million times and it usually works well with a slide switch.
I got curious and rewired the rocker switch in line with the voltage pins on the neopixels and the trinket. It worked PERFECTLY with this configuration.
However, i don't know WHY it worked and I want to be able to explain this to the youth teachers.
Can you help me understand?
With great respect and love (the only truly sustainable and renewable source of energy in the universe),
susan
education organizer, learn 2 teach, teach 2 learn, boston
- Franklin97355
- Posts: 23912
- Joined: Mon Apr 21, 2008 2:33 pm
Re: why does my rocker switch only work when put on voltage
The only reason I can think of is that the rocker switch is noisy and confusing either the Trinket or the neopixel. Can you post a schematic of your circuit to clarify you wiring?
- zackboston
- Posts: 129
- Joined: Mon Feb 25, 2013 12:47 pm
Re: why does my rocker switch only work when put on voltage
Things I tried:
Multimeter connectivity on the rocker switch showed it was OK.
Thought it might be a faulty switch anyway, so I replaced it with a new one inline on the ground wire. Same results.
Got curious so I put rocket switch inline with the voltage and it worked perfectly.
But WHY?!!!! So mysterious.
Maybe there is stray ground somewhere?
Maybe the rocket switch is cheap and "leaky? with a lower resistance than it should have when it's "Off"
(I did not multimeter the resistance on the rocket switch when I was troubleshooting)
Any possible explanations would be so welcome. . . This one stumped me.
- adafruit_support_bill
- Posts: 88098
- Joined: Sat Feb 07, 2009 10:11 am
Re: why does my rocker switch only work when put on voltage
Most likely there is some leakage current back to ground through the signal pin.
We generally recommend that the ground always be the first thing connected and the last thing disconnected to avoid damage to the pixels. Current generation Neopixel chips are a bit more tolerant than the originals. But the chip specifications still reference all limit conditions to ground. https://learn.adafruit.com/adafruit-neo ... -practices
The safest way to turn off the pixels would be to wire your switch between ground and a digital pin on the Trinket. Then write a little code to read the state of the pin and send the appropriate commands to the pixels.
We generally recommend that the ground always be the first thing connected and the last thing disconnected to avoid damage to the pixels. Current generation Neopixel chips are a bit more tolerant than the originals. But the chip specifications still reference all limit conditions to ground. https://learn.adafruit.com/adafruit-neo ... -practices
The safest way to turn off the pixels would be to wire your switch between ground and a digital pin on the Trinket. Then write a little code to read the state of the pin and send the appropriate commands to the pixels.
- zackboston
- Posts: 129
- Joined: Mon Feb 25, 2013 12:47 pm
Re: why does my rocker switch only work when put on voltage
Oh Thank YOU!!! That helps a LOT!!!
Please be positive and constructive with your questions and comments.