0
\$\begingroup\$

I need to control a 12v relay with an Arduino nano ESP32.

Can somebody check if the circuit I designed is good?

Components list:

  • MOSFET: 2N7000 (N-channel);
  • Optocoupler: PC817;
  • Diode: 1N4007;
  • Relay: 40.31.7.012.0000 (coil needs 42mA @ 12V);
  • Resistors.

This is the circuit I designed: (Updated version below in comments) Designed circuit

Thank you in advance.

Cheers, Paolo :)


Thank you guys! Here an update of the schematics: New schematics 4

Cheers, Paolo

\$\endgroup\$
3
  • \$\begingroup\$ D2 will not light \$\endgroup\$
    – jsotola
    Commented Jul 12 at 20:29
  • \$\begingroup\$ Good for what? Please be specific on the areas you want checked \$\endgroup\$
    – Voltage Spike
    Commented Jul 12 at 20:40
  • 3
    \$\begingroup\$ Are your two GNDs really separate? \$\endgroup\$
    – winny
    Commented Jul 12 at 21:01

3 Answers 3

1
\$\begingroup\$

Looks okay, except D2 is backwards. It would be better graphically to show it in parallel with D1, the downward arrow for a positive voltage is against convention.

I think I'd like to see a bit more margin on the CTR to account for aging and temperature, maybe increase the 10kΩ to 20kΩ.

I'm not sure what your intention is with the two GND symbols having the same net name, that would tend to short them together, and I presume your intention is to isolate them with the PC817.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ You are right. The intent is to separate the GNDs, but I'll change the name of the two ! Thx \$\endgroup\$
    – PaoloRos
    Commented Jul 13 at 3:00
0
\$\begingroup\$

D2 will never light. If it should works as "ON" indicator you have to swap its direction. Current to PC817 IR LED will be about (3.3-1.0)/1k8=1.28mA. In worst case current transfer ration of PC817 can be as low as 50% and therefore collector current can theoreticaly be as low as 0.64mA. It creates voltage about 6.4V on R1 which is enought to fully open 2N7000. Except for LED D2 it looks like OK.

\$\endgroup\$
0
\$\begingroup\$

U1 is redundant; simply choose a MOSFET suitable for logic-level drive. BSS123 is a typical choice, or shop around for others with suitable ratings, including whatever current the relay coil needs. Parts rated for Vds >= 20V and Vgs(on) = 3.3V (or even lower) are available.

You may also want a snubber (R+C or MOV) on the contacts, to suppress sparking and EFT. This is a common cause of MCU reset and data corruption issues, in lieu of proper layout and connector filtering/protection. Or even with.

\$\endgroup\$

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.