Wiring assistance, combining VS1053, Accelerometer and LED Strip
Moderators: adafruit_support_bill, adafruit

Re: Wiring assistance, combining VS1053, Accelerometer and LED Strip

by adafruit_support_bill on Sun Aug 11, 2013 3:19 pm

Awesome! This is one for the blog :D
User avatar
adafruit_support_bill
 
Posts: 30796
Joined: Sat Feb 07, 2009 10:11 am

Re: Wiring assistance, combining VS1053, Accelerometer and LED Strip

by joshuakane on Sun Aug 11, 2013 4:37 pm

Hey Bill,

I would love to do this, I have been documenting the whole process, and I would be more than willing to share it all, as well as the final code and any other information folks would find helpful. You all have been super helpful, and supportive during this project, and several others I have undertaken in the past few months.

I had another question about using the ADXL335.
http://www.adafruit.com/products/163

I have it attached to the Arduino Micro, and I loaded up the calibration sketch. I can see that the motion is registered, but what I can't figure out is how to translate this into some sort of return, or threshold to trigger an event. What I want to do is have the soundboard trigger a "Slashing" sound when the sword is moved in any direction in a deliberate fashion.

The full function I am trying to accomplish is a sound on start-up, sounds on motion, which all look highly possible reading the VS1053 documentation.

The other question I have is if it is possible to trigger a sound on shut-down, I am not sure if this is possible, or how I could best trigger a sound on both start-up and shutdown. would it be possible if the unit was powered, but start-up and shutdown were triggered by a button push such as from a toggle or maybe one of your push button breakout boards such as this one?

http://www.adafruit.com/blog/2013/06/07/new-product-adafruit-push-button-power-switch-breakout/

Thanks,

Joshua
User avatar
joshuakane
 
Posts: 174
Joined: Sat Apr 13, 2013 4:40 pm

Re: Wiring assistance, combining VS1053, Accelerometer and LED Strip

by adafruit_support_bill on Sun Aug 11, 2013 8:44 pm

We periodically feature projects from the Adafruit community in our blog & I've forwarded your photos & video to Matt, our community support guy.

What I want to do is have the soundboard trigger a "Slashing" sound when the sword is moved in any direction in a deliberate fashion.

The accelerometer will register an acceleration at the onset of the slashing motion and a deceleration at the end. You could use an acceleration in the axis perpendicular to the leading edge of the sword to trigger the sound. A gyro will register a rotation for the duration of the slash and could be used to control the duration of the sound.

how I could best trigger a sound on both start-up and shutdown.

Start-up is easy. Just play the sound from your setup(). Shutdown is a little trickier, but the push-button power breakout should handle it. You can have a button to trigger the sound, then write to an output pin to switch off power via the 'kill' pin on the breakout.
User avatar
adafruit_support_bill
 
Posts: 30796
Joined: Sat Feb 07, 2009 10:11 am

Re: Wiring assistance, combining VS1053, Accelerometer and LED Strip

by joshuakane on Mon Aug 12, 2013 8:37 pm

Thanks BIll,

The accelerometer will register an acceleration at the onset of the slashing motion and a deceleration at the end. You could use an acceleration in the axis perpendicular to the leading edge of the sword to trigger the sound. A gyro will register a rotation for the duration of the slash and could be used to control the duration of the sound.


Is there any sample code for the ADXL?

I don't really care what direction or the duration is, it will trigger a single "slash" sound. So I want to trigger it off any/all motion that is more than a turn or slight movement of the wrist. I saw there was some code with the sparkle skirt, but I did not know if that would also apply to the ADXL.

Start-up is easy. Just play the sound from your setup(). Shutdown is a little trickier, but the push-button power breakout should handle it. You can have a button to trigger the sound, then write to an output pin to switch off power via the 'kill' pin on the breakout.


Are you saying that the breakout could be used for power on, and to trigger power off, I have a second button, an "off" button that triggers the sound, and a shutdown of the lights, and then "Kills" the power via the Kill pin on the breakout?

Thanks,

Joshua
User avatar
joshuakane
 
Posts: 174
Joined: Sat Apr 13, 2013 4:40 pm

Re: Wiring assistance, combining VS1053, Accelerometer and LED Strip

by adafruit_support_bill on Tue Aug 13, 2013 5:49 am

The sparkle skirt code is for a different accelerometer so reading the 3 axis is different, but the movement calculations would be similar.
I want to trigger it off any/all motion that is more than a turn or slight movement of the wrist.

The accelerometer will give you 2 peak readings: Once when the sword starts to move and again when it decelerates to a stop. During the middle part of the slash, it will not be accelerating. If you don't care about direction or magnitude, you will not be able to tell the difference between the start of a motion and the end of a motion.

Are you saying that the breakout could be used for power on, and to trigger power off, I have a second button, an "off" button that triggers the sound, and a shutdown of the lights, and then "Kills" the power via the Kill pin on the breakout?

Yes. That should work.
User avatar
adafruit_support_bill
 
Posts: 30796
Joined: Sat Feb 07, 2009 10:11 am