Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By btidey
#81691 4n25 is an optocoupler so not suitable for driving a dc motor. You need either a bipolar transistor or Mosfet.

Motor.jpg


Shows both methods. A diode should be placed across the motor to absorb any voltage spike when the motor is turned off.

It sounds like the motor is quite small so any bipolar transistor like a bc547 would work in that method. I prefer to use Mosfets as good devices will give very low voltage drop when turned on, but you need to use ones with low gate threshold so they turn on with the 3.3V from a GPIO.
You do not have the required permissions to view the files attached to this post.
User avatar
By AdeLast
#82925
btidey wrote:4n25 is an optocoupler so not suitable for driving a dc motor. You need either a bipolar transistor or Mosfet.

Motor.jpg


Shows both methods. A diode should be placed across the motor to absorb any voltage spike when the motor is turned off.

It sounds like the motor is quite small so any bipolar transistor like a bc547 would work in that method. I prefer to use Mosfets as good devices will give very low voltage drop when turned on, but you need to use ones with low gate threshold so they turn on with the 3.3V from a GPIO.


Hi and thank you for your reply. I have finally received some Mosfets, model irlz44n. I am not able to make the things work like I would like to. If I connect this Mosfet with the ESP8266 and the motor I can just decrease or increase the speed but the motor keeps running and running.

Any suggestion?