Isolating motor feedback from Arduino?? (speaker)

Hey gang-

I finally have my code worked out the way I want.. and it 'seems' to be running great so far..

its more or less a (customized) Arduino & Waveshield board....

I have added a 'motor' to the mix.. for testing.. and it seems to work great as well and how I want it to.. (albeit it might not have enough torque? as its from some kids toy)

I 'do' have this as an alternate motor. (hoping it has more to torque..but the voltage rating is throwing me off on it?.. maybe I should use a vRegulator on it?)

says 1.5v-3v.. but some comments are saying they have been giving it up to 9v even? (wow)..

I have my current motor wired up like this: (and plan to have the other/replacement motor wired up the same way)

Anyways... the question more at hand is...

Whenever I trigger a sound to play.. I also 'jog' the motor... (or if I press & hold the button.. I repeatedly play an audio clip.. and continuously jog/pulse the motor..etc)
However I notice a small whine like a feedback noise over my speaker now????????

After reading previously.. I read there is much 'noise' from a motor when started & stopped.. (which is dangerous when hooking up a motor to Arduino directly)..

As I mentioned I have it wired up as above.. using a transistor, diode, resistor...etc..

What can I do/add to help isolate the motor noise/feedback from the Arduino circuit (dac/amp/speaker)??

Is it the power lines? Do I need to put a cap somewhere? (not sure where)

the second part is maybe locating a better motor? I need it to be small (same size one listed above).. but need to have decent torque on it to spin a tube/turret (gattling gun style)

Could be a number of things, I would try a 0.1 uf capacitor across the motor first.

How much current is the motor drawing, is it driving anything at the moment?

I would think driving a 3volt motor with 7 volts is not a good idea as it would burn out under too much load and damage the transistor.

a 0.1uF cap across the motor... power lines? before or after the diode? (or doesnt it matter?)

How can I check for the draw of my motor? (or any component for that matter?)

It is currently not under ANY load..

which is why I do not believe this motor will work... (current motor is motor from some spinning led wand kid toy)..

the second replacement motor (radioshack one) is only rated at 1.5v-3.v tops. (although comments say people have been driving them @ 9v!!!)
I was thinking maybe trying that one for the torque?.... but should I use a 3.3v vRegulator in there somewhere? (not sure where is should go though) after battery pack toward motor,,,but before the DIODE?

UPDATE:

(hoping I did it right)

so taking my whole circuit above (Arduino as well)..

I unhooked battery +.. connected to + probe on multimeter
took - probe on meter.. and connected it to where I just unhooked the battery + lead from..

powered up/booted.. Im at a constant 61.4 (DCA setting on meter is @ 200m)

(this is without any audio playing...or the motor being jogged/pulsed)

playing a simple audio track (without motor) shows me at around 74 range (tops)

motor with audio shows me at around: (no more than 185 ever).. thats with constant interaction: audio and motor spinning/jogging/pulsing..

thanks

powered up/booted.. Im at a constant 61.4 (DCA setting on meter is @ 200m)

(this is without any audio playing...or the motor being jogged/pulsed)

playing a simple audio track (without motor) shows me at around 74 range (tops)

motor with audio shows me at around: (no more than 185 ever).. thats with constant interaction: audio and motor spinning/jogging/pulsing..

Those look perfectly reasonable figures to me.

Personally I would get two very small value capacitors - say 10 to 100nF - and connect them to the motor. Connect one from the motor + terminal to the body of the motor, and the other from the motor - terminal to the body of the motor.

Yup, current draw looks ok, 100nf = 0.1uf, connect it across the diode, see if that works first.

Thanks guys..

(I'll definately try the cap stuff)..

HOWEVER... it seems as if I had possibly spoke to soon about the cause??

I decided to remove the whole motor portion of the circuit..and try it again.. to see if the 'slight' whine is still present.. (it is)..

I can sorta 'hear' the speaker being ON.. just by powering it on?? not really making a noise... but if I get close.. I can HEAR that is it being powered

(I even removed the volume resistors.... put in a pot.. so I could dial in the volume settings better.. even all the way OFF.. I can still hear the speaker being powered..

when you play/trigger a sound.. its 'almost' as if you here a quick screech right before the sound plays...

Its no REAL bad (per se`) but Im trying to learn and make tweaks to improve it as best as it can be.

any suggestions?? Im new to all this.. so Im not sure where to start researching?

seems maybe some noise/dirty lines somewhere?

Im wondering if the motor IS in fact fine (outside of needing to find a new one with more torque).. and this was there all along?

thanks!!!!

I`ve not used a waveshield, if its a standard board that is widely used with the arduino, then I would search the forum for other people that have had the same problem.

Is it a whine you can hear (high pitch noise) or amplifer hiss( random noise)?

Are you powering the circuit from a battery or from a power unit?

hi-

to be more clear.. its a 'custom' board..

which is basically an Arduino UNO and an Adafruit Waveshield merged together in one board:

compared to Arduino & Waveshield stacked together vs my board:

as far as 'noise'.. Id say it two fold..

1.) I can sorta HEAR the speaker is on.. when the board has power... but I dont believe the volume is up so high to be causing this.. (as there is no distortion of the sound itself when its played)..

the second

2.) when I hit a button to play/trigger a sound to be played... I can hear this brief 'whine/screech' a split second before the sound plays...
its not the actual audio file itself.. as this happens on all clips..

so not sure where this extra noise is coming from?

thanks!!

Does the separate stacked waveshield/arduino make the same noise?

If not, maybe there is a problem with the design of the custom board.

hmmm....

good question!..

I have given back the WaveShield.. (after I was done comparing the volume....... WaveShield is NOT very loud IMHO)..

I'll have to see about borrowing it again.. (or just buying my own! lol)

On a side note...

I have never seen a wave shield in the flesh before, and looking at those pictures I am really really surprised at the choice of DAC on it. It's far from an audio DAC that - it's designed for calibration and precision offset use.

This my first 'venture' into Ardunino & Audio... (so no clue?!) haha

its a MCP4921 or something if I recall off hand..

I had tried a different one previously..

this one:

but it didnt work..
well.... I had the DAC on the SPI bus at first..thinking more than one device could be on the SPI bus..etc..etc.. but it seems the WaveHC lib uses a bitbang method of constantly reading so it can NOT be on the same SPI bus..etc.

(I have 1 or two boards still laying around with that DAC if you have any suggestionso n what to do with them! they still work as basic Arduino.. with a uSD socket on it!!)

for me.. I was to be using (dependent) on the WaveHC library.. so if it only can use or wont play nice with other DACs.. I would have no clue where to start troubleshooting.. so I went back and used more of the same stuff of the WaveShield..

I use those chips (or other ones in the same family) as variable references for ADC chips. Quite useful to be able to set an analog reference of anything between - and 4095mv in 1mv steps. I certainly wouldn't choose them for anything audio (other than for control). I'd prefer to have something with a real audio DAC. And maybe can buffer the audio itself. Something like the dsPIC33FJ128GP802 we used in the Ronin. Maybe I'll design a decent wave shield around that chip one day. It could even read the audio direct from the SD card to both free the Arduino up to do other tasks and give CD quality stereo sound :wink:

... I'll add it to my list ...

I hope that list starts SOON!..

would be nice to free up the Arduino for other tasks!!

I mean right now Im doing ok.. but Im a beginner really.. and just fudge my way through.. learning hardware is my weak point.. (but its going ok.. learned Eagle and started doing my own schematics & .brd file (pcb's made..stencil orders..etc).. all new to me.. but was a fun learning curve.

Software is MORE my strong point.. but not really in C/C++ style programming (used to much more forgiving languages like for web programming..etc)

Would love to see a new/variant waveshield!..

Audio on the Arduino has been too hard for far too long... :wink:

xl97:
I hope that list starts SOON!..

would be nice to free up the Arduino for other tasks!!

Would love to see a new/variant waveshield!..

Audio on the Arduino has been too hard for far too long... :wink:

Well, my initial tests show it is perfectly possible.

I have taken a prototype Ronin board, and wired in an SD card adapter to it. A days's worth tinkering with firmware, and I have it playing CD quality WAV files direct from the SD. The SPI interface to it is also working, but kind of sparse at the moment - many more commands to be added for interacting with the SD card - and who knows, I might even add a line in socket and get some form of recording direct to the SD card going...

Then it's on to designing a real board for it.

I might have this actually made and ready to sell before you know it...

sounds good!.. lol

I would split the recording and playing into separate libs.. (to keep things small for those that dont require that aspect)..

very similar to the WaveHC and WaveRP libs..

I'll have to read up more about this: dsPIC33FJ128GP802

xl97:
sounds good!.. lol

I would split the recording and playing into separate libs.. (to keep things small for those that dont require that aspect)..

very similar to the WaveHC and WaveRP libs..

I'll have to read up more about this: dsPIC33FJ128GP802

No need - the Arduino side of it is incredibly small and lightweight. It just sends some SPI commands to the shield to tell it what to do. Thinks like play, stop, etc. The Arduino doesn't even need to know what a wave file is.

ahh.. thats right.. you using another chip to do all the leg work (I forgot)..
its just a PIC chip you are using?

dsPIC33FJ128GP802?

(havent googled it yet)

also are you focusing on making a SHIELD? or an 'all-in-one' type board? with Arduino/SD/Audio components all onboard?

for myself.. I needed a super small footprint, so I had to make everything SMD.. and merge the two boards so I dint have an Arduino & shield stacked on top....etc..

alot of fun for me.. first time with stencil, solder paste, Eagle.. and a toaster oven! lol

xl97:
ahh.. thats right.. you using another chip to do all the leg work (I forgot)..
its just a PIC chip you are using?

dsPIC33FJ128GP802?

(havent googled it yet)

Yep, it's a PIC - but not "just" a PIC. One with a built in 16-bit audio DAC, and a Digital Signal Processor.

also are you focusing on making a SHIELD? or an 'all-in-one' type board? with Arduino/SD/Audio components all onboard?

Yes, a shield is what I am making. Of course, the PIC firmware will be open source, so you could theoretically run it without even having an Arduino if you wanted.

for myself.. I needed a super small footprint, so I had to make everything SMD.. and merge the two boards so I dint have an Arduino & shield stacked on top....etc..

alot of fun for me.. first time with stencil, solder paste, Eagle.. and a toaster oven! lol

Yep, that's what I have here :wink: I call mine the "Hot Tamale".

Well, I think we can call this thread well and truly hijacked now :wink:

Anyway,

Here's my first prototype of my WavePro Shield:

I must say, it's sounding nice. There's a bit of hiss from the DAC (it's not a wonderful DAC in this chip, but it's good enough), and some slight buzz from the SPI comms (I haven't yet been able to suppress it - I think it might be inside the chip), but it's a darn sight better than the old Wave Shield.

It plays mono or stereo WAV files at 8,000Hz, 11,025Hz, 16,000Hz, 22,050Hz, 32,000Hz, 44,100Hz and 48,000Hz. It can also just about cope with mono at 96,000Hz, but not well.

My next job I think is to try and get some form of recording working.

WaveProPrototype.jpg