Building a circuit that controlls the speed of a dc fan with sound using atmega328p and op amps

hello, i want to build a circuit that controlls the speed of a dc fan with sound using atmega328p and op amps, and i don't know from where to start , i have some questions :
.how to design the circuit ?
.which mic to use ?
.which op amps to use ?
can someone help me if you can, thank you in advance.

Depends, to some extent, how much experience you already have of writing Arduino code, and your general hardware experience. Can you tell us a little about your experience?
If you are a beginner, then I suggest starting with how to get sound into the Arduino, before you consider the motor control part. Google for "how to get sound from microphone into arduino". That assumes you want to get sound from a microphone, you didn't say.

1 Like

yes i am a beginner , i need help in designing the circuit and yes i want to use microphone with active filters (op amps).
about my experience : i designed simple circuits before using atmega328p or ne555.

Work on reading the input (microphone) and output (motor speed) separately.

The easiest thing for sound is to use a microphone board (AKA "sound sensor") which will have a preamp built-in.

There are also ways of reading an electrical audio signal if you don't want it to react to actual sounds in the room.

There are (at least) 4 kinds of microphone boards or some that have these features combined:

The one I linked to has analog audio out (like would go to an audio amplifier, etc.). The analog output is biased, which the Arduino needs because its ADC can't directly read the negative half of the audio waveform. The Arduino's analog input (ADC) can read it. I have the one that I linked to above. It's not very sensitive so the sound has to be rather loud, and there is no adjustment.

There are microphone boards with digital audio out and those need a software library to read.

There are some that put-out a variable DC voltage depending on loudness. If you just need loudness, these are easier than reading the waveform.

Some have a one/zero digital output and pot that adjusts the threshold. When the sound level is below the threshold it puts-out a logic-zero and a one if louder than the threshold. It can be read with a digital input.

You can run the Analog Read Serial Example to "see" your analog readings. (Take-out the delay)

Here is a MOSFET motor driver circuit. It can be used with analogWrite() (which is PWM rather than true analog) to control the speed of a motor.

If you need to know-control the exact speed of the motor you'll need a speed sensor and the software for that.

2 Likes

what are these called and does it need a op amp to work ? because i need to use op amps for this project.

Why? Is it a school project and you have been told you must use op amps?

That’s my assumption…

yes

If you are required to use an op-amp you should have already studied op-amp circuits...

Here is the schematic for the SparkFun microphone board.

It supplies power for an electret microphone (like most computer mics) and it has a biased-output.

Dynamic mics don't need power so you could eliminate R1 and power to the mic. (Dynamic mics are "weaker" and need about 20dB more gain.)

You can change the gain by changing the feedback resistor (R5).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.