Confusion with a Circuit for a Project

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
DeDMeaT
 
Posts: 8
Joined: Fri Apr 04, 2014 2:48 pm

Confusion with a Circuit for a Project

Post by DeDMeaT »

Hi Guys,

I've recently only started delving into this world of Electronic Magic! :D so please forgive me if this may appear as a dumb post.
I'm currently working on a small project which involves the use of a Trinket 5V & 2 pieces of the NeoPixel Stick. I require these LEDs to only come on when a lid is closed. I intend on placing this switch on the lid so when the lid closes the switch is being held in its ON state which will complete the circuit causing the LEDs to stay on. The switch needs to be relatively small as well.
What would be the best solution & type of small switch to perform this function. Do i wire it up so that i have this switch directly controlling the power running to the Trinket & NeoPixel Sticks? (i.e lid is closed -> switch held in ON state -> power runs to Trinket -> powers up the NeoPixel Sticks until lid is opened again)

Also would a Trinket be able to control a pair of NeoPixel Sticks? & what would be the best compact/wearable/portable lithium Battery solution to power this whole circuit?
I'm really looking to feedback regarding whether i have the right idea or if there's a better solution that you guys could recommend.
Please forgive my Noobiness! Thanks again

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

Re: Confusion with a Circuit for a Project

Post by adafruit_support_bill »

For switches, there are a lot of options. We have several styles of microswitches, as well as tilt switches and magnetic reed switches. Another very compact possibility is a Hall sensor and magnet. The choice mostly comes down to what is most easily integrated into your box:
https://www.adafruit.com/search?q=switch&b=1

Using a mechanical switch, you could have the switch power the circuit only when closed. Using a hall-sensor, you would need the Trinket to be powered full-time so it could monitor the switch.

A Trinket can handle the 16 pixels on the sticks no problem. Power could come from a 3xAAA battery pack (4.5v) or a LiPo. If you go the LiPo route, you may want to switch to the 3.3v trinket.

DeDMeaT
 
Posts: 8
Joined: Fri Apr 04, 2014 2:48 pm

Re: Confusion with a Circuit for a Project

Post by DeDMeaT »

Thanks for the speedy reply!

The hall sensor sounds interesting as I am using Rare Earth magnets to a metal plate/shim as the latch mechanism. The idea is to conserve power so the mechanical micro switch seems like the better option. I just don't know which one to get/use. Is there a way to get the "6mm tactile button switch" to work for my project or are they solely used as "reset" switches? Worst case is that I try to make those micro switches with the lever & actuator fit on the lid.
I'm assuming i'll also have to power the NeoPixel Sticks directly from the Batteries as well?
can I control each NeoPixel Stick from a separate pin (PWM or regular digital) or must both be connected on the same single pin?
I also noticed that the NeoPixel Sticks have 2 GND pins. Does one GND have to run to the Trinket while the other runs to the battery or is safe just using the GND coming from the battery/Power Source.

Again sorry for the million noobish questions. I just don't want to blow anything up! hahahahahaha

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

Re: Confusion with a Circuit for a Project

Post by adafruit_support_bill »

The hall sensor sounds interesting as I am using Rare Earth magnets to a metal plate/shim as the latch mechanism. The idea is to conserve power so the mechanical micro switch seems like the better option.
The magnetic reed switch is sort of the mechanical equivalent of the hall sensor. It should work with your rare-earth magnets, and you might be able to remove the reed switch itself from that plastic housing.
I'm assuming i'll also have to power the NeoPixel Sticks directly from the Batteries as well? can I control each NeoPixel Stick from a separate pin (PWM or regular digital) or must both be connected on the same single pin?
They are all connected via a single pin. But since they are digitally addressable, you can control each one individually.
Does one GND have to run to the Trinket while the other runs to the battery or is safe just using the GND coming from the battery/Power Source.
The best way is to run the power and GND directly to the neopixels, then run wires from there back to the Trinket.

DeDMeaT
 
Posts: 8
Joined: Fri Apr 04, 2014 2:48 pm

Re: Confusion with a Circuit for a Project

Post by DeDMeaT »

Bill You're a Legend! Thanks for taking the time to answer my questions:)

I'll sit & work on the Schematic drawing on fritzing. I'll upload it when i'm done & you can tell me if it looks correct or not.
I'd really appreciate the help! Thanks again!

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

Re: Confusion with a Circuit for a Project

Post by adafruit_support_bill »

No problem! That's what we're here for.

DeDMeaT
 
Posts: 8
Joined: Fri Apr 04, 2014 2:48 pm

Re: Confusion with a Circuit for a Project

Post by DeDMeaT »

Hey Bill!

I couldn't find the Neopixel 8 Stick in the Adafruit Fritzing Library. So i kicked it back to old school & reverted to sketches.
I've decided to go with the Reed Switch as you suggested. Please take a look at my diagram & let me know it its set up correctly.
If not can you tell me what needs to be changed.
IMAG0983.jpg
IMAG0983.jpg (770.9 KiB) Viewed 339 times

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

Re: Confusion with a Circuit for a Project

Post by adafruit_support_bill »

That looks like it should work. Let us know how it goes.

DeDMeaT
 
Posts: 8
Joined: Fri Apr 04, 2014 2:48 pm

Re: Confusion with a Circuit for a Project

Post by DeDMeaT »

Ok another possible dumb question. Can i run one Neopixel Stick on one Pin (pin X for eg) & the second NeoPixel Stick on the a different Pin (pin Y for eg) on the Trinket. Would this work or must i run it DOUT -> DIN between the two sticks? My physical layout & placement of the NeoPixel Sticks kinda makes it difficult/messy to DOUT -> DIN cable all the way around the case.

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

Re: Confusion with a Circuit for a Project

Post by adafruit_support_bill »

You can run 2 sticks on 2 separate pins.

DeDMeaT
 
Posts: 8
Joined: Fri Apr 04, 2014 2:48 pm

Re: Confusion with a Circuit for a Project

Post by DeDMeaT »

Dude Life Saver. I'm so impressed with the support! Really!

I'll post pics of my project when it's done!

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

Return to “General Project help”