Go Down

Topic: Question about dc bias while running motors (Read 168 times) previous topic - next topic

nickmac23

May 21, 2019, 05:53 am Last Edit: May 21, 2019, 06:28 am by nickmac23
Hi all!

I am doing a billy bass build as a way to get started with electronics and Arduinos. To do so, I have set up a simple circuit to allow for audio processing from a audio jack. I am using a voltage divider and a capacitor to give the audio signal a 2.5V bias.

When I read the incoming audio signal when no sound is coming through the audio jack, the signal stays pretty constant. 

A problem I am running into is that when ever I run a DC motor while logging the audio, the signal shifts! I want my the audio signal to stay as constant as possible, right at 2.5V. I am assuming the voltage change is due to the DC motor drawing power. Is there a way to negate this effect?

Thanks for you time!

Nick

Grumpy_Mike

Quote
I am assuming the voltage change is due to the DC motor drawing power.
Probably correct.

Quote
Is there a way to negate this effect?
1) Add decoupling to your motor perhaps even the last circuit on this page:- http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html Use a big and small capacitor in parallel. The small one must be of the ceramic type.

2) Route your wiring so the motor power does not flow close to your biasing signal. Better still employ a star wiring system where all the ground wires meet at a single point.

3) Get a power supply that has enough current capacity to cope with your motor.

4) Use a separate power supply for your motor but make sure the ground of this power supply is connected to the ground of your Arduino.

MarkT

I would recommend 4) whatever else you do - don't share power rails between motors and anything handling signals.  Motors put all sorts of spikes and drop-outs onto their power rails, not what is good for audio, digital, etc.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Wawa

#3
May 24, 2019, 02:16 am Last Edit: May 24, 2019, 02:18 am by Wawa
Use the 3.3volt supply as reference (instead of the default 5volt supply).

Connect the 3.3volt pin to the Aref pin AND make sure you set Aref to EXTERNAL in setup().
(failing to do so could destroy Aref).

analogReference(EXTERNAL); // for an Uno

Your mid-voltage divider must now also be connected between 3.3volt and ground.
Rest of the code stays the same, idle is still ~512, but audio sensitivity is now 1.5 times higher.
And hopefully without the influence of the 5volt supply.
Leo..

Edit: Make sure analogue ground (divider etc.) is not shared (breadboard) by other users/devices.

Go Up