Internal of 817 module, and output Vcc

Thread Starter

gray-b

Joined Aug 4, 2025
87
I think I have ascertained that the following is internal of an 817 module from aliexpress etc.

opto817-module-20251107_185329.jpg

resized-817-module-20251107_183201.jpg

That is 3k '302' resistor and an LED on the input side, and a 3k '302' resistor on the output side.

But where do I apply Vcc 12v and get an output voltage?

I can understand if the 3k resistor was on the outside, or do I add another one. Not seen any schematic like it thou.

I am not sure ?? Any guidance please.
 

sghioto

Joined Dec 31, 2017
8,633
Not the best design for sure.
I suppose the two 3K resistors are there to limit input and output currents so not to damage the chip.
However that severely limits the input current with a 3.3 volt input.
1762558672247.png
To get voltage out the jumper must be removed like shown below.
1762558797428.png
Problem is the voltage might be much less then 12 volts depending on the load resistance on the +OUT line
What exactly will the +OUT be connected to?
 

Thread Starter

gray-b

Joined Aug 4, 2025
87
Is this going to work ? Any thoughts.

Remove or short out the internal 3k resistor on the collector and add a 3k between the emitter and earth. This should give me the right logic output that I want.

But is the collector 3k really required? I do not mind, as Vout would give me something like 5 or 6 volts, which is well within the minimum 3.5V for a logic 1.

Output current is not a worry, as only feeding an AND gate.

I am only trying to convert 3.3v to 12v using components that are already on my pcb.

20251108_162354.jpg
 

Thread Starter

gray-b

Joined Aug 4, 2025
87
I can understand my problem a bit more now, after breadboarding it. Inputting a 3.3v signal into pin1 only gives a very faint glow of the inbuilt led (in series with the 3k resistor). I got no change to the Vout of the transistor.

From what I can now gather is that the 3k resistor is selected for a 12v Vin supply. That resistor value has to drop in using a 3.3v Vin supply. Working it all out it is border line with no resistor or at the very least a 50 ohm resistor. Even then it would not work reliably.

So it looks like using a PC817 is out the window.

I could use a transistor inbetween Vin and the PC817, but....

But as I have a spare inverter chip on the pcb, I will have a go at using 2 of them, to keep the logic values the same. As 3.3v is within logic 1 voltage range parameters, and it should give me near 12v out of the 2nd inverter.
 

sghioto

Joined Dec 31, 2017
8,633
So it looks like using a PC817 is out the window.
The main purpose of using an optocoupler is to provide isolation between two circuits that don't share a common ground.
What you need is called a level shifter, raising the 3.3 volt to 12 volts. or high enough to provide a logic 1 at the AND gate.
Using the inverter chips is fine if as you say a 3.3 volt input is within a logic 1.
 

Thread Starter

gray-b

Joined Aug 4, 2025
87
Yes and it works with inverters, but in a strange way.

I have to use 3 inverters CD4069 at 12v Vcc. The 1st one changes 3.3v to 5v (no idea why just yet), the 2nd inverts the 5v to 0v, then the 3rd inverts the 0v to 12v. And it seems quite reliable.
 

sghioto

Joined Dec 31, 2017
8,633
Yes and it works with inverters, but in a strange way.
I have to use 3 inverters CD4069 at 12v Vcc. The 1st one changes 3.3v to 5v (no idea why just yet), the 2nd inverts the 5v to 0v, then the 3rd inverts the 0v to 12v. And it seems quite reliable.
I tested a CD4069 two inverter setup and it requires appx a 6 volt input to get 12 volts out with a 12 volt supply.
If I'm correct that's normally the case where the input required is appx 1/2 the supply.
All unused input pins should be grounded.
1762723659783.png
 
Last edited:

MisterBill2

Joined Jan 23, 2018
27,186
The CMOS voltage changer ICs were the CD4009 hex inverter and the CD4010 hex buffer. There may be newer devices, or those exact ICs might still be available.
 

sghioto

Joined Dec 31, 2017
8,633
I believe with a 3.3v input and with a 12v Vdd, then the output should be somewhere about 11v
That's appx what I show with a single inverter but the output of the 4069 inverter goes to 12 volts when the input is zero volts.
So there's no logic change on the output of the inverter chip with a zero to 3.3V input.
It can still work using the PC817 changing R1 to 330 ohms and adding R3.
1762809599940.png
Or this option:
1762810171132.png
 
Last edited:

Thread Starter

gray-b

Joined Aug 4, 2025
87
I see that the advert for these PC817 modules has changed to show that the lowest input voltage is 3.6v

Screenshot 2025-11-11 081703.png

But even then, it is borderline.

And as you rightly say, the R1 value must be reduced (817 module), to accommodate the voltage drop of the 817 LED and the on-board LED. Or to bypass the onboard LED/resistor totally and add a low value resistor.

For me personally, I am going to use totally discrete 817 chips

I still do not understand why my 1st inverter only changes 3.3v to 5v . As 3.3v is within the parameters of a logic level 1 with a 12v Vcc

If 3.3v is deemed to be logic 0 then output should be logic 1 (12volt)
and likewise if 3.3v is deemed to be logic 1 then output should be logic 0 (0volt)

For reference to a similar post raspberry pi
 
Last edited:

panic mode

Joined Oct 10, 2011
4,866
Is this going to work ? Any thoughts.
View attachment 358507
no... the Vf of the emitter in the optocoupler and Vf of the indicator LED are likely to exceed supply of 3.3V. and even if that is not the case (say you have some 0.2V spare), current will be too low ... 0.2V/3k= 0.066mA. and you want that current to be some 5-10mA.

so this is the correct circuit:
1762884281689.png
 

Thread Starter

gray-b

Joined Aug 4, 2025
87
What I have is the above, but with some readings.

20251112_163136 resized.jpg

The circuit is displayed above. Vin measured at the source with nothing connected is 3.3volts. However, as soon as plugged into the above, the source voltage drops to 1.5volts. This might be due to the source not being capable of supplying much current, probably in the very low mA, and with a relatively high current demand due to LED's it drags the voltage down.

However with everything connected I get

Vin = 1.5v and Vout = 5v
Vin = 0.13v and Vout = 0v

Thinking was due to the LEDs causing the drop in voltage, I removed the LED and 100 ohm. But I get the same results.

In reducing the 10k to 3k I get

Vin = 1.5v and Vout = 1.5v
Vin = 0.1v and Vout = 0v

Thinking about it now I should have tried using a 20k resistor (I will try that in the morning). It might increase the voltage??

I will also try and get my spare PC PSU out, so hopefully that can deliver 3.3v and maintain a higher current output.
 

Thread Starter

gray-b

Joined Aug 4, 2025
87
Now with a 20k resistor going to earth and the same feeble 3.3v signal, we get the following results
Vin = 0.1v and Vout = 0v
Vin 1.5v and Vout = 9.5v

But now using a psu with more current to supply the 3.3v signal and the 20k resistor, we get
Vin = 3.3v and Vout = 11.5v
Vin = 0.02v and Vout = 0v

Going back one stage using a 10k resistor and a psu with more current to supply the 3.3v signal.
Vin = 3.3v and Vout = 12v
Vin = 0.2v and Vout = 0v

20251113_140926-resized.jpg

This last test seems to confirm a 10k resistor and a more man enough signal.

So any suggestions of how to bump up the power of the feeble 3.3v signal?
 

sghioto

Joined Dec 31, 2017
8,633
What is the source of the original 3.3 volt signal?
You mentioned there is a spare inverter chip on the board.
Try this circuit from post #13
1763047781110.png
 
Last edited:

ci139

Joined Jul 11, 2016
1,949
. . .
So any suggestions of how to bump up the power of the feeble 3.3v signal?

https://global.sharp/products/device/lineup/data/pdf/datasheet/PC817XxNSZ1B_e.pdf
https://www.we-online.com/components/products/datasheet/140817140310.pdf
https://www.onsemi.com/download/data-sheet/pdf/fod814-d.pdf
https://www.unisonic.com.tw/uploadfiles/836/part_no_pdf/UPC817.pdf
▲ there are several T°j ~ Ic ~ Rʟ related dependencies that will affect your output level and timing

also - the possible optimal solution depends on the characteristics of your input signal
IF it's a random single not too frequent (relatively) short pulse you can collect power from 3.3V supply to cap via limiting R or pMOS (← an upper shoulder of the CC mirror)
IF it's general (comparable to a normal distribution (in time)) digital train of "0"-s & "1"-s you may need to amplify it by ► ss mosfet gate driver ◄► comparator ◄► digital buffer ◄► common-C/-D or common-E/-S ◄

there are faster isolator chips if this particular one does not meet your design tolerances


UFBFLVCopt.png

made the above less dependent on input impedance

UFBFLVCopt-mod.png
 
Last edited:
Top