why does my rocker switch only work when put on voltage leg?

This is a special forum devoted to educators using Adafruit and Arduino products for teaching.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
zackboston
 
Posts: 129
Joined: Mon Feb 25, 2013 12:47 pm

why does my rocker switch only work when put on voltage leg?

Post by zackboston »

maxresdefault.jpeg
maxresdefault.jpeg (75.11 KiB) Viewed 2129 times
I was helping a youth teacher in my STEAM program wire up a rocker switch for his under lit etched acrylic lamp that is a simpler version like this. We were using a 5V trinket with a 6 neopixel strip powered by a microUSB.

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

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: why does my rocker switch only work when put on voltage

Post by Franklin97355 »

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?

User avatar
zackboston
 
Posts: 129
Joined: Mon Feb 25, 2013 12:47 pm

Re: why does my rocker switch only work when put on voltage

Post by zackboston »

Screen Shot 2021-08-14 at 5.46.28 AM.png
Screen Shot 2021-08-14 at 5.46.28 AM.png (184.68 KiB) Viewed 2111 times
Thank you. It's not a rocket science circuit. Smile.

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.

User avatar
adafruit_support_bill
 
Posts: 88087
Joined: Sat Feb 07, 2009 10:11 am

Re: why does my rocker switch only work when put on voltage

Post by adafruit_support_bill »

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.

User avatar
zackboston
 
Posts: 129
Joined: Mon Feb 25, 2013 12:47 pm

Re: why does my rocker switch only work when put on voltage

Post by zackboston »

Oh Thank YOU!!! That helps a LOT!!!

Locked
Please be positive and constructive with your questions and comments.

Return to “For Educators”