I got an idea for a completely useless project. I want to do it not only for kicks and giggles, but also to expand my knowledge. Basically, I want gloves that play a punching sound and light up a ring of red LEDs around the wrist when I throw a punch.
I've already found the mp3 player shield and files needed to play the punching sound, but how do I go about programming an accelerometer to detect the sudden stopping of my hand-which would signify me punching?
Also, what if I were to add in a tilt sensor or something, and added a ring of green led's, so that way I could make a kind of 'blocking' position with my hands and it would play a different sound, or maybe I could use a magnet on one glove and a hall sensor on the other to detect when the two are together, thus giving the arduino the message that I'm blocking.
Ideas and suggestions are welcome.
Basically, you can practice a martial arts technics wearing accelerometr on your wrists or ancles. Arduino would compare and report how close you to your master (of course, master has to record a punch first, into arduino EEPROM).
How exactly does that work? Does the movement have to be exactly like what you program into it, or can it have variation? I'd like to go for something other than gesture recognition, so anybody who puts it on can use it right away.
Does the movement have to be exactly like what you program into it, or can it have variation?
Exactly, movement has to be very close to template written initially, it's the point. Degree of resemblance you may vary, default level is set to 50% for all three axes.
If you need something more simple, look at first code linked at the page (there are two links):
if ((abs(temp) > trigger) && (!capture) && (!process))
{
capture = 1;
n_sampl = 0;
nb_Cycl = 0;
for ( uint8_t y = 0; y < CHANNELS; y++) sm_Dcm[y] = 0;
digitalWrite( 13, HIGH);
}
You can shrink it down to :
if (abs(temp) > trigger)
{
digitalWrite( 13, HIGH);
}
Changing the value of trigger variable, you can adjust a sensitivity level. Create a new sketch than add up Timer1_Set() and ISR(TIMER1_COMPB_vect) with a text above posted fragment. Or remove whatever you don't need in the original source file, though I think 'd be easier to start from new one.
The ADXL345 (and others I presume) can trigger an interrupt when a set level of acceleration or decceleration (same thing in a different direction) is breached. This should be able to sense an arrested punch or kick and trigger an interrupt which plays the sound.