Mcu, opto PC817, relay module, as in the sketch. i think the direct switch from the opto without the nfet/transistor might fitThat's what I was assuming.
Several choices then.
What parts do you have on hand?
Mcu, opto PC817, relay module, as in the sketch. i think the direct switch from the opto without the nfet/transistor might fitThat's what I was assuming.
Several choices then.
What parts do you have on hand?
Won't work, the 40ma is too much for the opto, need a transistor.Mcu, opto PC817, relay module, as in the sketch. i think the direct switch from the opto without the nfet/transistor might fit
Hi Irving, can you please explain why to add any fet/transistor if the direct switch from the opto can work without it and assumming its max 25-30ma relay current (noted max 40ma for pic)?The PC817 opto won't reliably drive 40mA directly, it's max Ic at 25C is recommended at 30mA. Even then you need to go for a C or D quality part to get enough CTR to hope to get to >30mA from a typical GPIO output current of 10 - 15mA (depending on MCU and # of GPIOs in use).
Given we now know it's a relay load a high-side PNP is the cheapest option, the 2N3904 or 2N2222 are a few cents/pence. Even the high-side NPN would be fine here, 11v out would be fine. I'd steer clear of the high-side N-channel, yes it'll probably work with 9v or so output but it's not guaranteed for all combos of MOSFET & relay...
assuming using pc817 as in the link, or other opto with higher ctr, will it deliver 25ma?Won't work, the 40ma is too much for the opto, need a transistor.
A BS250 mosfet or a 2N3906 BJT is recommended.
if reducing the R1 value to 220R instead of 330R(opto led resistor), will it increase the current?Won't work, the 40ma is too much for the opto, need a transistor.
A BS250 mosfet or a 2N3906 BJT is recommended.