Go Down

Topic: Arduino bass vibration motor control (Read 120 times) previous topic - next topic

MrNik17

Hello anyone knows how to control a vibration motor with an Arduino via the 3.5mm AUX plug. By that, I mean that the vibration motor is activated with lower frequency sounds, (power delivery is still from a 5V source, Arduino has to just activate the motor when there is a lower frequency). Is the Arduino even necessary or is it possible to have a hardwired circuit. Is it also possible to control the speed of the motor when lower frequencies are quieter or louder?

DangerToMyself

Posting multiple threads asking the same question is called cross-posting and is not allowed. Trust me, it won't help you.

DVDdoug

#2
Oct 09, 2019, 08:20 pm Last Edit: Oct 09, 2019, 08:22 pm by DVDdoug
You'll need a low-pass filter into an Arduino analog input.   

A simple RC filter may work or you may need an active filter (made with an op-amp). 

Or, there is a handy little chip called the MSGEQ7 that gives you 7 frequency bands (and you could use just the lowest band).   It also gives you a DC voltage so you don't have to bias the audio signal.

Or, there are FFT & FHT libraries that can get the frequency information with software.

No filter is perfect (hardware or software) and a simple RC filter will allow more higher-frequencies through, so that's something you'll have to experiment with.

You'll also need to bias the input (2 equal-value resistors and a capacitor).    The Arduino can't read the negative half of the AC audio waveform.  It can actually be damaged by negative voltages and/or the audio signal can be "damaged" (distorted).    Biasing takes care of that, and you can subtract-out the bias in software or otherwise deal with it in software.

Quote
Is the Arduino even necessary or is it possible to have a hardwired circuit.
The logic is simple enough that you don't need a programmable microcontroller.   A microcontroller is probably "easier" as a hobby project, but that kind-of depends on if you are better at hardware or software.   

Quote
Is it also possible to control the speed of the motor when lower frequencies are quieter or louder?
Yes.  You can use PWM with a MOSFET driver to control the speed of a DC motor.   You can find lots of examples of motor-speed control.

You "connect" the input (audio) with the output (motor) with software.   I always recommend working on the input & output separately (hardware and software) before putting everything together.

Here is a simple example of blinking an LED with audio.   Some of that code may be useful to you, and there is an attached bias circuit schematic.   It uses a 20-second average to get a reference so it can automatically adjust to volume changes.   

You could  use two analog inputs to "compare" the bass to the overall volume and that might  help to prevent false triggers.




Go Up