A question came up on IRC regarding how to PWM a 3-pin PC fan with an Arduino using analogWrite(). Controlling the fan was seemingly straightforward. The problem was that the hall effect sensor, or TACH signal, was incredibly noisy. The noise made it impossible to measure the fan’s rotation. Working through the question, I found three issues to tackle:
You need to use a PNP transistor
Filter capacitors help
Create a non-blocking RPM measurement (with millis())
This post addresses all three issues regarding how to PWM a 3-pin PC fan with an Arduino.
Continue Reading »
How a Brushed DC Motor works and how to use them
This Addohms Electronics Motor Tutorial goes into the third dimension. Using a 3D model, we show what makes a brushed DC motor, well, a “brushed motor.” (Hint: It’s the brushes!) Then, as usual, we break down two simple ways to control them with a microcontroller like the Arduino. You can use a single BJT Transistor (remember those from #10?), build a discrete H-Bridge to go in both directions, or use a popular H-Bridge chip like the L293D or L298D. (Notice the ‘D’!)
The video starts with a couple of (mixed) motor examples. Do you know what a “stator” or “rotor” is? If not, that’s okay because that’s one of the first things we explain. After that, we add part like the commutator and brushes to make the Brushed DC Motor. After that is control with a transistor and an explosive reason you need a protection diode. 🙂 Then we show how an H-Bridge Works. Lastly, the advantages and disadvantages of this motor type.