I am currently doing a simple uni project where i want the distance read by an ultrasonic sensor to control the speed of a dc 5v fan. I have attached a schematic of how i think i can link the ultrasonic sensor and fan components in order to achieve my main goal. Please tell me if this circuit is right or wrong and give some helpful feedback, thank you!

enter image description here

1 Answer 1


It's wrong.

A fan is a motor. A motor is a power hungry inductive device.

Just like any other motor or similar device (such as a relay or solenoid) you cannot drive it directly from the Arduino. Instead you need (at the very least) a transistor to switch a higher current and a diode to absorb back EMF.

  • Thank you for telling me it was wrong. Would like to know where i could possibly plop this transistor and diode. May 6, 2017 at 14:01
  • 1
    The same way as you would for any other inductive device such as a relay (like I am sure I mentioned). There's a billion and one tutorials telling you how (and that's not an overstatement).
    – Majenko
    May 6, 2017 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.