Trying to figure out 3.3v relay board schematic

I beeped out my current board and im trying to replicate them for a custom pcb for a project.

I can’t figure out which component D1 and Q1 are.

D1 says M7
Q1 says JY3

Also for the led will any surface mount red led work?

I think D1 may be a 1n4007
Q1 may be a BF517? Could be way wrong

Thank you for any info or if I have done this wrong.

I don't know why this is necessary when there are zillions of relay board schematics available online.

Also, FYI, use the "Attachments and other options" drop down menu below to upload photos

The simplest way of driving a relay is use an Avalanche rated N-Channel logic level FET with enough current capability to operate the relay coil. Hook up is simple: Connect one side of the relay to the + supply connect the other side of the relay to the drain of the mosfet, connect the source of the mosfet to ground and the gate either directly to the micro pin or put a resistor in series with the gate preferably less then 50 ohms. When they tell you that you have to use a flyback diode or whatever ignore it, the fet is designed to operate without one. The flyback when the fet is in the circuit will be give or take a little about -2 Volts. You can find the UIS (Unclamped Inductive Spike) capability in the data sheet, and if it more then the solenoid load it is ok. Check this data sheet: https://www.vishay.com/docs/91017/91017.pdf Remember when an inductor is switched off the polarity reverses and the voltage will rise until quenched. Use any led you like do not forget the current limiting resistor. You can connect it directly to the MOSFET if you want.
Good Luck & Have Fun!
Gil

OK, this may be better:

Slythy:
D1 says M7
Q1 says JY3

Surface mount shorthand! There are decoder sites but it is pretty irrelevant. :grinning:

Slythy:
Also for the led will any surface mount red led work?

Pretty much!

Slythy:
I think D1 may be a 1N4007

Perfect! Or a 1N4001, EM404 etc. etc. Even a 1N914 will be fine.

Slythy:
Q1 may be a BF517? Could be way wrong

Don't know. Don't care. If it is a general-purpose NPN transistor with as many volts rating at least twice your supply voltage and current rating greater than 300 mA, (5 V relay about 70 mA) it will be just perfect. :astonished:

Relay Drivers do not need opto couplers.

A simple transistor and 2 resistors, diode, relay is all that is needed to drive a relay from a GPIO pin. It has been done this way since the 1960's and I'll bet there are countless numbers relays sitting critical military and medical gear that have no need for an optocoupler in a relay driver circuit.

(Ok, I'll admit... if you are an online electronics module SELLER and you are going to carry a module that works in VARIED situations... you would use that somewhat convoluted "flexible" design shown above so you avoid people saying "your board doesn't work". In a specific solution, however, just use the parts that you need.... meaning the "design" that meets your specific needs.)

Yes, I know that is a 5V design and it lacks the resistor from Base to GND. But it IS a working design.

Paul__B:
Don't know. Don't care. If it is a general-purpose NPN transistor with as many volts rating at least twice your supply voltage and current rating greater than 300 mA, (5 V relay about 70 mA) it will be just perfect. :astonished:

Thanks so much for your help!

I was on my phone and it wasnt uploading the image so I just tried the code but it looks like it didnt work.

Thanks for going into the explanation of the Transistor, I honestly don't know much about how to utilize of spec them.

So looking at them on mouser, will NSVBC817-16LT1G work?

Also are those resistor values good on a 3.3v circuit? I dont know how those change with Vin?

If i wanted to change led colors to Blue Green Red and Yellow do i need to change R1?

pwillard:
Yes, I know that is a 5V design and it lacks the resistor from Base to GND. But it IS a working design.

Thanks That looks a ton simpler!

If you are driving the optocoupler version from 3.3 V logic, the combined voltage drop of the optocoupler (1.2 V) and a green LED (2.1 V) equals the logic voltage itself, so you need to connect the "Vcc" feeding the optocoupler LED from your 5 V supply, not 3.3 V in order to make it work.

Such a resistor is only necessary for use with a FET, not a BJT. :+1: