Click, go advanced, select manage attachments, click add files and click select files. Find the fie you want to attach, click open, then upload files and click insert attachment.
I'll post some screenshots if you have trouble.
By the way, use PNG or GIF, for schematics, not fuzzy JPG.
Here's where simulators in the wrong hands can be dangerous.
You don't need R2.
Connect it up like this.
It only worked before because the transistor was short circuiting the relay causing R2 to get very hot.
You'll need to reverse the signal applied to the MOSFET, before turning the MOSFET on, turned the relay off, not turning the MOSFET on, turns the relay on.
EDIT:
I got the diode the wrong way round. I've corrected it for you.
There also needs to be a current limiting resistor in series with the LED.
I like to use it,but I have only 5mA current.
do you know optocouplers work by 5mA properly?
i read MCT2E datasheet.
what does "pin 6(base)" work??
do you have any driver circuit for thisIC?
i want to use it in industrial field.
our circuit isn't good.
perhaps people want to use this circuit for another objects like instruments ,sensors, etc.
it will be better to have 1 wire for 24VDC and 1 wire for GND.
I like to use it,but I have only 5mA current.
do you know optocouplers work by 5mA properly?
i read MCT2E datasheet.
what does "pin 6(base)" work??
do you have any driver circuit for thisIC?
It doesn't work by 5mA.
because it need 40mA minimum to run optodiode.
can we work around transistor circuits?
I think,it is better to focus 1 target.
I need only 1 wire in outlet for 24VDC and 1 wire for GND.
I labelled both transistors as Tr1, which I've now corrected.
It's not critical.
Tr1 can be any PNP transistor rated to 30V and 300mA or more, e.g. BC327.
Tr2 is any NPN transistor with a voltage rating of at least 30V, e.g. BC548.
R2 needs to be rated to at least 0.4W
The diode is not important, 1N4148, 1N914 or 1N4001 will do.