Pages: [1]   Go Down
Author Topic: Swing Detection using tilt switches  (Read 1383 times)
0 Members and 1 Guest are viewing this topic.
Wisconsin
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Reference: http://arduino.cc/forum/index.php/topic,48819.0.html

Been thinking about that referenced old thread for the last few days, this afternoon I drew up the diagram below.  Idea being to make a toy sword circuit that can reliably detect swinging motions and not be confused when the sword simply tilted in one direction or another.

I have done this project in the past with an accelerometer, worked really well.  Problem being that accelerometer prices keep going up.  I went to buy an accelerometer last weekend and found my chip of choice increased to over $20, yikes.  Is a little much for a 1cm square.


swing_motions by thatdecade, on Flickr

Ok, so swing detection occurs on double state changes that occur in under X time.  Double state changes can be defined as a single switch changing twice or either switch changing once.  Additionally, like mentioned in that thread I would need some debouncing so I would throw out any swing events that were detected below Y time.

I am thinking 300ms for X and 50ms for Y.  Am going to buy a big bag of tilt sensors soon and test out my theory.
Logged

0
Offline Offline
Faraday Member
**
Karma: 16
Posts: 2857
ruggedcircuits.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I have done this project in the past with an accelerometer, worked really well.  Problem being that accelerometer prices keep going up.  I went to buy an accelerometer last weekend and found my chip of choice increased to over $20, yikes.

You may be chasing a "dinosaur". When chips go obsolete their prices tend to rise, this is a sign that something better/faster/cheaper has come out and there's really no reason to stick with that chip. For example, an MMA7660 accelerometer is only about $1. Would that work?

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons
Logged

Wisconsin
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Probably, but I am not interested in accelerometers right now.  I know it is not as accurate as an accelerometer, but I really want to see this tilt switch concept work.
Logged

Wisconsin
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Came up with a testing rig.  What I'm seeing is a double state change on both inputs, which I find interesting and unexpected.  My sketches above didn't take into account the stopping forces at the end of a swing.

The current rig has too much noise. I need to cut the wiring on all but two tilt switches and gather data from each angle XY pair individually.


Picture from before I finished all the wiring.

« Last Edit: June 07, 2011, 07:10:55 pm by thatdecade » Logged

Pages: [1]   Go Up
Jump to: