0

EMC2101 3-Wire Fan Control
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

EMC2101 3-Wire Fan Control

by pshanesmith on Tue Aug 03, 2021 4:58 am

I would like to control a 3-wire fan. I was looking into the DAC mode for the EMC2101. I can't find any examples. I'm not sure what a control circuit (adjusting fan voltage between 0-12VDC). would look like. I've been searching around and haven't found a good example.

As an alternative, I tried driving the fan with a PWM signal and an N-channel MOSFET and it works. The tach signal gets messed up. I'd really like to monitor fan speed, so I'm trying to go with a linear control option for this fan.

pshanesmith
 
Posts: 19
Joined: Fri Apr 02, 2021 9:46 pm

Re: EMC2101 3-Wire Fan Control

by adafruit_support_mike on Wed Aug 04, 2021 8:46 pm

DAC mode is an output value for the fan speed signal. Instead of measuring the duty cycle of the PWM output, you’d read the voltage with one of your microcontroller’s ADC pins.

The output voltage range is 0V to a little less than 3.3V, with 6-bit resolution.. basically 64 different values.

adafruit_support_mike
 
Posts: 63716
Joined: Thu Feb 11, 2010 2:51 pm

Re: EMC2101 3-Wire Fan Control

by pshanesmith on Sun Aug 08, 2021 2:56 am

Thanks Mike. I'm trying to figure out how to utilize that DAC signal to control fan speed. For example, I have a 12V fan. I need to adjust the voltage of that fan using the DAC. That's what I'm trying to figure out.

pshanesmith
 
Posts: 19
Joined: Fri Apr 02, 2021 9:46 pm

Re: EMC2101 3-Wire Fan Control

by adafruit_support_bill on Sun Aug 08, 2021 6:35 am

The ADC output is a control signal, not a drive voltage. It varies between 0 and 3.3v with a maximum current of 1mA. You still need some fan drive circuitry to convert that low-current control signal into something that drives your fan. '

Check your fan specifications. Most computer fans use brushless motors with integral drive circuitry. If it is not designed for an analog control signal, you may need a different fan.

adafruit_support_bill
 
Posts: 81941
Joined: Sat Feb 07, 2009 10:11 am

Re: EMC2101 3-Wire Fan Control

by pshanesmith on Sun Aug 08, 2021 9:58 am

Thanks Bill. I realize I'm venturing into territory that isn't really directly a product support question. The fan is indeed intended to be driven with an analog signal. It's a 3-wire fan. It will technically work with PWM, but that prevents the tach from working properly. Is there any chance you have any pointers for the circuit the DAC would drive to adjust the voltage of the fan (the fan drive circuitry you mentioned)? I've been searching all over. I've seen some references to using an adjustable linear voltage regulator. I've also seen some mentions of using an op amp. I haven't been able to find any decent circuit diagrams.

pshanesmith
 
Posts: 19
Joined: Fri Apr 02, 2021 9:46 pm

Re: EMC2101 3-Wire Fan Control

by adafruit_support_bill on Sun Aug 08, 2021 10:38 am

If your fan takes a 0v-12v analog control signal, you probably want a non-inverting op-amp circuit with a gain of about 3.6 (12v / 3.3v). The gain for the circuit below would be 1 + (R2 / R1). Mike is more of an analog expert and may be able to suggest some specific component options.

Image

adafruit_support_bill
 
Posts: 81941
Joined: Sat Feb 07, 2009 10:11 am

Re: EMC2101 3-Wire Fan Control

by pshanesmith on Mon Aug 09, 2021 5:34 pm

Mike, got any ideas on this one?

I was thinking about the DAC output going to a MOSFET in an attempt to use it as a variable resistor. I'm not sure if that would work or if the noise from that would likely impact the tach signal as well.

I did test the signal quality of the tach when using a pot on the fan supply and it worked well. I need to find some way to have the DAC output from the EMC2101 control the voltage going to the fan.

Thanks for the help, folks!

pshanesmith
 
Posts: 19
Joined: Fri Apr 02, 2021 9:46 pm

Re: EMC2101 3-Wire Fan Control

by adafruit_support_mike on Tue Aug 10, 2021 4:25 pm

Bill's circuit is a good one.

I like the MCP6001/2/4 series of op amps for simple jobs. They're rail to rail mosfet-input amps with low input current (~10pA), 1MHz gain-bandwidth product, and around 1.5mV input-offset error.

In human language, that means they're good signal buffers because they don't pull current from the signal source, the gain stays above 100 for signals slower than 10kHz, and the non-inverting circuit above would have maybe 6mV of error due to imperfections in the op amp. That isn't bad when you consider the error from the tolerance of 1% resistors in the feedback divider.

A 27k-10k voltage divider will work for the feedback network, and would give you a nominal gain of about 3.7.. enough tp get 12V output from a 3.3V input.

I'd suggest adding a 1uF capacitor in parallel with the 27k to keep the output from getting noisy. Any circuit with gain and feedback can oscillate, and usually will in the least convenient way. The capacitor will limit frequencies higher than about 20Hz, which should be enough for quick adjustments while keeping the output stable.

adafruit_support_mike
 
Posts: 63716
Joined: Thu Feb 11, 2010 2:51 pm

Re: EMC2101 3-Wire Fan Control

by pshanesmith on Tue Aug 10, 2021 10:58 pm

Mike,

Thanks for the detailed response. I really appreciate it! Do you happen to have any reference circuit diagrams or have any recommendations for reference design information.

If this is overreaching, please say so. Again, thanks for the help!

pshanesmith
 
Posts: 19
Joined: Fri Apr 02, 2021 9:46 pm

Re: EMC2101 3-Wire Fan Control

by adafruit_support_mike on Wed Aug 11, 2021 1:46 pm

There are thousands of articles and books about op amps, at all levels of detail.

Analog Devices has a good introduction here:

https://wiki.analog.com/university/cour ... ronics-toc

and their "Op Amp Applications" is a classic:

https://www.analog.com/en/education/edu ... dbook.html

They also host the uber-classic "Philbrick Applications Manual for Computing Amplifiers for Modeling, Measuring, Manipulating, and Much Else":

https://www.analog.com/en/education/edu ... fiers.html

It was written in 1966 and the content holds up well today. It even takes a bit of searching to find modern op amps whose specs are as good as the ones Philbrick made in the 1950s.

adafruit_support_mike
 
Posts: 63716
Joined: Thu Feb 11, 2010 2:51 pm

Re: EMC2101 3-Wire Fan Control

by pshanesmith on Wed Aug 11, 2021 4:07 pm

Thanks so much, Mike! This is amazing. You made my day!

pshanesmith
 
Posts: 19
Joined: Fri Apr 02, 2021 9:46 pm

Re: EMC2101 3-Wire Fan Control

by pshanesmith on Wed Aug 11, 2021 11:25 pm

After looking into this more the documentation for the EMC2101 states that fans are not to be driven off of the DAC output. That seems to make a single input amplifier a non-starter. Perhaps I'm misinterpreting.

For additionally clarity.
I need to increase voltage from 0-12V proportionally to the voltage increase from 0V-3.3V (the DAC output). My project include a 12V power source (AC to 12VDC) and a 3.3V power source (Raspberry Pi).

pshanesmith
 
Posts: 19
Joined: Fri Apr 02, 2021 9:46 pm

Re: EMC2101 3-Wire Fan Control

by pshanesmith on Thu Aug 12, 2021 12:15 am

Image

How about something like this?

pshanesmith
 
Posts: 19
Joined: Fri Apr 02, 2021 9:46 pm

Re: EMC2101 3-Wire Fan Control

by adafruit_support_mike on Thu Aug 12, 2021 8:55 pm

pshanesmith wrote:After looking into this more the documentation for the EMC2101 states that fans are not to be driven off of the DAC output. That seems to make a single input amplifier a non-starter. Perhaps I'm misinterpreting.

It depends on the fan you use.

3-pin and 4-pin computer fans use a control signal that’s independent of the power that actually drives the motor. That way you can generate PWM with a microcontroller and not worry about adding switches to control the motor itself.. those switches are already built into the motor.

Most computer fans use PWM because it’s efficient and easy to generate. Some will also accept a DC voltage so you can control the fan with a potentiometer or something similar.

With 2-pin fans you have to control the motor power yourself. You can use either PWM or a DC voltage for that.

The circuit above meets the requirements you’ve stated: it amplifies a 0V-to-3.3V signal to 0V-to-12V, and can handle enough power to run the motor.

I’d use a different circuit though. The problerm is that there’s no guarantee the fan will run when the voltage across it is 0.5V, or that the motor speed will change in proportion to the voltage.

Here’s what I’d do:

motor-control.jpg
motor-control.jpg (30.44 KiB) Viewed 35 times

Instead of controlling the voltage this circuit controls the current. That has a more predictable relationship to the motor’s speed.

The op amp works to keep the voltage across Rs the same as the voltage at it’s positive input. The current through Rs is proportional to the voltage across it, so you end up with direct linear control of the motor current. The value of Rs also controls the amount of motor current per volt at the positive input.

All of the motor current also flows through Rs, and will generate heat. In most cases, you want to keep the voltage across Rs low to reduce that heat. If Rs is 1 Ohm, 330mV at the op amp’s positive inout would give you 330mA of motor current. If Rs is 0.1 Ohm, the same 330mV at the positive input would give you 3.3A of motor current.

Ra and Rb scale the DC contol voltage down to a level that works for a current-sense resistor. Instead of amplifying the voltage, you’re scaling it down to make Rs work efficiently.

Since you can choose the values if all three resistors, you have lots of flexibility to choose the maximum voltage across Rs and the maximum current through the motor.

adafruit_support_mike
 
Posts: 63716
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.