Group: http://groups.google.com/group/nycresistormicrocontrollers/topics
- Tilt switch problems [6 Updates]
- tomorrow night at craft night?! (making donation boxes) Re: [NYCR:Microcontrollers] craft night - question [1 Update]
- craft night - question [1 Update]
- source for aluminum bar stock? [1 Update]
Topic: Tilt switch problemsderek enos <derek...@gmail.com> Mar 23 11:56AM -0400 ^
These switches are unfortunately just really noisy.
Assuming that you're trying to detect when the switch closes....
One approach is to unequally debounce the open and closed switch states.
You could impose a greater debounce period on the open state and set each
period to as great a duration as your performance requirements allow.
You could also just debounce the open state, consider the very next switch
closure as valid and ignore additional switch closures until the open state
has once again been fully debounced. This would make the logic very
sensitive to switch closures.
Depending on your performance requirements, there's the chance that no
amount of logic wrangling is going to make this type of switch work for you.
Derek
Dave Clausen <davec...@gmail.com> Mar 23 02:16PM -0400 ^
Sparkfun sells a number of MEMS accelerometers which can be used for
tilt sensing. They are generally much less noisy than the traditional
mass-on-a-spring or mercury switches.
http://www.sparkfun.com/tutorials/167
Or you could try the OSRAM optical switch but it's a leadless surface
mount part that would be a pain to solder, and I suspect it might have
similar noise/oscillation problems like the spring switch you've
already tried.
William Macfarlane <wmac...@gmail.com> Mar 23 02:21PM -0400 ^
You can also potentially smooth out some of the noise by using a bunch
of switches and adding some statistics to your debouncing logic.
--
-Will
www.partsandcrafts.org
Marshall Wilson <li...@wilsonbuilt.com> Mar 23 04:04PM -0400 ^
Thanks guys...
Since I've noticed that the "off" zone is much cleaner than the "on", so perhaps I could combine a few of these ideas - use 2 switches, but turn one around so I'm triggering from a combination of both an "off" signal AND an "on". Don't know how it will work yet, but it just might be the ticket.
m
On Mar 23, 2011, at 2:21 PM, William Macfarlane wrote:
Andy Leviss <an...@ducksecho.com> Mar 23 05:21PM -0400 ^
> Thanks guys...
> Since I've noticed that the "off" zone is much cleaner than the "on", so perhaps I could combine a few of these ideas - use 2 switches, but turn one around so I'm triggering from a combination of both an "off" signal AND an "on". Don't know how it will work yet, but it just might be the ticket.
That could definitely help, but if you want to play a bit with the
single switch and scaling the closed timing vs the open, as a previous
poster suggested, I can give you some example code I've used.
Basically it sets a short debounce time and a longer "safety window".
After the first "closed" passes the short debounce, it uses millis()
to keep track of the time, it will only register a second "closed"
after that safety window has passed. Pretty straightforward in its
most basic form, just adding a variable and an extra if... to the mix.
--Andy
Marshall Wilson <li...@wilsonbuilt.com> Mar 24 01:46AM -0400 ^
I think i have it working now. Just one tilt switch (once i tried it - two really didn't make much sense). My code was a bit messy, but another problem was one of the switches was really quite bad. Once I started using another switch with a cleaner signal, things started working better, even with just a single stage debounce.
Anyway thanks again!
m
On Mar 23, 2011, at 5:21 PM, Andy Leviss wrote:
"o. blaat" <obl...@gmail.com> Mar 23 04:25PM -0400 ^
wow! that's beautiful!
thank you for that!!!
moto, are you gonna be at resistor tomorrow night??!!
i'm planning to show up there (as I'm scheduled to work on Thurs again, I'll
be making it at around 6:30 pm).
hoping that i'll be able to meet with some people including you!
chris said he'll be down there at around 7:30...
keiko
Topic: craft night - questionMoto <ra...@mac.com> Mar 23 04:02PM -0400 ^
Hello,
I have a couple of photos of my donation box below:
(This is just what I've come up with so far...)
http://www.dgtide.com/nycr_donation_box/
Thanks for all your help.
Moto
On Mar 17, 2011, at 9:02 PM, Kristen D Huntley wrote:
Jace van Auken <jac...@gmail.com> Mar 23 12:25PM -0400 ^
--
Alpay,
What about Grainger? They deliver through UPS and are pick up only at Varick
street, so that may not help you. McMaster is what I usually go through.
Somedays it would best if it was set to my home page.
JvA
You received this message because you are subscribed to the Google Groups "NYCResistor:Microcontrollers" group.
To post to this group, send email to nycresistormi...@googlegroups.com.
To unsubscribe from this group, send email to nycresistormicrocon...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nycresistormicrocontrollers?hl=en.