Optical sensor to turn on/off mosfet schematic?

See attached image. I would like to have it so that when the optical sensor slot is blocked, the mosfet turns off and stops a motor (J1). When it's unblocked, the motor is on. I've already also added a reverse diode as well as you can see. Assume that U$1 switch is always closed.

  1. Is my circuit correct? I think I am supposed to use an N channel mosfet?
  2. My motor is 5V 70mA, what mosfet ratings should I look for? Mosfets are really confusing to me and I read a bunch of tutorials already.

You need a current limiting resistor on the opto coupler led.
Then find a tutorial, say “using a transistor as a switch” and decide if the motor is to be switched on the high side or the low side. You can use a logic level mosfet instead of a transistor here, once it is clear whether it should be P or N channel, that is.

Hi,
This circuit would suit you,


The MOSFET will need to be a logic level MOSFET to ensure the MOSFET turns ON properly.

Tom... :slight_smile:

At 70 mA you can also use a small NPN transistor... Have a look of what's in your parts bin, see what fits the bill.

TomGeorge:
Hi,
This circuit would suit you,


The MOSFET will need to be a logic level MOSFET to ensure the MOSFET turns ON properly.

Tom... :slight_smile:

Thank you Tom! So would it be an N type or P type mosfet? Also, what ratings should I look for in a mosfet? Also, are those the values you recommend for resistors?

shai:
Thank you Tom! So would it be an N type or P type mosfet?

N-channel.

Also, what ratings should I look for in a mosfet?

Current: must be able to handle your load (70 mA means just about any will do).
Logic level: look for an "on resistance" for VGS{/sub] = 4.5V or lower. If that's not given in the datasheet, it's not on properly at 5V.
Common MOSFETs used with Arduino are the IRL540 and IRLZ44N. Both will do the job but are serious overkill. I'd just grab a BC547 for a motor this small :slight_smile:

wvmarle:
N-channel.
Current: must be able to handle your load (70 mA means just about any will do).
Logic level: look for an "on resistance" for VGS{/sub] = 4.5V or lower. If that's not given in the datasheet, it's not on properly at 5V.
Common MOSFETs used with Arduino are the IRL540 and IRLZ44N. Both will do the job but are serious overkill. I'd just grab a BC547 for a motor this small :slight_smile:
[/quote]
Sorry, but VGS matches multiple filters on Digikey and based on tutorials I've seen, there's more to a mosfet than just one variable that needs to be chosen properly. Can you be more specific please?

You're looking to switch a 70 mA load. All that really matters is that the MOSFET has a logic level gate. Don't overthink it. Or just use one of the types suggested, they'll do the job just fine.

HI,
Do you have a DMM to measure circuit parameters?

Thanks..Tom.. :slight_smile: