hi guys,
i am working on a personal project that goes something like this:
an Arduino Uno powers a small plunger-style solenoid at a regular interval (~1 sec currently). The dwell time for the applied power is currently ~7ms, so I'm really shooting for an impulse as opposed to holding the solenoid extended for a long period of time.
also attached to the arduino is the sparkfun sound detector board (SparkFun Sound Detector - SEN-12642 - SparkFun Electronics) ...
the sound board and the solenoid are now hooked up just fine, all operational -- my questions are now turning to the software side. I want to have the sound board detect the impulse response of the solenoid strike on a surface. i've checked the performance out with simply reading the analog pins and I see now why you need to delve into the actual ADC of the microprocessor. fair enough.
however, I'm a little confused about how to effectively deal with firing the solenoid and holding it for the dwell time, while running the adc the whole time. i've only used interrupts in a basic sense before, so this project is a little more complex than I'm used to.
as a side note, how would the teensy boards simplify things for me from an implementation standpoint? I am liking the specs compared to the arduinos for this type of system.
Thanks!
nd I see now why you need to delve into the actual ADC of the microprocessor. fair enough.
I don't see why?
An A/D conversion takes about 0.1mS, this will give you roughly 70 A/D conversion cycles for your hold time.
Simply fire the solenoid, take 70 readings ( or so ) and store them in a buffer, then remove the firing signal.
so if I turn the arduino on, 'out of the box' with default what does that sampling frequency turn out to be? 0.1ms is the ~9600Hz number I see referenced in the literature? I was getting caught up with free running mode and other settings.
if that's the case, then I guess it probably would give me enough frequency content to do what I'm doing, I'm mostly interested in low/mid frequencies and 4300Hz should get me that.
now, if I wanted to then have a gyro or accelerometer (or some other analog conversion) added, the sampling rate would have to decrease to compensate, right?
so if I turn the arduino on, 'out of the box' with default what does that sampling frequency turn out to be?
0.1ms
the sampling rate would have to decrease to compensate, right?
Well not quite. If you are sampling two things you still sample at the same rate only each thing is sampled at half the rate.
In the free running mode you can do "other stuff" while the conversion is going on, if you need to.
interesting point about the multiplexed adc using two pins... the audio board has two analog outs, the "audio" signal and an envelope signal (i don't recall the algorithm they use to derive that) but I should probably go ahead and disconnect the envelope signal if I'm not going to use it.